9 #ifndef CRYPTOPP_PADLOCK_RNG_H 10 #define CRYPTOPP_PADLOCK_RNG_H 24 : Exception(OTHER_ERROR,
"PadlockRNG: " + operation +
" operation failed") {}
25 PadlockRNG_Err(
const std::string &component,
const std::string &message)
26 : Exception(OTHER_ERROR, component +
": " + message) {}
53 CRYPTOPP_STATIC_CONSTEXPR
const char* StaticAlgorithmName() {
return "PadlockRNG"; }
96 CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length);
104 word32 old = m_divisor;
105 m_divisor = DivisorHelper(divisor);
124 inline word32 DivisorHelper(word32 divisor)
126 return divisor > 3 ? 3 : divisor;
131 word32 m_divisor, m_msr;
136 #endif // CRYPTOPP_PADLOCK_RNG_H Base class for all exceptions thrown by the library.
virtual void DiscardBytes(size_t n)
Generate and discard n bytes.
Abstract base classes that provide a uniform interface to this library.
Interface for random number generators.
Hardware generated random numbers using VIA XSTORE.
virtual void IncorporateEntropy(const byte *input, size_t length)
Update RNG state with additional unpredictable values.
Classes and functions for secure memory allocations.
word32 SetDivisor(word32 divisor)
Set the XSTORE divisor.
word32 GetDivisor() const
Get the XSTORE divisor.
Exception thrown when a PadlockRNG generator encounters a generator related error.
Crypto++ library namespace.
PadlockRNG(word32 divisor=1)
Construct a PadlockRNG generator.
virtual void GenerateBlock(byte *output, size_t size)
Generate random array of bytes.
word32 GetMSR() const
Get the MSR for the last operation.