
Functions | |
| WOLFSSL_API int | wc_InitNetRandom (const char *, wnr_hmac_key, int) |
| Init global Whitewood netRandom context. More... | |
| WOLFSSL_API int | wc_FreeNetRandom (void) |
| Free global Whitewood netRandom context. More... | |
| WOLFSSL_API 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... | |
| WOLFSSL_API int | wc_RNG_GenerateBlock (WC_RNG *, byte *, word32 sz) |
| Copies a sz bytes of pseudorandom data to output. Will reseed rng if needed (blocking). More... | |
| WOLFSSL_API int | wc_RNG_GenerateByte (WC_RNG *, byte *) |
| Calls wc_RNG_GenerateBlock to copy a byte of pseudorandom data to b. Will reseed rng if needed. More... | |
| WOLFSSL_API 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... | |
| WOLFSSL_API 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... | |
| WOLFSSL_API int wc_FreeNetRandom | ( | void | ) |
Free global Whitewood netRandom context.
| none | No returns. |
Example
| int wc_FreeRng | ( | WC_RNG * | 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
| WOLFSSL_API int wc_InitNetRandom | ( | const char * | , |
| wnr_hmac_key | , | ||
| int | |||
| ) |
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 * | 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
| WOLFSSL_ABI int wc_RNG_GenerateBlock | ( | WC_RNG * | rng, |
| byte * | output, | ||
| 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_GenerateByte | ( | WC_RNG * | rng, |
| byte * | b | ||
| ) |
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
| 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