Hardware generated random numbers using RDRAND instruction.
More...
Hardware generated random numbers using RDRAND instruction.
- See also
- MaurerRandomnessTest() for random bit generators
- Since
- Crypto++ 5.6.3
Definition at line 39 of file rdrand.h.
◆ RDRAND()
RDRAND::RDRAND |
( |
unsigned int |
retries = 4 | ) |
|
|
inline |
Construct a RDRAND generator.
- Parameters
-
retries | the number of retries for failed calls to the hardware |
RDRAND() constructs a generator with a maximum number of retires for failed generation attempts.
According to DJ of Intel, the Intel RDRAND circuit does not underflow. If it did hypothetically underflow, then it would return 0 for the random value. Its not clear what AMD's behavior will be, and what the returned value will be if underflow occurs. Also see RDRAND not really random with Oracle Studio 12.3 + patches
Definition at line 54 of file rdrand.h.
◆ AlgorithmName()
std::string RDRAND::AlgorithmName |
( |
| ) |
const |
|
inlinevirtual |
Provides the name of this algorithm.
- Returns
- the standard algorithm name
The standard algorithm name can be a name like AES or AES/GCM. Some algorithms do not have standard names yet. For example, there is no standard algorithm name for Shoup's ECIES.
- Note
- AlgorithmName is not universally implemented yet
Reimplemented from Algorithm.
Definition at line 42 of file rdrand.h.
◆ GetRetries()
unsigned int RDRAND::GetRetries |
( |
| ) |
const |
|
inline |
Retrieve the number of retries used by the generator.
- Returns
- the number of times GenerateBlock() will attempt to recover from a failed generation
Definition at line 60 of file rdrand.h.
◆ SetRetries()
void RDRAND::SetRetries |
( |
unsigned int |
retries | ) |
|
|
inline |
Set the number of retries used by the generator.
- Parameters
-
retries | number of times GenerateBlock() will attempt to recover from a failed generation |
Definition at line 67 of file rdrand.h.
◆ GenerateBlock()
virtual void RDRAND::GenerateBlock |
( |
byte * |
output, |
|
|
size_t |
size |
|
) |
| |
|
inlinevirtual |
Generate random array of bytes.
- Parameters
-
output | the byte buffer |
size | the length of the buffer, in bytes |
Reimplemented from RandomNumberGenerator.
Definition at line 78 of file rdrand.h.
◆ DiscardBytes()
virtual void RDRAND::DiscardBytes |
( |
size_t |
n | ) |
|
|
inlinevirtual |
Generate and discard n bytes.
- Parameters
-
n | the number of bytes to generate and discard |
the RDSEED generator discards words, not bytes. If n is not a multiple of a machine word, then it is rounded up to that size.
Reimplemented from RandomNumberGenerator.
Definition at line 92 of file rdrand.h.
◆ IncorporateEntropy()
virtual void RDRAND::IncorporateEntropy |
( |
const byte * |
input, |
|
|
size_t |
length |
|
) |
| |
|
inlinevirtual |
Update RNG state with additional unpredictable values.
- Parameters
-
The operation is a nop for this generator.
Reimplemented from RandomNumberGenerator.
Definition at line 102 of file rdrand.h.
The documentation for this class was generated from the following file: