Key Derivation (KDF)
NIST SP 800-56C
RFC 5869 §A.1 Verified
HKDF-SHA-256
Extract-and-expand key derivation (RFC 5869) to 42 bytes from input keying material, salt and info.

Overview & Cryptographic Context
HKDF (HMAC-based Extract-and-Expand Key Derivation Function), defined in RFC 5869, is the foundational key schedule primitive in TLS 1.3, Noise, Signal, and HPKE (RFC 9180). It separates key derivation into two formal stages:
- HKDF-Extract: PRK = HMAC-Hash(salt, IKM) concentrates potentially non-uniform entropy (such as a raw Diffie-Hellman shared secret) into a fixed-length pseudorandom key (PRK).
- HKDF-Expand: Iteratively computes T(i) = HMAC-Hash(PRK, T(i-1) ‖ info ‖ byte(i)) to stretch PRK into L bytes of domain-separated Output Keying Material (OKM).
This workflow reproduces RFC 5869 Appendix A.1 (Test Case 1) with SHA-256 and output length L = 42 bytes, exercising two HMAC-SHA-256 expansion blocks (⌈ 42 / 32 ⌉ = 2) truncated to 42 bytes.
Pipeline Architecture & Wiring Flow
Workflow Input (IKM, Salt, Info)
──►
HKDF Key Derivation (SHA-256, 42 B)
──►
Workflow Output (OKM 42B)
- Keying Material & Context (
Workflow Input): Supplies the 22-byteIKM, 13-byte non-secretSalt, and 10-byte application contextInfo. - Extract & Expand (
HKDF Key Derivation): Configured withhashAlgorithm = "SHA-256"andkeyLength = 42. - Derived Key Output (
Workflow Output): Collects the 42-byteOKMbyte stream.
Nodes & Configuration
| Node | Node Role & Key Parameters | Count |
|---|---|---|
| Workflow Input | Supplies IKM, Salt, and Info | 1 |
| HKDF Key Derivation | Configured with hashAlgorithm = "SHA-256", keyLength = 42 | 1 |
| Workflow Output | Outputs 42-byte OKM | 1 |
Inputs, Outputs & Test Vector Verification
Verification Source: RFC 5869 §A.1 (Test Case 1, SHA-256, L=42)
Inputs
| Name | Type | Value (Hex) |
|---|---|---|
IKM | bytes (22 B) | 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b |
Salt | bytes (13 B) | 000102030405060708090a0b0c |
Info | bytes (10 B) | f0f1f2f3f4f5f6f7f8f9 |
Expected Outputs
| Name | Type | Value (Hex) |
|---|---|---|
OKM | bytes (42 B) | 3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865 |