ASCON Suite
Functions
ascon-trng-mixer.c File Reference
#include "ascon-trng.h"
#include "core/ascon-select-backend.h"
#include <ascon/utility.h>

Go to the source code of this file.

Functions

int ascon_trng_init (ascon_trng_state_t *state)
 Initializes the random number source for generating a sequence of masking material at high speed. More...
 
void ascon_trng_free (ascon_trng_state_t *state)
 Frees the random number source and destroys any sensitive material. More...
 
uint32_t ascon_trng_generate_32 (ascon_trng_state_t *state)
 Generates a 32-bit random value for masking operations. More...
 
uint64_t ascon_trng_generate_64 (ascon_trng_state_t *state)
 Generates a 64-bit random value for masking operations. More...
 
int ascon_trng_reseed (ascon_trng_state_t *state)
 Reseeds the random number source. More...
 

Function Documentation

◆ ascon_trng_free()

void ascon_trng_free ( ascon_trng_state_t state)

Frees the random number source and destroys any sensitive material.

Parameters
stateState information for the source.

Definition at line 47 of file ascon-trng-mixer.c.

◆ ascon_trng_generate_32()

uint32_t ascon_trng_generate_32 ( ascon_trng_state_t state)

Generates a 32-bit random value for masking operations.

Parameters
stateState information for the source.
Returns
A random 32-bit value.

This function must operate quickly as it is used in high frequency masking operations. The source may not be reseeded automatically.

Definition at line 53 of file ascon-trng-mixer.c.

◆ ascon_trng_generate_64()

uint64_t ascon_trng_generate_64 ( ascon_trng_state_t state)

Generates a 64-bit random value for masking operations.

Parameters
stateState information for the source.
Returns
A random 64-bit value.

This function must operate quickly as it is used in high frequency masking operations. The source may not be reseeded automatically.

Definition at line 75 of file ascon-trng-mixer.c.

◆ ascon_trng_init()

int ascon_trng_init ( ascon_trng_state_t state)

Initializes the random number source for generating a sequence of masking material at high speed.

Parameters
stateReturns state information for accessing the source.
Returns
Non-zero if the random number source was initialized, or zero if there is no random number source available.

Definition at line 33 of file ascon-trng-mixer.c.

◆ ascon_trng_reseed()

int ascon_trng_reseed ( ascon_trng_state_t state)

Reseeds the random number source.

Parameters
stateState information for the source.
Returns
Non-zero if we have a random number source, or zero if we don't or it is inoperable.

Not all random numbers sources require reseeding, but it is a good idea to call this on a regular basis regardless.

Definition at line 98 of file ascon-trng-mixer.c.