Skip to main content

XOFFactory

Enum XOFFactory 

Source
pub enum XOFFactory {
    SHAKE128(SHAKE128),
    SHAKE256(SHAKE256),
}

Variants§

§

SHAKE128(SHAKE128)

§

SHAKE256(SHAKE256)

Trait Implementations§

Source§

impl AlgorithmFactory for XOFFactory

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 XOFFactory

Source§

fn default() -> Self

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

impl XOF for XOFFactory

Source§

fn hash_xof(self, data: &[u8], result_len: usize) -> Vec<u8>

A static one-shot API that digests the input data and produces result_len bytes of output.
Source§

fn hash_xof_out(self, data: &[u8], output: &mut [u8]) -> usize

A static one-shot API that digests the input data and produces result_len bytes of output. Fills the provided output slice.
Source§

fn absorb(&mut self, data: &[u8]) -> Result<(), HashError>

Source§

fn absorb_last_partial_byte( &mut self, partial_byte: u8, num_partial_bits: usize, ) -> Result<(), HashError>

Switches to squeezing.
Source§

fn squeeze(&mut self, num_bytes: usize) -> Result<Vec<u8>, HashError>

Can be called multiple times.
Source§

fn squeeze_out(&mut self, output: &mut [u8]) -> Result<usize, HashError>

Can be called multiple times. Fills the provided output slice.
Source§

fn squeeze_partial_byte_final(self, num_bits: usize) -> Result<u8, HashError>

Squeezes a partial byte from the XOF. Output will be in the top num_bits bits of the returned u8 (ie Big Endian). This is a final call and consumes self.
Source§

fn squeeze_partial_byte_final_out( self, num_bits: usize, output: &mut u8, ) -> Result<(), HashError>

Source§

fn max_security_strength(&self) -> SecurityStrength

Returns the maximum security strength that this KDF is capable of supporting, based on the underlying primitives.

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.