pub struct Hkdf<D>where
D: Update + BlockInput + FixedOutput + Reset + Default + Clone,
<D as BlockInput>::BlockSize: ArrayLength<u8>,
<D as FixedOutput>::OutputSize: ArrayLength<u8> + IsGreaterOrEqual<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, Output = B1>,{ /* private fields */ }
Expand description
Structure representing the HKDF, capable of HKDF-Extract and HKDF-Expand operations, as defined in RFC 5869.
Implementations§
§impl<D> Hkdf<D>where
D: Update + BlockInput + FixedOutput + Reset + Default + Clone,
<D as BlockInput>::BlockSize: ArrayLength<u8> + Clone,
<D as FixedOutput>::OutputSize: ArrayLength<u8> + IsGreaterOrEqual<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, Output = B1>,
impl<D> Hkdf<D>where D: Update + BlockInput + FixedOutput + Reset + Default + Clone, <D as BlockInput>::BlockSize: ArrayLength<u8> + Clone, <D as FixedOutput>::OutputSize: ArrayLength<u8> + IsGreaterOrEqual<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, Output = B1>,
pub fn extract(
salt: Option<&[u8]>,
ikm: &[u8]
) -> Result<Vec<u8, Global>, HkdfError>
pub fn extract( salt: Option<&[u8]>, ikm: &[u8] ) -> Result<Vec<u8, Global>, HkdfError>
The RFC5869 HKDF-Extract operation.
pub fn expand(
prk: &[u8],
info: Option<&[u8]>,
length: usize
) -> Result<Vec<u8, Global>, HkdfError>
pub fn expand( prk: &[u8], info: Option<&[u8]>, length: usize ) -> Result<Vec<u8, Global>, HkdfError>
The RFC5869 HKDF-Expand operation.
pub fn extract_then_expand(
salt: Option<&[u8]>,
ikm: &[u8],
info: Option<&[u8]>,
length: usize
) -> Result<Vec<u8, Global>, HkdfError>
pub fn extract_then_expand( salt: Option<&[u8]>, ikm: &[u8], info: Option<&[u8]>, length: usize ) -> Result<Vec<u8, Global>, HkdfError>
HKDF Extract then Expand operation as a single step.
pub fn extract_then_expand_no_ikm(
salt: Option<&[u8]>,
info: Option<&[u8]>,
length: usize
) -> Result<Vec<u8, Global>, HkdfError>
pub fn extract_then_expand_no_ikm( salt: Option<&[u8]>, info: Option<&[u8]>, length: usize ) -> Result<Vec<u8, Global>, HkdfError>
CAUTION: This is not recommended because it does not take an ikm (seed) as an input and
thus, it is not fully compliant with the HKDF RFC (which always expects a non-zero ikm).
Please use extract_then_expand
instead, unless you know what you are doing.
This api is currently required by the Noise protocol HKDF specs.
HKDF Extract then Expand operation as a single step, but without an ikm input.