Trait KdfOperation

Source
pub trait KdfOperation<'a, A: KdfAlgorithm, T = Vec<u8>>: 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<[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<[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", so this trait is not object safe.

Implementors§

Source§

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

Source§

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

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