Skip to main content

KDFFactory

Enum KDFFactory 

Source
pub enum KDFFactory {
    HKDF_SHA256(HKDF_SHA256),
    HKDF_SHA512(HKDF_SHA512),
    SHA3_224(SHA3_224),
    SHA3_256(SHA3_256),
    SHA3_384(SHA3_384),
    SHA3_512(SHA3_512),
    SHAKE128(SHAKE128),
    SHAKE256(SHAKE256),
}

Variants§

§

HKDF_SHA256(HKDF_SHA256)

§

HKDF_SHA512(HKDF_SHA512)

§

SHA3_224(SHA3_224)

§

SHA3_256(SHA3_256)

§

SHA3_384(SHA3_384)

§

SHA3_512(SHA3_512)

§

SHAKE128(SHAKE128)

§

SHAKE256(SHAKE256)

Trait Implementations§

Source§

impl AlgorithmFactory for KDFFactory

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 KDFFactory

Source§

fn default() -> Self

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

impl KDF for KDFFactory

Source§

fn derive_key( self, key: &impl KeyMaterial, additional_input: &[u8], ) -> Result<Box<dyn KeyMaterial>, KDFError>

Implementations of this function are capable of deriving an output key from an input key, assuming that they have been properly initialized. Read more
Source§

fn derive_key_out( self, key: &impl KeyMaterial, additional_input: &[u8], output_key: &mut impl KeyMaterial, ) -> Result<usize, KDFError>

Same as KDF::derive_key, but fills the provided output KeyMaterialInternal. Read more
Source§

fn derive_key_from_multiple( self, keys: &[&impl KeyMaterial], additional_input: &[u8], ) -> Result<Box<dyn KeyMaterial>, KDFError>

Meant to be used for hybrid key establishment schemes or other spit-key scenarios where multiple keys need to be combined into a single key of the same length. Read more
Source§

fn derive_key_from_multiple_out( self, keys: &[&impl KeyMaterial], additional_input: &[u8], output_key: &mut impl KeyMaterial, ) -> Result<usize, KDFError>

Same as KDF::derive_key, but fills the provided output KeyMaterialInternal. Read more
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.