26 #if defined(ASCON_TRNG_ESP)
29 #define esp_random() (*((volatile uint32_t *)0x3FF20E44))
33 extern uint32_t esp_random(
void);
40 while (outlen >=
sizeof(x)) {
42 memcpy(out, &x,
sizeof(x));
48 memcpy(out, &x, outlen);
75 return ((uint64_t)esp_random()) | (((uint64_t)esp_random()) << 32);
uint32_t ascon_trng_generate_32(ascon_trng_state_t *state)
Generates a 32-bit random value for masking operations.
uint64_t ascon_trng_generate_64(ascon_trng_state_t *state)
Generates a 64-bit random value for masking operations.
int ascon_trng_init(ascon_trng_state_t *state)
Initializes the random number source for generating a sequence of masking material at high speed.
int ascon_trng_reseed(ascon_trng_state_t *state)
Reseeds the random number source.
void ascon_trng_free(ascon_trng_state_t *state)
Frees the random number source and destroys any sensitive material.
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.
ascon_state_t state
[snippet_key]
State of the random number source.