MPHELL
4.0.0
|
Declaration of the Deterministic Random Bit Generator functions. Details can be found in "NIST Special Publication 800-90A, Recommendation for Random Number Generation Using Deterministic Random Bit Generators". More...
#include "mphell-drbg_internal.h"
Go to the source code of this file.
Functions | |
void | drbg_instantiate (mphell_status ret, int8_t *state_handle, const uint16_t requested_instantiation_security_strength, const drbg_type type, const entropy_type entropy_src, uint64_t reseed_interval, const uint8_t *entropy, const uint16_t entropy_length, const uint8_t *nonce, const uint16_t nonce_length, const uint8_t *personalization_string, const uint64_t pers_length) |
void | drbg_reseed (mphell_status ret, const int8_t state_handle, const uint8_t *entropy, const uint16_t entropy_length, const uint8_t *additional_input, const uint64_t add_length) |
Reseed the DRBG, "acquires new entropy input and combines it with the current internal state and any additional input that is provided to create a new seed and a new internal state". More... | |
void | drbg_generate (mphell_status ret, uint8_t *returned_bytes, const int8_t state_handle, const uint32_t requested_number_of_bytes, const uint16_t requested_security_strength, const uint8_t *additional_input, const uint64_t add_length) |
"Generates pseudorandom bits upon request, using the current internal state, and generates a new internal state for the next request". More... | |
void | drbg_uninstantiate (mphell_status ret, const int8_t state_handle) |
Uninstantiate a DRBG state. More... | |
Declaration of the Deterministic Random Bit Generator functions. Details can be found in "NIST Special Publication 800-90A, Recommendation for Random Number Generation Using Deterministic Random Bit Generators".
Definition in file mphell-drbg.h.
void drbg_generate | ( | mphell_status | ret, |
uint8_t * | returned_bytes, | ||
const int8_t | state_handle, | ||
const uint32_t | requested_number_of_bytes, | ||
const uint16_t | requested_security_strength, | ||
const uint8_t * | additional_input, | ||
const uint64_t | add_length | ||
) |
"Generates pseudorandom bits upon request, using the current internal state, and generates a new internal state for the next request".
ret | Set to MPHELL_ERROR_RANDOM if an error occur, MPHELL_SUCCESS otherwise |
returned_bytes | Destination array (of requested_number_of_bytes random bits) |
state_handle | Define which DRBG state to use |
requested_number_of_bytes | Number of random bytes required |
requested_security_strength | Security (in bits) required |
additionnal_input | A string given by the user can be added to the material seed to reseed the DRBG, "can provide more assurance when recovering from the compromise of the entropy input, the seed or one or more DRBG internal states" |
add_length | Length of additional_input |
Definition at line 311 of file mphell-drbg.c.
void drbg_reseed | ( | mphell_status | ret, |
const int8_t | state_handle, | ||
const uint8_t * | entropy, | ||
const uint16_t | entropy_length, | ||
const uint8_t * | additional_input, | ||
const uint64_t | add_length | ||
) |
Reseed the DRBG, "acquires new entropy input and combines it with the current internal state and any additional input that is provided to create a new seed and a new internal state".
ret | Set to MPHELL_ERROR_RANDOM if an error occur, MPHELL_SUCCESS otherwise |
state_handle | Define which DRBG state to use |
entropy | Entropy (byte string) |
entropy_length | Entropy length (in bytes) |
additional_input | A string given by the user can be added to the material seed to reseed the DRBG, "can provide more assurance when recovering from the compromise of the entropy input, the seed or one or more DRBG internal states" |
add_length | Length of additional_input |
Definition at line 243 of file mphell-drbg.c.
void drbg_uninstantiate | ( | mphell_status | ret, |
const int8_t | state_handle | ||
) |
Uninstantiate a DRBG state.
ret | Set to MPHELL_ERROR_RANDOM if an error occur, MPHELL_SUCCESS otherwise |
state_handle | DRBG state to uninstantiate |
Definition at line 451 of file mphell-drbg.c.