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);
107 m_divisor = DivisorHelper(divisor);
128 return divisor > 3 ? 3 : divisor;
Base class for all exceptions thrown by the library.
Fixed size stack-based SecBlock with 16-byte alignment.
Exception thrown when a PadlockRNG generator encounters a generator related error.
Hardware generated random numbers using VIA XSTORE.
PadlockRNG(word32 divisor=1)
Construct a PadlockRNG generator.
virtual void DiscardBytes(size_t n)
Generate and discard n bytes.
virtual void GenerateBlock(byte *output, size_t size)
Generate random array of bytes.
word32 GetMSR() const
Get the MSR for the last operation.
word32 GetDivisor() const
Get the XSTORE divisor.
virtual void IncorporateEntropy(const byte *input, size_t length)
Update RNG state with additional unpredictable values.
std::string AlgorithmProvider() const
Retrieve the provider of this algorithm.
word32 SetDivisor(word32 divisor)
Set the XSTORE divisor.
Interface for random number generators.
unsigned int word32
32-bit unsigned datatype
Abstract base classes that provide a uniform interface to this library.
Crypto++ library namespace.
Classes and functions for secure memory allocations.