RandomNumberGenerator Class Reference

#include <cryptlib.h>

Inheritance diagram for RandomNumberGenerator:

Algorithm Clonable AutoSeededX917RNG< BLOCK_CIPHER > BlockingRng ClassNullRNG FixedRNG KDF2_RNG LC_RNG NonblockingRng PublicBlumBlumShub RandomPool Weak1::ARC4_Base X917RNG List of all members.

Detailed Description

interface for random number generators

All return values are uniformly distributed over the range specified.

Definition at line 628 of file cryptlib.h.

Public Member Functions

virtual void IncorporateEntropy (const byte *input, size_t length)
 update RNG state with additional unpredictable values
virtual bool CanIncorporateEntropy () const
 returns true if IncorporateEntropy is implemented
virtual byte GenerateByte ()
 generate new random byte and return it
virtual unsigned int GenerateBit ()
 generate new random bit and return it
virtual word32 GenerateWord32 (word32 a=0, word32 b=0xffffffffL)
 generate a random 32 bit word in the range min to max, inclusive
virtual void GenerateBlock (byte *output, size_t size)
 generate random array of bytes
virtual void DiscardBytes (size_t n)
 generate and discard n bytes
virtual void GenerateIntoBufferedTransformation (BufferedTransformation &target, const std::string &channel, lword length)
 generate random bytes as input to a BufferedTransformation
template<class IT>
void Shuffle (IT begin, IT end)
 randomly shuffle the specified array, resulting permutation is uniformly distributed
virtual std::string AlgorithmName () const
 returns name of this algorithm, not universally implemented yet
virtual ClonableClone () const
 this is not implemented by most classes yet


Member Function Documentation

unsigned int RandomNumberGenerator::GenerateBit (  )  [virtual]

generate new random bit and return it

Default implementation is to call GenerateByte() and return its lowest bit.

Reimplemented in PublicBlumBlumShub.

Definition at line 129 of file cryptlib.cpp.

References GenerateByte().

Referenced by XTR_FindPrimesAndGenerator().


The documentation for this class was generated from the following files:
Generated on Fri Jun 1 11:11:46 2007 for Crypto++ by  doxygen 1.5.2