random.h

Module providing a TRNG for use with TLS and other secure applications.

Author

Anthony Cagliano

Author

Adam Beckingham

Author

Codex 5.5 (DRBG async call-path assistance)

References

  • NIST SP 800-90B

  • NIST SP 800-90A

  • RFC 4086

Warning

Use this module for all applications requiring cryptographic randomness. The toolchain rand() functions are not suitable for cryptographic or security-sensitive purposes.

Typedefs

typedef void (*tls_random_request_cb_t)(bool ok, void *arg)

Functions

bool tls_random_init_entropy(void)
uint64_t tls_random(void)
void *tls_random_bytes(void *buffer, size_t len)
bool tls_rng_healthcheck(void)
bool tls_request_random_bytes(uint8_t *out, size_t len, tls_random_request_cb_t cb, void *arg, bool blocking)
bool tls_rng_is_busy(void)