8 #ifndef CRYPTOPP_RDRAND_H 9 #define CRYPTOPP_RDRAND_H 32 : Exception(OTHER_ERROR,
"RDRAND: " + operation +
" operation failed") {}
46 RDRAND(
unsigned int retries = 8) : m_retries(retries) {}
67 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 71 CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size);
72 throw NotImplemented(
"RDRAND: rdrand is not available on this platform");
81 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 86 throw NotImplemented(
"RDRAND: rdrand is not available on this platform");
97 CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length);
102 unsigned int m_retries;
111 :
Exception(OTHER_ERROR,
"RDSEED: " + operation +
" operation failed") {}
125 RDSEED(
unsigned int retries = 8) : m_retries(retries) {}
146 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 150 CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size);
151 throw NotImplemented(
"RDSEED: rdseed is not available on this platform");
160 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 165 throw NotImplemented(
"RDSEED: rdseed is not available on this platform");
176 CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length);
181 unsigned int m_retries;
186 #endif // CRYPTOPP_RDRAND_H Base class for all exceptions thrown by Crypto++.
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.
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.
RDSEED(unsigned int retries=8)
Construct a RDSEED generator.
void SetRetries(unsigned int retries)
Set the number of retries used by the generator.
Crypto++ library namespace.
RDRAND(unsigned int retries=8)
Construct a RDRAND generator.
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.