Skip to main content

Module protected

Module protected 

Source
Available on crate feature protected only.
Expand description

§Protected memory type aliases for HKDF

This mod provides protected-memory PRK aliases and locked HKDF aliases. Use these aliases when the extracted PRK or expanded output should stay in locked memory.

use dryoc::hkdf::HkdfSha512Expander;
use dryoc::hkdf::protected::*;

let ikm = HeapBytes::from_slice_into_readonly_locked(b"Truth will come to light.")
    .expect("ikm failed");
let hkdf: LockedHkdfSha512 = HkdfSha512Expander::extract(None::<&[u8]>, &ikm);
let output: Locked<HeapBytes> = hkdf.expand_to_bytes(64, b"context").expect("expand failed");
assert_eq!(output.len(), 64);

Re-exports§

pub use crate::protected::*;

Type Aliases§

HkdfSha256Prk
Heap-allocated, page-aligned pseudorandom key for HKDF-SHA-256.
HkdfSha512Prk
Heap-allocated, page-aligned pseudorandom key for HKDF-SHA-512.
LockedHkdfSha256
Locked HKDF-SHA-256 expander.
LockedHkdfSha512
Locked HKDF-SHA-512 expander.