9 #ifndef CRYPTOPP_IMPORTS 20 : m_pCipher(new
AES::Encryption), m_keySet(false)
22 memset(m_key, 0, m_key.SizeInBytes());
23 memset(m_seed, 0, m_seed.SizeInBytes());
29 hash.Update(m_key, 32);
30 hash.Update(input, length);
40 m_pCipher->
SetKey(m_key, 32);
43 TimerWord tw = timer.GetCurrentTimerValue();
45 *(TimerWord *)m_seed.
data() += tw;
47 time_t t = time(NULL);
52 assert(m_seed.
size() >= 16);
53 word64 tt1, tt2 = (word64)t;
54 memcpy(&tt1, m_seed.
data()+8, 8);
55 memcpy(m_seed.
data()+8, &(tt2 += tt1), 8);
58 *((
volatile TimerWord*)&tw) = 0;
59 *((
volatile word64*)&tt1) = 0;
60 *((
volatile word64*)&tt2) = 0;
void IncorporateEntropy(const byte *input, size_t length)
Update RNG state with additional unpredictable values.
virtual void SetKey(const byte *key, size_t length, const NameValuePairs ¶ms=g_nullNameValuePairs)
Sets or reset the key of this object.
implements the SHA-256 standard
void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size)
Generate random bytes into a BufferedTransformation.
size_type size() const
Provides the count of elements in the SecBlock.
#define CRYPTOPP_COMPILE_ASSERT(expr)
Compile time assertion.
A::pointer data()
Provides a pointer to the first element in the memory block.
Class file for the AES cipher (Rijndael)
const T1 UnsignedMin(const T1 &a, const T2 &b)
Safe comparison of values that could be neagtive and incorrectly promoted.
AES winner, announced on 10/2/2000
Classes for SHA-1 and SHA-2 family of message digests.
Crypto++ library namespace.