Retrieves the RNG context state.
#include "hurandom.h"
int hu_RngGetState(sb_RNGCtx rngCtx, size_t *stateLen, unsigned char *state, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
An RNG context object pointer.
The length (in bytes) of v.
The PRNG running secret.
A global context.
This function allows you to retrieve the running secret, state, which is associated with the PRNG specification.
This function can be useful if you want the PRNG byte stream to survive a reboot or a program restart. In order to restore the PRNG byte stream, you need to know the initial seeding values, and call this API to retrieve the value of state before the rngCtx is destroyed. If you have these values, then after the reboot or program restart, the seeding values and state value can be passed to the RNG create function, which will restore the PRNG byte stream to its state prior to the disruption.
If you use this API, you must ensure that the stored seed and state are kept secret; otherwise this will reduce the overall security of your system. We recommend that you not use this API unless you are very familiar with cryptographic issues.
For PRNG X.931 the running state is v.
The RNG context is NULL.
stateLen is NULL.
The RNG context is invalid.
stateLen is not big enough.
Success.