Skip to main content

RNGFactory

Enum RNGFactory 

Source
pub enum RNGFactory {
    HashDRBG_SHA256(HashDRBG_SHA256),
    HashDRBG_SHA512(HashDRBG_SHA512),
}
Expand description

All members must impl RNG.

Variants§

§

HashDRBG_SHA256(HashDRBG_SHA256)

§

HashDRBG_SHA512(HashDRBG_SHA512)

Trait Implementations§

Source§

impl AlgorithmFactory for RNGFactory

Source§

fn default_128_bit() -> Self

Get the default configured algorithm at the 128-bit security level.
Source§

fn default_256_bit() -> Self

Get the default configured algorithm at the 256-bit security level.
Source§

fn new(alg_name: &str) -> Result<Self, FactoryError>

Create an instance of the algorithm by name.
Source§

impl Default for RNGFactory

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl RNG for RNGFactory

Source§

fn add_seed_keymaterial( &mut self, additional_seed: impl KeyMaterial, ) -> Result<(), RNGError>

Source§

fn next_int(&mut self) -> Result<u32, RNGError>

Source§

fn next_bytes(&mut self, len: usize) -> Result<Vec<u8>, RNGError>

Returns the number of requested bytes.
Source§

fn next_bytes_out(&mut self, out: &mut [u8]) -> Result<usize, RNGError>

Returns the number of bytes written.
Source§

fn fill_keymaterial_out( &mut self, out: &mut impl KeyMaterial, ) -> Result<usize, RNGError>

Source§

fn security_strength(&self) -> SecurityStrength

Returns the Security Strength of this RNG.

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, 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.