7
7
NAMESPACE_BEGIN(CryptoPP)
10
/*! This class can be used to generate
11
pseudorandom bytes after seeding the pool with
13
class CRYPTOPP_DLL RandomPool : public RandomNumberGenerator,
14
public Bufferless<BufferedTransformation>
10
/*! This class can be used to generate cryptographic quality
11
pseudorandom bytes after seeding the pool with IncorporateEntropy() */
12
class CRYPTOPP_DLL RandomPool : public RandomNumberGenerator, public NotCopyable
17
//! poolSize must be greater than 16
18
RandomPool(unsigned int poolSize=384);
20
size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking);
22
bool AnyRetrievable() const {return true;}
23
lword MaxRetrievable() const {return ULONG_MAX;}
25
size_t TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel=NULL_CHANNEL, bool blocking=true);
26
size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=NULL_CHANNEL, bool blocking=true) const
28
throw NotImplemented("RandomPool: CopyRangeTo2() is not supported by this store");
32
void GenerateBlock(byte *output, size_t size);
34
void IsolatedInitialize(const NameValuePairs ¶meters) {}
17
bool CanIncorporateEntropy() const {return true;}
18
void IncorporateEntropy(const byte *input, size_t length);
19
void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size);
21
// for backwards compatibility. use RandomNumberSource, RandomNumberStore, and RandomNumberSink for other BufferTransformation functionality
22
void Put(const byte *input, size_t length) {IncorporateEntropy(input, length);}
40
SecByteBlock pool, key;
41
size_t addPos, getPos;
25
FixedSizeSecBlock<byte, 32> m_key;
26
FixedSizeSecBlock<byte, 16> m_seed;
27
member_ptr<BlockCipher> m_pCipher;