| Botan
    1.10.16
    | 
#include <randpool.h>
 
  
 | Public Member Functions | |
| void | add_entropy (const byte input[], size_t length) | 
| void | add_entropy_source (EntropySource *es) | 
| void | clear () | 
| bool | is_seeded () const | 
| std::string | name () const | 
| byte | next_byte () | 
| SecureVector< byte > | random_vec (size_t bytes) | 
| void | randomize (byte[], size_t) | 
| Randpool (BlockCipher *cipher, MessageAuthenticationCode *mac, size_t pool_blocks=32, size_t iterations_before_reseed=128) | |
| void | reseed (size_t bits_to_collect) | 
| ~Randpool () | |
| Static Public Member Functions | |
| static RandomNumberGenerator * | make_rng () | 
Definition at line 21 of file randpool.h.
| Botan::Randpool::Randpool | ( | BlockCipher * | cipher, | 
| MessageAuthenticationCode * | mac, | ||
| size_t | pool_blocks = 32, | ||
| size_t | iterations_before_reseed = 128 | ||
| ) | 
| cipher | a block cipher to use | 
| mac | a message authentication code to use | 
| pool_blocks | how many cipher blocks to use for the pool | 
| iterations_before_reseed | how many times we'll use the internal state to generate output before reseeding | 
Definition at line 169 of file randpool.cpp.
References Botan::BlockCipher::block_size(), Botan::Buffered_Computation::output_length(), Botan::MemoryRegion< T >::resize(), and Botan::SymmetricAlgorithm::valid_keylength().
| Botan::Randpool::~Randpool | ( | ) | 
Definition at line 199 of file randpool.cpp.
| 
 | virtual | 
Add entropy to this RNG.
| in | a byte array containg the entropy to be added | 
| length | the length of the byte array in | 
Implements Botan::RandomNumberGenerator.
Definition at line 127 of file randpool.cpp.
References Botan::Buffered_Computation::process(), Botan::MemoryRegion< T >::size(), and Botan::xor_buf().
| 
 | virtual | 
Add this entropy source to the RNG object
| source | the entropy source which will be retained and used by RNG | 
Implements Botan::RandomNumberGenerator.
Definition at line 140 of file randpool.cpp.
| 
 | virtual | 
Clear all internally held values of this RNG.
Implements Botan::RandomNumberGenerator.
Definition at line 148 of file randpool.cpp.
References Botan::Algorithm::clear(), and Botan::zeroise().
| 
 | inlinevirtual | 
Check whether this RNG is seeded.
Reimplemented from Botan::RandomNumberGenerator.
Definition at line 25 of file randpool.h.
Referenced by randomize().
| 
 | staticinherited | 
| 
 | virtual | 
Return the name of this object
Implements Botan::RandomNumberGenerator.
Definition at line 161 of file randpool.cpp.
References Botan::Algorithm::name(), and Botan::MessageAuthenticationCode::name().
Referenced by randomize().
| 
 | inherited | 
Return a random byte
Definition at line 19 of file rng.cpp.
References Botan::RandomNumberGenerator::randomize().
| 
 | inlineinherited | 
Return a random vector
| bytes | number of bytes in the result | 
Definition at line 40 of file rng.h.
References Botan::MemoryRegion< T >::size().
Referenced by Botan::ANSI_X931_RNG::randomize().
| 
 | virtual | 
Randomize a byte array.
| output | the byte array to hold the random output. | 
| length | the length of the byte array output. | 
Implements Botan::RandomNumberGenerator.
Definition at line 32 of file randpool.cpp.
References Botan::BlockCipher::block_size(), Botan::copy_mem(), Botan::BlockCipher::encrypt(), Botan::Buffered_Computation::final(), is_seeded(), name(), Botan::SymmetricAlgorithm::set_key(), Botan::MemoryRegion< T >::size(), Botan::Buffered_Computation::update(), and Botan::xor_buf().
| 
 | virtual | 
Seed this RNG using the entropy sources it contains.
| bits_to_collect | is the number of bits of entropy to attempt to gather from the entropy sources | 
Implements Botan::RandomNumberGenerator.
Definition at line 100 of file randpool.cpp.
References Botan::Entropy_Accumulator::bits_collected(), Botan::Buffered_Computation::final(), Botan::Entropy_Accumulator::polling_goal_achieved(), Botan::MemoryRegion< T >::size(), and Botan::xor_buf().
 1.8.13
 1.8.13