
|
My Project
|
Functions | |
| int | wc_InitNetRandom (const char *configFile, wnr_hmac_key hmac_cb, int timeout) |
| Init global Whitewood netRandom context. More... | |
| int | wc_FreeNetRandom (void) |
| Free global Whitewood netRandom context. More... | |
| int | wc_InitRng (WC_RNG *) |
| Gets the seed (from OS) and key cipher for rng. rng->drbg (deterministic random bit generator) allocated (should be deallocated with wc_FreeRng). This is a blocking operation. More... | |
| int | wc_RNG_GenerateBlock (WC_RNG *rng, byte *b, word32 sz) |
| Copies a sz bytes of pseudorandom data to output. Will reseed rng if needed (blocking). More... | |
| WC_RNG * | wc_rng_new (byte *nonce, word32 nonceSz, void *heap) int wc_RNG_GenerateByte(WC_RNG *rng |
| Creates a new WC_RNG structure. More... | |
| int | wc_FreeRng (WC_RNG *) |
| Should be called when RNG no longer needed in order to securely free drgb. Zeros and XFREEs rng-drbg. More... | |
| WC_RNG * | wc_rng_free (WC_RNG *rng) |
| Should be called when RNG no longer needed in order to securely free rng. More... | |
| int | wc_RNG_HealthTest (int reseed, const byte *entropyA, word32 entropyASz, const byte *entropyB, word32 entropyBSz, byte *output, word32 outputSz) |
| Creates and tests functionality of drbg. More... | |
| int wc_FreeNetRandom | ( | void | ) |
Free global Whitewood netRandom context.
| none | No returns. |
Example
| int wc_FreeRng | ( | WC_RNG * | ) |
Should be called when RNG no longer needed in order to securely free drgb. Zeros and XFREEs rng-drbg.
| rng | random number generator initialized with wc_InitRng |
Example
| int wc_InitNetRandom | ( | const char * | configFile, |
| wnr_hmac_key | hmac_cb, | ||
| int | timeout | ||
| ) |
Init global Whitewood netRandom context.
| configFile | Path to configuration file |
| hmac_cb | Optional to create HMAC callback. |
| timeout | A timeout duration. |
Example
| int wc_InitRng | ( | WC_RNG * | ) |
Gets the seed (from OS) and key cipher for rng. rng->drbg (deterministic random bit generator) allocated (should be deallocated with wc_FreeRng). This is a blocking operation.
| rng | random number generator to be initialized for use with a seed and key cipher |
Example
| WC_RNG* wc_rng_free | ( | WC_RNG * | rng | ) |
Should be called when RNG no longer needed in order to securely free rng.
| rng | random number generator initialized with wc_InitRng |
Example
| int wc_RNG_GenerateBlock | ( | WC_RNG * | rng, |
| byte * | b, | ||
| word32 | sz | ||
| ) |
Copies a sz bytes of pseudorandom data to output. Will reseed rng if needed (blocking).
| rng | random number generator initialized with wc_InitRng |
| output | buffer to which the block is copied |
| sz | size of output in bytes |
Example
| int wc_RNG_HealthTest | ( | int | reseed, |
| const byte * | entropyA, | ||
| word32 | entropyASz, | ||
| const byte * | entropyB, | ||
| word32 | entropyBSz, | ||
| byte * | output, | ||
| word32 | outputSz | ||
| ) |
Creates and tests functionality of drbg.
| int | reseed: if set, will test reseed functionality |
| entropyA | entropy to instantiate drgb with |
| entropyASz | size of entropyA in bytes |
| entropyB | If reseed set, drbg will be reseeded with entropyB |
| entropyBSz | size of entropyB in bytes |
| output | initialized to random data seeded with entropyB if seedrandom is set, and entropyA otherwise |
| outputSz | length of output in bytes |
Example
| WC_RNG* wc_rng_new | ( | byte * | nonce, |
| word32 | nonceSz, | ||
| void * | heap | ||
| ) |
Creates a new WC_RNG structure.
| heap | pointer to a heap identifier |
| nonce | pointer to the buffer containing the nonce |
| nonceSz | length of the nonce |
Example
Calls wc_RNG_GenerateBlock to copy a byte of pseudorandom data to b. Will reseed rng if needed.
| rng | random number generator initialized with wc_InitRng |
| b | one byte buffer to which the block is copied |
Example