From e9e1f9cce48cb6a593025320cd3a8c9388032a58 Mon Sep 17 00:00:00 2001 From: chrysn Date: Thu, 23 Nov 2023 16:53:52 +0100 Subject: [PATCH] sys/random doc: Point to auto initialization and its caveats --- sys/include/random.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/include/random.h b/sys/include/random.h index 317caa8bc4..56baa9f7a6 100644 --- a/sys/include/random.h +++ b/sys/include/random.h @@ -21,6 +21,11 @@ * HWRNG differ in how they generate random numbers and may not use a PRNG internally. * Refer to the manual of your MCU for details. * + * By default, the `auto_init_random` module is enabled, which initializes the + * PRNG on startup. However, there is no lower limit on the entropy provided at + * that time. Unless the `periph_hwrng` module is used, entropy may be as + * little as zero (the constant may even be the same across devices). + * * @{ * * @file @@ -55,6 +60,9 @@ extern "C" { /** * @brief initializes PRNG with a seed * + * Users only need to call this if the `auto_init_random` module is disabled, + * or provides insufficient quality entropy. + * * @warning Currently, the random module uses a global state * => multiple calls to @ref random_init will reset the existing * state of the PRNG.