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>
impl<H: OutputSizeUser, I: HmacImpl<H>> Hkdf<H, I>
Sourcepub fn new(salt: Option<&[u8]>, ikm: &[u8]) -> Self
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.
Sourcepub fn from_prk(prk: &[u8]) -> Result<Self, InvalidPrkLength>
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.
Sourcepub fn extract(salt: Option<&[u8]>, ikm: &[u8]) -> (Output<H>, Self)
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.
Sourcepub fn expand_multi_info(
&self,
info_components: &[&[u8]],
okm: &mut [u8],
) -> Result<(), InvalidLength>
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
.