Struct esp32c2_hal::Rng
source · pub struct Rng { /* private fields */ }
Expand description
Random Number Generator
It should be noted that there are certain pre-conditions which must be met in order for the RNG to produce true random numbers. The hardware RNG produces true random numbers under any of the following conditions:
- RF subsystem is enabled (i.e. Wi-Fi or Bluetooth are enabled).
- An internal entropy source has been enabled by calling
bootloader_random_enable()
and not yet disabled by callingbootloader_random_disable()
. - While the ESP-IDF Second stage bootloader is running. This is because the
default ESP-IDF bootloader implementation calls
bootloader_random_enable()
when the bootloader starts, andbootloader_random_disable()
before executing the app.
When any of these conditions are true, samples of physical noise are continuously mixed into the internal hardware RNG state to provide entropy. If none of the above conditions are true, the output of the RNG should be considered pseudo-random only.
For more information, please refer to the ESP-IDF documentation: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/random.html
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Rng
impl Send for Rng
impl !Sync for Rng
impl Unpin for Rng
impl UnwindSafe for Rng
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more