8 #ifndef CRYPTOPP_RDRAND_H 9 #define CRYPTOPP_RDRAND_H 33 : Exception(OTHER_ERROR,
"RDRAND: " + operation +
" operation failed") {}
54 RDRAND(
unsigned int retries = 4) : m_retries(retries) {}
75 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 79 CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size);
80 throw NotImplemented(
"RDRAND: rdrand is not available on this platform");
89 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 94 throw NotImplemented(
"RDRAND: rdrand is not available on this platform");
105 CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length);
110 unsigned int m_retries;
120 :
Exception(OTHER_ERROR,
"RDSEED: " + operation +
" operation failed") {}
138 RDSEED(
unsigned int retries = 64) : m_retries(retries) {}
159 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 163 CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size);
164 throw NotImplemented(
"RDSEED: rdseed is not available on this platform");
173 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 178 throw NotImplemented(
"RDSEED: rdseed is not available on this platform");
189 CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length);
194 unsigned int m_retries;
199 #endif // CRYPTOPP_RDRAND_H Base class for all exceptions thrown by the library.
virtual void GenerateBlock(byte *output, size_t size)
Generate random array of bytes.
virtual void GenerateBlock(byte *output, size_t size)
Generate random array of bytes.
Hardware generated random numbers using RDRAND instruction.
virtual void IncorporateEntropy(const byte *input, size_t length)
Update RNG state with additional unpredictable values.
Abstract base classes that provide a uniform interface to this library.
RDSEED(unsigned int retries=64)
Construct a RDSEED generator.
Interface for random number generators.
virtual void IncorporateEntropy(const byte *input, size_t length)
Update RNG state with additional unpredictable values.
void SetRetries(unsigned int retries)
Set the number of retries used by the generator.
Exception thrown when a RDRAND generator encounters a generator related error.
virtual void DiscardBytes(size_t n)
Generate and discard n bytes.
A method was called which was not implemented.
virtual void DiscardBytes(size_t n)
Generate and discard n bytes.
unsigned int GetRetries() const
Retrieve the number of retries used by the generator.
std::string AlgorithmName() const
Provides the name of this algorithm.
Hardware generated random numbers using RDSEED instruction.
RDRAND(unsigned int retries=4)
Construct a RDRAND generator.
void SetRetries(unsigned int retries)
Set the number of retries used by the generator.
Crypto++ library namespace.
unsigned int GetRetries() const
Retrieve the number of retries used by the generator.
std::string AlgorithmName() const
Provides the name of this algorithm.
Exception thrown when a RDSEED generator encounters a generator related error.