hkdf

Type Alias SimpleHkdf

Source
pub type SimpleHkdf<H> = Hkdf<H, SimpleHmac<H>>;
Expand description

Hkdf variant which uses SimpleHmac for underlying HMAC implementation.

Aliased Type§

struct SimpleHkdf<H> { /* private fields */ }

Implementations

Source§

impl<H: OutputSizeUser, I: HmacImpl<H>> Hkdf<H, I>

Source

pub fn new(salt: Option<&[u8]>, ikm: &[u8]) -> Self

Convenience method for extract when the generated pseudorandom key can be ignored and only HKDF-Expand operation is needed. This is the most common constructor.

Source

pub fn from_prk(prk: &[u8]) -> Result<Self, InvalidPrkLength>

Create Hkdf from an already cryptographically strong pseudorandom key as per section 3.3 from RFC5869.

Source

pub fn extract(salt: Option<&[u8]>, ikm: &[u8]) -> (Output<H>, Self)

The RFC5869 HKDF-Extract operation returning both the generated pseudorandom key and Hkdf struct for expanding.

Source

pub fn expand_multi_info( &self, info_components: &[&[u8]], okm: &mut [u8], ) -> Result<(), InvalidLength>

The RFC5869 HKDF-Expand operation. This is equivalent to calling expand with the info argument set equal to the concatenation of all the elements of info_components.

Source

pub fn expand(&self, info: &[u8], okm: &mut [u8]) -> Result<(), InvalidLength>

The RFC5869 HKDF-Expand operation

If you don’t have any info to pass, use an empty slice.

Trait Implementations

Source§

impl<H: Clone + OutputSizeUser, I: Clone + HmacImpl<H>> Clone for Hkdf<H, I>
where I::Core: Clone,

Source§

fn clone(&self) -> Hkdf<H, I>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<H, I> Debug for Hkdf<H, I>
where H: OutputSizeUser, I: HmacImpl<H>, I::Core: AlgorithmName,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more