Implement HKDF: HMAC-based key derivation function (RFC 5869)
Add pure Rust HKDF implementation in the crypto crate, generic over
hash function via the existing HashFunction trait:
- hkdf_extract(salt, IKM) -> PRK
- hkdf_expand(PRK, info, L) -> OKM with length validation
- hkdf() combined convenience function
- HKDF-SHA-256, HKDF-SHA-384, HKDF-SHA-512 via generics
- Empty salt defaults to HashLen zeros per RFC 5869 §2.2
- Output length validated: L <= 255 * HashLen
- 14 tests including all RFC 5869 SHA-256 test vectors (cases 1-3)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
authored by
pierrelf.com
tangled.org
eaec46bf
10288a77