|
|
@@ -24,28 +24,13 @@ extern "C" {
|
|
|
/**
|
|
|
* @brief Get one random 32-bit word from hardware RNG
|
|
|
*
|
|
|
- * The hardware RNG produces true random numbers under any of the following conditions:
|
|
|
- *
|
|
|
- * - An RF subsystem is running (i.e. Bluetooth or WiFi is enabled)
|
|
|
- * - An internal entropy source has been enabled by calling bootloader_random_enable()
|
|
|
- * and not yet disabled by calling bootloader_random_disable()
|
|
|
- * - While the ESP-IDF bootloader is running (due to the internal entropy source being enabled
|
|
|
- * for the duration of bootloader execution).
|
|
|
- *
|
|
|
- * If none of the above conditions are true, the hardware RNG will produce pseudo-random numbers only.
|
|
|
- *
|
|
|
- * When the hardware RNG is producing true random numbers, external entropy (noise samples) are
|
|
|
- * continuously mixed into the internal hardware RNG state. Consult the SoC Technical Reference Manual
|
|
|
- * for more details.
|
|
|
+ * If Wi-Fi or Bluetooth are enabled, this function returns true random numbers. In other
|
|
|
+ * situations, if true random numbers are required then consult the ESP-IDF Programming
|
|
|
+ * Guide "Random Number Generation" section for necessary prerequisites.
|
|
|
*
|
|
|
* This function automatically busy-waits to ensure enough external entropy has been
|
|
|
* introduced into the hardware RNG state, before returning a new random number.
|
|
|
*
|
|
|
- * If generating random numbers from an app which has not yet enabled Bluetooth or Wi-Fi, call the
|
|
|
- * API function bootloader_random_enable() before generating random numbers and then call
|
|
|
- * bootloader_random_disable() before using any APIs for Bluetooth, Wi-Fi, ADC, or I2S. Consult the
|
|
|
- * bootloader_random.h header for more details.
|
|
|
- *
|
|
|
* @return Random value between 0 and UINT32_MAX
|
|
|
*/
|
|
|
uint32_t esp_random(void);
|
|
|
@@ -53,7 +38,8 @@ uint32_t esp_random(void);
|
|
|
/**
|
|
|
* @brief Fill a buffer with random bytes from hardware RNG
|
|
|
*
|
|
|
- * @note This function has the same restrictions regarding available entropy as esp_random()
|
|
|
+ * @note This function is implemented via calls to esp_random(), so the same
|
|
|
+ * constraints apply.
|
|
|
*
|
|
|
* @param buf Pointer to buffer to fill with random numbers.
|
|
|
* @param len Length of buffer in bytes
|