Skip to main content
This is unreleased documentation for the main (development) branch of crypto-glue.

Kbkdf

Trait Kbkdf 

Source
pub trait Kbkdf<Prf, K, R: R>
where Prf: Mac + KeyInit, K: KeySizeUser, K::KeySize: ArraySize + Mul<U8>, <K::KeySize as Mul<U8>>::Output: Unsigned, Prf::OutputSize: ArraySize + Mul<U8>, <Prf::OutputSize as Mul<U8>>::Output: Unsigned,
{ const FEEDBACK_KI: bool = false; const DOUBLE_PIPELINE: bool = false; // Provided methods fn derive( &self, params: Params<'_, '_, '_>, ) -> Result<Array<u8, K::KeySize>, Error> { ... } fn input_iv(&self, _ki: &mut Option<Array<u8, Prf::OutputSize>>) { ... } }
Expand description

Kbkdf is a trait representing a mode of KBKDF. It takes multiple arguments:

  • Prf - the Pseudorandom Function to derive keys from
  • K - the expected output length of the newly derived key
  • R - An integer (1 <= r <= 32) that indicates the length of the binary encoding of the counter i as an integer in the interval [1, 2r − 1].

Provided Associated Constants§

Source

const FEEDBACK_KI: bool = false

Whether the KI should be reinjected every round.

Or, in other words, whether the KBKDF is in Feedback Mode.

Source

const DOUBLE_PIPELINE: bool = false

Whether the KBKDF is in Double-Pipeline Mode.

Provided Methods§

Source

fn derive( &self, params: Params<'_, '_, '_>, ) -> Result<Array<u8, K::KeySize>, Error>

Derives key from kin and other parameters.

Source

fn input_iv(&self, _ki: &mut Option<Array<u8, Prf::OutputSize>>)

Input the IV in the PRF.

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<Prf, K, R> Kbkdf<Prf, K, R> for Counter<Prf, K, R>
where Prf: Mac + KeyInit, K: KeySizeUser, K::KeySize: ArraySize + Mul<U8>, <K::KeySize as Mul<U8>>::Output: Unsigned, Prf::OutputSize: ArraySize + Mul<U8>, <Prf::OutputSize as Mul<U8>>::Output: Unsigned, R: R,

Source§

impl<Prf, K, R> Kbkdf<Prf, K, R> for DoublePipeline<Prf, K, R>
where Prf: Mac + KeyInit, K: KeySizeUser, K::KeySize: ArraySize + Mul<U8>, <K::KeySize as Mul<U8>>::Output: Unsigned, Prf::OutputSize: ArraySize + Mul<U8>, <Prf::OutputSize as Mul<U8>>::Output: Unsigned, R: R,

Source§

impl<Prf, K, R> Kbkdf<Prf, K, R> for Feedback<'_, Prf, K, R>
where Prf: Mac + KeyInit, K: KeySizeUser, K::KeySize: ArraySize + Mul<U8>, <K::KeySize as Mul<U8>>::Output: Unsigned, Prf::OutputSize: ArraySize + Mul<U8>, <Prf::OutputSize as Mul<U8>>::Output: Unsigned, R: R,