32 uint16_t random_security_strength;
42 type, entropy, 1048576);
47 random_security_strength = security_strength;
60 random_security_strength, NULL, 0);
75 random_security_strength, NULL, 0);
88 random_security_strength, NULL, 0);
105 random_security_strength = 0;
106 free(random_working_state);
void free_mphell()
Free MPHELL memory, especially the big amount of temporary memory.
void random_generate(mphell_status ret, uint8_t *returned_bytes, random_state working_state, const uint32_t requested_number_of_bytes, const uint16_t requested_security_strength, const uint8_t *additional_input, const uint64_t add_length)
Gererate an array of random bits.
void init_mphell(const uint16_t security_strength, const random_type type, const entropy_type entropy)
Initialise MPHELL with security_strength bits of security (for random number only).
uint32_t rand32()
Return a 32 bits random number using MPHELL random process.
enum random_algo random_type
Define the random algorithm (DRBG algorithm)
Declaration of MPHELL initialisation function.
void random_instantiate(mphell_status ret, random_state initial_state, const uint16_t requested_instantiation_security_strength, const uint8_t *personalization_string, const uint64_t pers_length, const random_type type, const entropy_type entropy, uint64_t reseed_interval)
Instantiate one random state.
void free_tmp_memory()
Free the stack for temporary elements.
int mphell_rng(void *param, unsigned char *res, size_t n)
Set res to n random bytes.
void mphell_error_free(char *expr)
Write in stderr, filename, line and expr, free expr and mphell.
mphell_status_t mphell_status[1]
The status is a couple (flag, information)
enum entropy_source entropy_type
Define the entropy source.
void random_uninstantiate(mphell_status ret, random_state working_state)
Uninstantiate a random state.
void alloc_tmp_memory()
Allocate the stack for temporary elements, its size is defined in mphell-define.h.