HKDF-Expand deterministically turns an already uniform secret into output of a requested length. An optional info value separates uses of the same secret across protocols or purposes. section 8.6
Use HKDF-Expand in this sequence:
- Start with a uniformly random secret, usually produced by HKDF-Extract; skip extraction only when the input is already uniform. section 8.6
- Supply optional info to distinguish the derivation from other protocol uses. section 8.6
- Request the required output length; different lengths produce related outputs, with shorter results truncating the same expansion. section 8.6
Separate two derived keys
Given the same uniformly random secret, use different info values for separate purposes. The resulting outputs differ, while the requested length controls how much key material each purpose receives. section 8.6
Figure 8.7 HKDF-Expand is the second function specified by HKDF. It takes an optional info byte string and an input secret that needs to be uniformly random. Using different info byte strings with the same input secret produces different outputs. The length of the output is controlled by a length argument.
Visualizes the uniform secret, optional info value, and requested output length. section 8.6
