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
Success | P6R::eOk | |
Failure | P6R::eAlreadyInitialized | This function can only be called once successfully. |
P6R::eFail | Failed to properly seed the RNG. |
Facility=P6EF_CRYPTO | Code portion of value is specific to this crypto system. |