HElib  1.0
Implementing Homomorphic Encryption
 All Classes Files Functions Variables Friends Pages
Public Member Functions | List of all members
RandomState Class Reference

Facility for "restoring" the NTL PRG state. More...

#include <NumbTh.h>

Public Member Functions

void restore ()
 Restore the PRG state of NTL.
 

Detailed Description

Facility for "restoring" the NTL PRG state.

NTL's random number generation faciliity is pretty limited, and does not provide a way to save/restore the state of a pseudo-random stream. This class gives us that ability: Constructing a RandomState object uses the PRG to generate 512 bits and stores them. Upon destruction (or an explicit call to restore()), these bits are used to re-set the seed of the PRG. A typical usage of thie class is as follows:

{
RandomState r; // save the random state
SetSeed(something); // set the PRG seed to something
... // more code that uses the new PRG seed
} // The destructor is called implicitly, PRG state is restored

The documentation for this class was generated from the following file: