Skip to main content

Module kdf

Module kdf 

Source
Expand description

Key derivation under a profile: HKDF (RFC 5869; SP 800-56C Rev. 2 §5) and the hash-based one-step KDF (SP 800-56C Rev. 2 §4.1, option 1).

Structs§

DerivedKey
Derived keying material, zeroized on drop. Debug prints its length only.

Enums§

Spec
A key derivation: the KDF and every input but the secret.

Functions§

derive
Derives len bytes from secret as spec says. Refuses, in this order: Spec::Dhkem, which needs the keys only ecdh’s agree has, and a spec whose algorithm is not of its kind (CryptoError::KdfSpecMismatch); an algorithm a’s profile does not admit, or its module line lacks (Admitted::admit_kdf); an empty info or fixed_info unless kdf_info_may_be_empty; an output outside 1..=algorithm.max_output_len() bytes; an empty secret.