Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IRandomInit::initialize ( P6RANDFLAGS  flags,
p6IEntropySource pSource 
)
pure virtual

Initialize and seed the random number generator (RNG).

This method must be called prior to calling any other method. An optional entropy source can be specified which the RNG will use to seed itself.

RNG state is maintained on a per thread basis. You should therefore NOT share this interace accross threads. Instead, each thread should create it's own instance of p6IRandom by calling p6CreateInstance().

Parameters
flags[ in ] Set perferences for the new object.
pSource[ in ] A pointer to the p6IEntropySource interface of an entropy source to be used for random number generation. If this is NULL, an internal, platform specific entropy source will be used. The entropy source must be properly initialized before being passed into this component.
Returns
SuccessP6R::eOk 
FailureP6R::eAlreadyInitializedThis function can only be called once successfully.
P6R::eFailFailed to properly seed the RNG.
Facility=P6EF_CRYPTOCode portion of value is specific to this crypto system.