HmacSha512Drbg

Struct HmacSha512Drbg 

Source
pub struct HmacSha512Drbg { /* private fields */ }
Expand description

HMAC-DRBG (SHA-512) wrapper implementing DeterministicRng.

Implementations§

Source§

impl HmacSha512Drbg

Source

pub fn new( entropy: &[u8], nonce: &[u8], personalization: Option<&[u8]>, ) -> Result<Self, DrbgError>

Instantiate DRBG from caller-provided entropy/nonce/personalization strings.

Source

pub fn from_os(personalization: Option<&[u8]>) -> Result<Self, DrbgError>

Instantiate DRBG using the operating system CSPRNG for entropy and nonce.

Source

pub fn inner_mut(&mut self) -> &mut HmacDrbg

Borrow the inner DRBG mutably (for adapters).

Trait Implementations§

Source§

impl Debug for HmacSha512Drbg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DeterministicRng for HmacSha512Drbg

Source§

fn fill_bytes(&mut self, out: &mut [u8]) -> Result<(), DrbgError>

Fill out with pseudorandom bytes.
Source§

fn reseed( &mut self, entropy: &[u8], additional_input: Option<&[u8]>, ) -> Result<(), DrbgError>

Reseed the generator with new entropy and optional additional input.
Source§

fn set_reseed_interval(&mut self, interval: u64)

Adjust the reseed interval (number of generate calls permitted before mandatory reseed).
Source§

fn set_max_bytes_between_reseed(&mut self, bytes: u128)

Adjust the byte budget that forces a reseed.
Source§

impl Drop for HmacSha512Drbg

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Zeroize for HmacSha512Drbg

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.