Crypto++  5.6.3
Free C++ class library of cryptographic schemes
randpool.h
1 #ifndef CRYPTOPP_RANDPOOL_H
2 #define CRYPTOPP_RANDPOOL_H
3 
4 #include "cryptlib.h"
5 #include "filters.h"
6 #include "secblock.h"
7 #include "smartptr.h"
8 #include "aes.h"
9 
10 NAMESPACE_BEGIN(CryptoPP)
11 
12 //! Randomness Pool
13 /*! This class can be used to generate cryptographic quality
14  pseudorandom bytes after seeding the pool with IncorporateEntropy() */
15 class CRYPTOPP_DLL RandomPool : public RandomNumberGenerator, public NotCopyable
16 {
17 public:
18  RandomPool();
19 
20  bool CanIncorporateEntropy() const {return true;}
21  void IncorporateEntropy(const byte *input, size_t length);
22  void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size);
23 
24  // for backwards compatibility. use RandomNumberSource, RandomNumberStore, and RandomNumberSink for other BufferTransformation functionality
25  void Put(const byte *input, size_t length) {IncorporateEntropy(input, length);}
26 
27 private:
30  member_ptr<BlockCipher> m_pCipher;
31  bool m_keySet;
32 };
33 
34 NAMESPACE_END
35 
36 #endif
Randomness Pool.
Definition: randpool.h:15
bool CanIncorporateEntropy() const
Determines if a generator can accept additional entropy.
Definition: randpool.h:20
Abstract base classes that provide a uniform interface to this library.
Classes for automatic resource management.
Interface for random number generators.
Definition: cryptlib.h:1085
Interface for buffered transformations.
Definition: cryptlib.h:1247
Classes and functions for secure memory allocations.
Class file for the AES cipher (Rijndael)
Implementation of BufferedTransformation&#39;s attachment interface in cryptlib.h.
Crypto++ library namespace.
Ensures an object is not copyable.
Definition: misc.h:184