pub struct HkdfSha384 { /* private fields */ }Expand description
HKDF-SHA-384 (RFC 5869).
Built on HmacSha384, so it is served by whichever driver is
registered for it; see driver.
§Example
ⓘ
let hk = HkdfSha384::new(b"salt", b"input key material");
let mut okm = [0u8; 42];
hk.expand(b"context", &mut okm)?;
// Or keep the pseudorandom key to expand later:
let (prk, _) = HkdfSha384::extract(b"salt", b"input key material");
HkdfSha384::from_prk(&prk)?.expand(b"context", &mut okm)?;Implementations§
Source§impl HkdfSha384
impl HkdfSha384
Sourcepub const MAX_OUTPUT_SIZE: usize
pub const MAX_OUTPUT_SIZE: usize
Largest output expand can produce, in bytes.
Sourcepub fn new(salt: &[u8], ikm: &[u8]) -> Self
pub fn new(salt: &[u8], ikm: &[u8]) -> Self
Extract a pseudorandom key from ikm with salt.
An empty salt is equivalent to the RFC’s default of PRK_SIZE zeros.
Sourcepub fn extract(salt: &[u8], ikm: &[u8]) -> ([u8; 48], Self)
pub fn extract(salt: &[u8], ikm: &[u8]) -> ([u8; 48], Self)
Like new, also returning the pseudorandom key.
Trait Implementations§
Source§impl Clone for HkdfSha384
impl Clone for HkdfSha384
Source§fn clone(&self) -> HkdfSha384
fn clone(&self) -> HkdfSha384
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for HkdfSha384
impl !Unpin for HkdfSha384
impl !UnwindSafe for HkdfSha384
impl Freeze for HkdfSha384
impl Send for HkdfSha384
impl Sync for HkdfSha384
impl UnsafeUnpin for HkdfSha384
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