Crypto++
5.6.5
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
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;
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
A method was called which was not implemented.
RDSEED(unsigned int retries=64)
Construct a RDSEED generator.
virtual void GenerateBlock(byte *output, size_t size)
Generate random array of bytes.
void SetRetries(unsigned int retries)
Set the number of retries used by the generator.
std::string AlgorithmName() const
Provides the name of this algorithm.
unsigned int GetRetries() const
Retrieve the number of retries used by the generator.
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.
virtual void DiscardBytes(size_t n)
Generate and discard n bytes.
virtual void DiscardBytes(size_t n)
Generate and discard n bytes.
Interface for random number generators.
Hardware generated random numbers using RDSEED instruction.
Base class for all exceptions thrown by the library.
Exception thrown when a RDRAND generator encounters a generator related error.
unsigned int GetRetries() const
Retrieve the number of retries used by the generator.
Exception thrown when a RDSEED generator encounters a generator related error.
RDRAND(unsigned int retries=4)
Construct a RDRAND generator.
virtual void GenerateBlock(byte *output, size_t size)
Generate random array of bytes.
std::string AlgorithmName() const
Provides the name of this algorithm.
virtual void IncorporateEntropy(const byte *input, size_t length)
Update RNG state with additional unpredictable values.
Crypto++ library namespace.
Exception(ErrorType errorType, const std::string &s)
Construct a new Exception.
@ OTHER_ERROR
Some other error occurred not belonging to other categories.
Abstract base classes that provide a uniform interface to this library.
Hardware generated random numbers using RDRAND instruction.