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);
106 word32 old = m_divisor;
107 m_divisor = DivisorHelper(divisor);
126 inline word32 DivisorHelper(word32 divisor)
128 return divisor > 3 ? 3 : divisor;
133 word32 m_divisor, m_msr;
138 #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.
std::string AlgorithmProvider() const
Retrieve the provider of this algorithm.
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.