31 #define ASCON_RANDOM_RESEED_LIMIT 16384
78 ascon_random_rekey(
state);
108 state->counter += outlen;
113 ascon_random_rekey(
state);
129 ascon_random_rekey(
state);
141 ascon_random_rekey(
state);
int ascon_random_reseed(ascon_random_state_t *state)
Explicitly re-seeds a pseudorandom number generator from the system random number source.
void ascon_random_fetch(ascon_random_state_t *state, unsigned char *out, size_t outlen)
Fetches data from a pseudorandom number generator.
#define ASCON_RANDOM_RESEED_LIMIT
Automatically re-seed after generating more than this many bytes.
void ascon_random_free(ascon_random_state_t *state)
Frees a pseudorandom number generator and destroys any sensitive values.
int ascon_random_init(ascon_random_state_t *state)
Initializes a pseudorandom number generator from the system random number source.
void ascon_random_feed(ascon_random_state_t *state, const unsigned char *entropy, size_t size)
Feeds entropy into a pseudorandom number generator.
int ascon_trng_generate(unsigned char *out, size_t outlen)
Generates a buffer of bytes from the system TRNG source.
Access to the system's random number source.
#define ASCON_SYSTEM_SEED_SIZE
Number of bytes to request from the system TRNG to seed a PRNG.
void ascon_overwrite_with_zeroes(ascon_state_t *state, unsigned offset, unsigned size)
Overwrites a part of the ASCON state with zeroes.
void ascon_release(ascon_state_t *state)
Temporarily releases access to any shared hardware resources that a permutation state was using.
void ascon_permute(ascon_state_t *state, uint8_t first_round)
Permutes the ASCON state with a specified number of rounds.
void ascon_acquire(ascon_state_t *state)
Re-acquires access to any shared hardware resources that a permutation state was using.
Pseudorandom number generator (PRNG) built around ASCON.
int ascon_random(unsigned char *out, size_t outlen)
Gets a block of random data from the system.
ascon_state_t state
[snippet_key]
State information for a pseudorandom number generator.
System utilities of use to applications that use ASCON.
void ascon_clean(void *buf, unsigned size)
Cleans a buffer that contains sensitive material.
void ascon_xof_free(ascon_xof_state_t *state)
Frees the ASCON-XOF state and destroys any sensitive material.
void ascon_xof_pad(ascon_xof_state_t *state)
Absorbs enough zeroes into an ASCON-XOF state to pad the input to the next multiple of the block rate...
void ascon_xof_absorb(ascon_xof_state_t *state, const unsigned char *in, size_t inlen)
Absorbs more input data into an ASCON-XOF state.
#define ASCON_XOF_RATE
Rate of absorbing and squeezing data for ASCON-XOF, ASCON-XOFA, ASCON-HASH, and ASCON-HASHA.
void ascon_xof_init_custom(ascon_xof_state_t *state, const char *function_name, const unsigned char *custom, size_t customlen, size_t outlen)
Initializes the state for an incremental ASCON-XOF operation, with a named function,...
void ascon_xof_squeeze(ascon_xof_state_t *state, unsigned char *out, size_t outlen)
Squeezes output data from an ASCON-XOF state.