pub struct Rng<'d, M: Mode> { /* private fields */ }Expand description
Driver for the true random number generator.
The AES and public key engines also draw from the generator for their side-channel countermeasures. It keeps running from its first use until the accelerator powers down.
Implementations§
Source§impl<'d> Rng<'d, Blocking>
impl<'d> Rng<'d, Blocking>
Sourcepub fn new_blocking(_peri: Peri<'d, CRYPTO_RNG>) -> Self
pub fn new_blocking(_peri: Peri<'d, CRYPTO_RNG>) -> Self
Creates a new blocking RNG driver.
Source§impl<'d, M: Mode> Rng<'d, M>
impl<'d, M: Mode> Rng<'d, M>
Sourcepub fn blocking_fill_bytes(&mut self, dest: &mut [u8])
pub fn blocking_fill_bytes(&mut self, dest: &mut [u8])
Fills the buffer with random bytes.
Sourcepub fn blocking_next_u32(&mut self) -> u32
pub fn blocking_next_u32(&mut self) -> u32
Returns a random u32.
Sourcepub fn blocking_next_u64(&mut self) -> u64
pub fn blocking_next_u64(&mut self) -> u64
Returns a random u64.
Trait Implementations§
Auto Trait Implementations§
impl<'d, M> Freeze for Rng<'d, M>
impl<'d, M> RefUnwindSafe for Rng<'d, M>
impl<'d, M> Send for Rng<'d, M>
impl<'d, M> Sync for Rng<'d, M>
impl<'d, M> Unpin for Rng<'d, M>
impl<'d, M> UnsafeUnpin for Rng<'d, M>
impl<'d, M> UnwindSafe for Rng<'d, M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more