pub struct Hkdf<MD: Algorithm>(/* private fields */);Expand description
HKDF for any of the implemented hash functions. The aliases HkdfSha256
and HkdfSha512 are provided for the most common cases.
Implementations§
Source§impl<MD: Algorithm> Hkdf<MD>
impl<MD: Algorithm> Hkdf<MD>
Sourcepub const MAX_OUTPUT_LEN: usize
pub const MAX_OUTPUT_LEN: usize
The maximum number of bytes of key material that can be produced.
Sourcepub fn derive<const N: usize>(
secret: &[u8],
salt: Salt<'_>,
info: &[u8],
) -> [u8; N]
pub fn derive<const N: usize>( secret: &[u8], salt: Salt<'_>, info: &[u8], ) -> [u8; N]
Derive key material from the given secret, salt, and info. Attempting
to derive more than 255 bytes is a compile-time error, see derive_into
for longer outputs.
The semantics of the arguments are complex. See https://datatracker.ietf.org/doc/html/rfc5869#section-3.
Sourcepub fn derive_into(
secret: &[u8],
salt: Salt<'_>,
info: &[u8],
out: &mut [u8],
) -> Result<(), TooLong>
pub fn derive_into( secret: &[u8], salt: Salt<'_>, info: &[u8], out: &mut [u8], ) -> Result<(), TooLong>
Derive key material from the given secret, salt, and info. Attempting
to derive more than MAX_OUTPUT_LEN bytes is a run-time error.
The semantics of the arguments are complex. See https://datatracker.ietf.org/doc/html/rfc5869#section-3.
Auto Trait Implementations§
impl<MD> Freeze for Hkdf<MD>
impl<MD> RefUnwindSafe for Hkdf<MD>where
MD: RefUnwindSafe,
impl<MD> Send for Hkdf<MD>where
MD: Send,
impl<MD> Sync for Hkdf<MD>where
MD: Sync,
impl<MD> Unpin for Hkdf<MD>where
MD: Unpin,
impl<MD> UnsafeUnpin for Hkdf<MD>
impl<MD> UnwindSafe for Hkdf<MD>where
MD: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more