Skip to main content

KdfOperation

Trait KdfOperation 

Source
pub trait KdfOperation<'a, A: KdfAlgorithm, T = ZeroizingBytes>: Sized {
    // Required methods
    fn with_ikm(self, ikm: &'a [u8]) -> Self;
    fn with_salt(self, salt: &'a [u8]) -> Self;
    fn with_info(self, info: &'a [u8]) -> Self;
    fn with_output_length(self, length: usize) -> Self;
    fn derive(self) -> Result<T>;
    fn derive_array<const N: usize>(self) -> Result<Zeroizing<[u8; N]>>;
}
Expand description

Operation for KDF operations with improved type safety

Required Methods§

Source

fn with_ikm(self, ikm: &'a [u8]) -> Self

Set the input keying material

Source

fn with_salt(self, salt: &'a [u8]) -> Self

Set the salt

Source

fn with_info(self, info: &'a [u8]) -> Self

Set the info/context data

Source

fn with_output_length(self, length: usize) -> Self

Set the desired output length

Source

fn derive(self) -> Result<T>

Execute the key derivation

Source

fn derive_array<const N: usize>(self) -> Result<Zeroizing<[u8; N]>>

Execute the key derivation into a fixed-size array

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, H: HashFunction + Clone, const S: usize> KdfOperation<'a, HkdfAlgorithm<H>> for HkdfOperation<'a, H, S>
where Salt<S>: HkdfCompatible,

Source§

impl<'a, H: HashFunction + Clone, const S: usize> KdfOperation<'a, Pbkdf2Algorithm<H>> for dcrypt_algorithms::kdf::pbkdf2::Pbkdf2Builder<'a, H, S>

Source§

impl<'a, H: HashFunction + Clone> KdfOperation<'a, HkdfAlgorithm<H>> for HKdfOperation<'a, H>

Available on crate feature alloc only.
Source§

impl<'a, H: HashFunction + Clone> KdfOperation<'a, Pbkdf2Algorithm<H>> for dcrypt_algorithms::kdf::Pbkdf2Builder<'a, H>

Available on crate feature alloc only.
Source§

impl<'a, const S: usize> KdfOperation<'a, Argon2Algorithm> for Argon2Builder<'a, S>
where Salt<S>: Argon2Compatible + Clone + Zeroize + Send + Sync + 'static, Params<S>: Default + Clone + Zeroize + Send + Sync + 'static,