mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-06-29 20:10:59 +02:00
IDF master 1d7068e4b (#5257)
esp-dsp: master 7cc5073 esp-face: master 420fc7e esp-rainmaker: f1b82c7 esp32-camera: master 7a06a7e esp_littlefs: master b58f00c
This commit is contained in:
@ -24,27 +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.
|
||||
* introduced into the hardware RNG state, before returning a new random number. This delay
|
||||
* is very short (always less than 100 CPU cycles).
|
||||
*
|
||||
* @return Random value between 0 and UINT32_MAX
|
||||
*/
|
||||
@ -53,7 +39,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
|
||||
|
Reference in New Issue
Block a user