omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / om / tls / test / sha2 / vectors / rfc5869.txt
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | Internet Engineering Task Force (IETF) H. Krawczyk |
| 8 | Request for Comments: 5869 IBM Research |
| 9 | Category: Informational P. Eronen |
| 10 | ISSN: 2070-1721 Nokia |
| 11 | May 2010 |
| 12 | |
| 13 | |
| 14 | HMAC-based Extract-and-Expand Key Derivation Function (HKDF) |
| 15 | |
| 16 | Abstract |
| 17 | |
| 18 | This document specifies a simple Hashed Message Authentication Code |
| 19 | (HMAC)-based key derivation function (HKDF), which can be used as a |
| 20 | building block in various protocols and applications. The key |
| 21 | derivation function (KDF) is intended to support a wide range of |
| 22 | applications and requirements, and is conservative in its use of |
| 23 | cryptographic hash functions. |
| 24 | |
| 25 | Status of This Memo |
| 26 | |
| 27 | This document is not an Internet Standards Track specification; it is |
| 28 | published for informational purposes. |
| 29 | |
| 30 | This document is a product of the Internet Engineering Task Force |
| 31 | (IETF). It represents the consensus of the IETF community. It has |
| 32 | received public review and has been approved for publication by the |
| 33 | Internet Engineering Steering Group (IESG). Not all documents |
| 34 | approved by the IESG are a candidate for any level of Internet |
| 35 | Standard; see Section 2 of RFC 5741. |
| 36 | |
| 37 | Information about the current status of this document, any errata, |
| 38 | and how to provide feedback on it may be obtained at |
| 39 | http://www.rfc-editor.org/info/rfc5869. |
| 40 | |
| 41 | Copyright Notice |
| 42 | |
| 43 | Copyright (c) 2010 IETF Trust and the persons identified as the |
| 44 | document authors. All rights reserved. |
| 45 | |
| 46 | This document is subject to BCP 78 and the IETF Trust's Legal |
| 47 | Provisions Relating to IETF Documents |
| 48 | (http://trustee.ietf.org/license-info) in effect on the date of |
| 49 | publication of this document. Please review these documents |
| 50 | carefully, as they describe your rights and restrictions with respect |
| 51 | to this document. Code Components extracted from this document must |
| 52 | include Simplified BSD License text as described in Section 4.e of |
| 53 | the Trust Legal Provisions and are provided without warranty as |
| 54 | described in the Simplified BSD License. |
| 55 | |
| 56 | |
| 57 | |
| 58 | Krawczyk & Eronen Informational [Page 1] |
| 59 | |
| 60 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 61 | |
| 62 | |
| 63 | 1. Introduction |
| 64 | |
| 65 | A key derivation function (KDF) is a basic and essential component of |
| 66 | cryptographic systems. Its goal is to take some source of initial |
| 67 | keying material and derive from it one or more cryptographically |
| 68 | strong secret keys. |
| 69 | |
| 70 | This document specifies a simple HMAC-based [HMAC] KDF, named HKDF, |
| 71 | which can be used as a building block in various protocols and |
| 72 | applications, and is already used in several IETF protocols, |
| 73 | including [IKEv2], [PANA], and [EAP-AKA]. The purpose is to document |
| 74 | this KDF in a general way to facilitate adoption in future protocols |
| 75 | and applications, and to discourage the proliferation of multiple KDF |
| 76 | mechanisms. It is not intended as a call to change existing |
| 77 | protocols and does not change or update existing specifications using |
| 78 | this KDF. |
| 79 | |
| 80 | HKDF follows the "extract-then-expand" paradigm, where the KDF |
| 81 | logically consists of two modules. The first stage takes the input |
| 82 | keying material and "extracts" from it a fixed-length pseudorandom |
| 83 | key K. The second stage "expands" the key K into several additional |
| 84 | pseudorandom keys (the output of the KDF). |
| 85 | |
| 86 | In many applications, the input keying material is not necessarily |
| 87 | distributed uniformly, and the attacker may have some partial |
| 88 | knowledge about it (for example, a Diffie-Hellman value computed by a |
| 89 | key exchange protocol) or even partial control of it (as in some |
| 90 | entropy-gathering applications). Thus, the goal of the "extract" |
| 91 | stage is to "concentrate" the possibly dispersed entropy of the input |
| 92 | keying material into a short, but cryptographically strong, |
| 93 | pseudorandom key. In some applications, the input may already be a |
| 94 | good pseudorandom key; in these cases, the "extract" stage is not |
| 95 | necessary, and the "expand" part can be used alone. |
| 96 | |
| 97 | The second stage "expands" the pseudorandom key to the desired |
| 98 | length; the number and lengths of the output keys depend on the |
| 99 | specific cryptographic algorithms for which the keys are needed. |
| 100 | |
| 101 | Note that some existing KDF specifications, such as NIST Special |
| 102 | Publication 800-56A [800-56A], NIST Special Publication 800-108 |
| 103 | [800-108] and IEEE Standard 1363a-2004 [1363a], either only consider |
| 104 | the second stage (expanding a pseudorandom key), or do not explicitly |
| 105 | differentiate between the "extract" and "expand" stages, often |
| 106 | resulting in design shortcomings. The goal of this specification is |
| 107 | to accommodate a wide range of KDF requirements while minimizing the |
| 108 | assumptions about the underlying hash function. The "extract-then- |
| 109 | expand" paradigm supports well this goal (see [HKDF-paper] for more |
| 110 | information about the design rationale). |
| 111 | |
| 112 | |
| 113 | |
| 114 | Krawczyk & Eronen Informational [Page 2] |
| 115 | |
| 116 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 117 | |
| 118 | |
| 119 | 2. HMAC-based Key Derivation Function (HKDF) |
| 120 | |
| 121 | 2.1. Notation |
| 122 | |
| 123 | HMAC-Hash denotes the HMAC function [HMAC] instantiated with hash |
| 124 | function 'Hash'. HMAC always has two arguments: the first is a key |
| 125 | and the second an input (or message). (Note that in the extract |
| 126 | step, 'IKM' is used as the HMAC input, not as the HMAC key.) |
| 127 | |
| 128 | When the message is composed of several elements we use concatenation |
| 129 | (denoted |) in the second argument; for example, HMAC(K, elem1 | |
| 130 | elem2 | elem3). |
| 131 | |
| 132 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", |
| 133 | "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this |
| 134 | document are to be interpreted as described in [KEYWORDS]. |
| 135 | |
| 136 | 2.2. Step 1: Extract |
| 137 | |
| 138 | HKDF-Extract(salt, IKM) -> PRK |
| 139 | |
| 140 | Options: |
| 141 | Hash a hash function; HashLen denotes the length of the |
| 142 | hash function output in octets |
| 143 | |
| 144 | Inputs: |
| 145 | salt optional salt value (a non-secret random value); |
| 146 | if not provided, it is set to a string of HashLen zeros. |
| 147 | IKM input keying material |
| 148 | |
| 149 | Output: |
| 150 | PRK a pseudorandom key (of HashLen octets) |
| 151 | |
| 152 | The output PRK is calculated as follows: |
| 153 | |
| 154 | PRK = HMAC-Hash(salt, IKM) |
| 155 | |
| 156 | 2.3. Step 2: Expand |
| 157 | |
| 158 | HKDF-Expand(PRK, info, L) -> OKM |
| 159 | |
| 160 | Options: |
| 161 | Hash a hash function; HashLen denotes the length of the |
| 162 | hash function output in octets |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | Krawczyk & Eronen Informational [Page 3] |
| 171 | |
| 172 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 173 | |
| 174 | |
| 175 | Inputs: |
| 176 | PRK a pseudorandom key of at least HashLen octets |
| 177 | (usually, the output from the extract step) |
| 178 | info optional context and application specific information |
| 179 | (can be a zero-length string) |
| 180 | L length of output keying material in octets |
| 181 | (<= 255*HashLen) |
| 182 | |
| 183 | Output: |
| 184 | OKM output keying material (of L octets) |
| 185 | |
| 186 | The output OKM is calculated as follows: |
| 187 | |
| 188 | N = ceil(L/HashLen) |
| 189 | T = T(1) | T(2) | T(3) | ... | T(N) |
| 190 | OKM = first L octets of T |
| 191 | |
| 192 | where: |
| 193 | T(0) = empty string (zero length) |
| 194 | T(1) = HMAC-Hash(PRK, T(0) | info | 0x01) |
| 195 | T(2) = HMAC-Hash(PRK, T(1) | info | 0x02) |
| 196 | T(3) = HMAC-Hash(PRK, T(2) | info | 0x03) |
| 197 | ... |
| 198 | |
| 199 | (where the constant concatenated to the end of each T(n) is a |
| 200 | single octet.) |
| 201 | |
| 202 | 3. Notes to HKDF Users |
| 203 | |
| 204 | This section contains a set of guiding principles regarding the use |
| 205 | of HKDF. A much more extensive account of such principles and design |
| 206 | rationale can be found in [HKDF-paper]. |
| 207 | |
| 208 | 3.1. To Salt or not to Salt |
| 209 | |
| 210 | HKDF is defined to operate with and without random salt. This is |
| 211 | done to accommodate applications where a salt value is not available. |
| 212 | We stress, however, that the use of salt adds significantly to the |
| 213 | strength of HKDF, ensuring independence between different uses of the |
| 214 | hash function, supporting "source-independent" extraction, and |
| 215 | strengthening the analytical results that back the HKDF design. |
| 216 | |
| 217 | Random salt differs fundamentally from the initial keying material in |
| 218 | two ways: it is non-secret and can be re-used. As such, salt values |
| 219 | are available to many applications. For example, a pseudorandom |
| 220 | number generator (PRNG) that continuously produces outputs by |
| 221 | applying HKDF to renewable pools of entropy (e.g., sampled system |
| 222 | events) can fix a salt value and use it for multiple applications of |
| 223 | |
| 224 | |
| 225 | |
| 226 | Krawczyk & Eronen Informational [Page 4] |
| 227 | |
| 228 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 229 | |
| 230 | |
| 231 | HKDF without having to protect the secrecy of the salt. In a |
| 232 | different application domain, a key agreement protocol deriving |
| 233 | cryptographic keys from a Diffie-Hellman exchange can derive a salt |
| 234 | value from public nonces exchanged and authenticated between |
| 235 | communicating parties as part of the key agreement (this is the |
| 236 | approach taken in [IKEv2]). |
| 237 | |
| 238 | Ideally, the salt value is a random (or pseudorandom) string of the |
| 239 | length HashLen. Yet, even a salt value of less quality (shorter in |
| 240 | size or with limited entropy) may still make a significant |
| 241 | contribution to the security of the output keying material; designers |
| 242 | of applications are therefore encouraged to provide salt values to |
| 243 | HKDF if such values can be obtained by the application. |
| 244 | |
| 245 | It is worth noting that, while not the typical case, some |
| 246 | applications may even have a secret salt value available for use; in |
| 247 | such a case, HKDF provides an even stronger security guarantee. An |
| 248 | example of such application is IKEv1 in its "public-key encryption |
| 249 | mode", where the "salt" to the extractor is computed from nonces that |
| 250 | are secret; similarly, the pre-shared mode of IKEv1 uses a secret |
| 251 | salt derived from the pre-shared key. |
| 252 | |
| 253 | 3.2. The 'info' Input to HKDF |
| 254 | |
| 255 | While the 'info' value is optional in the definition of HKDF, it is |
| 256 | often of great importance in applications. Its main objective is to |
| 257 | bind the derived key material to application- and context-specific |
| 258 | information. For example, 'info' may contain a protocol number, |
| 259 | algorithm identifiers, user identities, etc. In particular, it may |
| 260 | prevent the derivation of the same keying material for different |
| 261 | contexts (when the same input key material (IKM) is used in such |
| 262 | different contexts). It may also accommodate additional inputs to |
| 263 | the key expansion part, if so desired (e.g., an application may want |
| 264 | to bind the key material to its length L, thus making L part of the |
| 265 | 'info' field). There is one technical requirement from 'info': it |
| 266 | should be independent of the input key material value IKM. |
| 267 | |
| 268 | 3.3. To Skip or not to Skip |
| 269 | |
| 270 | In some applications, the input key material IKM may already be |
| 271 | present as a cryptographically strong key (for example, the premaster |
| 272 | secret in TLS RSA cipher suites would be a pseudorandom string, |
| 273 | except for the first two octets). In this case, one can skip the |
| 274 | extract part and use IKM directly to key HMAC in the expand step. On |
| 275 | the other hand, applications may still use the extract part for the |
| 276 | sake of compatibility with the general case. In particular, if IKM |
| 277 | is random (or pseudorandom) but longer than an HMAC key, the extract |
| 278 | step can serve to output a suitable HMAC key (in the case of HMAC |
| 279 | |
| 280 | |
| 281 | |
| 282 | Krawczyk & Eronen Informational [Page 5] |
| 283 | |
| 284 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 285 | |
| 286 | |
| 287 | this shortening via the extractor is not strictly necessary since |
| 288 | HMAC is defined to work with long keys too). Note, however, that if |
| 289 | the IKM is a Diffie-Hellman value, as in the case of TLS with Diffie- |
| 290 | Hellman, then the extract part SHOULD NOT be skipped. Doing so would |
| 291 | result in using the Diffie-Hellman value g^{xy} itself (which is NOT |
| 292 | a uniformly random or pseudorandom string) as the key PRK for HMAC. |
| 293 | Instead, HKDF should apply the extract step to g^{xy} (preferably |
| 294 | with a salt value) and use the resultant PRK as a key to HMAC in the |
| 295 | expansion part. |
| 296 | |
| 297 | In the case where the amount of required key bits, L, is no more than |
| 298 | HashLen, one could use PRK directly as the OKM. This, however, is |
| 299 | NOT RECOMMENDED, especially because it would omit the use of 'info' |
| 300 | as part of the derivation process (and adding 'info' as an input to |
| 301 | the extract step is not advisable -- see [HKDF-paper]). |
| 302 | |
| 303 | 3.4. The Role of Independence |
| 304 | |
| 305 | The analysis of key derivation functions assumes that the input |
| 306 | keying material (IKM) comes from some source modeled as a probability |
| 307 | distribution over bit streams of a certain length (e.g., streams |
| 308 | produced by an entropy pool, values derived from Diffie-Hellman |
| 309 | exponents chosen at random, etc.); each instance of IKM is a sample |
| 310 | from that distribution. A major goal of key derivation functions is |
| 311 | to ensure that, when applying the KDF to any two values IKM and IKM' |
| 312 | sampled from the (same) source distribution, the resultant keys OKM |
| 313 | and OKM' are essentially independent of each other (in a statistical |
| 314 | or computational sense). To achieve this goal, it is important that |
| 315 | inputs to KDF are selected from appropriate input distributions and |
| 316 | also that inputs are chosen independently of each other (technically, |
| 317 | it is necessary that each sample will have sufficient entropy, even |
| 318 | when conditioned on other inputs to KDF). |
| 319 | |
| 320 | Independence is also an important aspect of the salt value provided |
| 321 | to a KDF. While there is no need to keep the salt secret, and the |
| 322 | same salt value can be used with multiple IKM values, it is assumed |
| 323 | that salt values are independent of the input keying material. In |
| 324 | particular, an application needs to make sure that salt values are |
| 325 | not chosen or manipulated by an attacker. As an example, consider |
| 326 | the case (as in IKE) where the salt is derived from nonces supplied |
| 327 | by the parties in a key exchange protocol. Before the protocol can |
| 328 | use such salt to derive keys, it needs to make sure that these nonces |
| 329 | are authenticated as coming from the legitimate parties rather than |
| 330 | selected by the attacker (in IKE, for example this authentication is |
| 331 | an integral part of the authenticated Diffie-Hellman exchange). |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | |
| 337 | |
| 338 | Krawczyk & Eronen Informational [Page 6] |
| 339 | |
| 340 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 341 | |
| 342 | |
| 343 | 4. Applications of HKDF |
| 344 | |
| 345 | HKDF is intended for use in a wide variety of KDF applications. |
| 346 | These include the building of pseudorandom generators from imperfect |
| 347 | sources of randomness (such as a physical random number generator |
| 348 | (RNG)); the generation of pseudorandomness out of weak sources of |
| 349 | randomness, such as entropy collected from system events, user's |
| 350 | keystrokes, etc.; the derivation of cryptographic keys from a shared |
| 351 | Diffie-Hellman value in a key-agreement protocol; derivation of |
| 352 | symmetric keys from a hybrid public-key encryption scheme; key |
| 353 | derivation for key-wrapping mechanisms; and more. All of these |
| 354 | applications can benefit from the simplicity and multi-purpose nature |
| 355 | of HKDF, as well as from its analytical foundation. |
| 356 | |
| 357 | On the other hand, it is anticipated that some applications will not |
| 358 | be able to use HKDF "as-is" due to specific operational requirements, |
| 359 | or will be able to use it but without the full benefits of the |
| 360 | scheme. One significant example is the derivation of cryptographic |
| 361 | keys from a source of low entropy, such as a user's password. The |
| 362 | extract step in HKDF can concentrate existing entropy but cannot |
| 363 | amplify entropy. In the case of password-based KDFs, a main goal is |
| 364 | to slow down dictionary attacks using two ingredients: a salt value, |
| 365 | and the intentional slowing of the key derivation computation. HKDF |
| 366 | naturally accommodates the use of salt; however, a slowing down |
| 367 | mechanism is not part of this specification. Applications interested |
| 368 | in a password-based KDF should consider whether, for example, [PKCS5] |
| 369 | meets their needs better than HKDF. |
| 370 | |
| 371 | 5. Security Considerations |
| 372 | |
| 373 | In spite of the simplicity of HKDF, there are many security |
| 374 | considerations that have been taken into account in the design and |
| 375 | analysis of this construction. An exposition of all of these aspects |
| 376 | is beyond the scope of this document. Please refer to [HKDF-paper] |
| 377 | for detailed information, including rationale for the design and for |
| 378 | the guidelines presented in Section 3. |
| 379 | |
| 380 | A major effort has been made in the above paper [HKDF-paper] to |
| 381 | provide a cryptographic analysis of HKDF as a multi-purpose KDF that |
| 382 | exercises much care in the way it utilizes cryptographic hash |
| 383 | functions. This is particularly important due to the limited |
| 384 | confidence we have in the strength of current hash functions. This |
| 385 | analysis, however, does not imply the absolute security of any |
| 386 | scheme, and it depends heavily on the strength of the underlying hash |
| 387 | function and on modeling choices. Yet, it serves as a strong |
| 388 | indication of the correct structure of the HKDF design and its |
| 389 | advantages over other common KDF schemes. |
| 390 | |
| 391 | |
| 392 | |
| 393 | |
| 394 | Krawczyk & Eronen Informational [Page 7] |
| 395 | |
| 396 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 397 | |
| 398 | |
| 399 | 6. Acknowledgments |
| 400 | |
| 401 | The authors would like to thank members of the CFRG (Crypto Forum |
| 402 | Research Group) list for their useful comments, and to Dan Harkins |
| 403 | for providing test vectors. |
| 404 | |
| 405 | 7. References |
| 406 | |
| 407 | 7.1. Normative References |
| 408 | |
| 409 | [HMAC] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- |
| 410 | Hashing for Message Authentication", RFC 2104, |
| 411 | February 1997. |
| 412 | |
| 413 | [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate |
| 414 | Requirement Levels", BCP 14, RFC 2119, March 1997. |
| 415 | |
| 416 | [SHS] National Institute of Standards and Technology, "Secure |
| 417 | Hash Standard", FIPS PUB 180-3, October 2008. |
| 418 | |
| 419 | 7.2. Informative References |
| 420 | |
| 421 | [1363a] Institute of Electrical and Electronics Engineers, "IEEE |
| 422 | Standard Specifications for Public-Key Cryptography - |
| 423 | Amendment 1: Additional Techniques", IEEE Std |
| 424 | 1363a-2004, 2004. |
| 425 | |
| 426 | [800-108] National Institute of Standards and Technology, |
| 427 | "Recommendation for Key Derivation Using Pseudorandom |
| 428 | Functions", NIST Special Publication 800-108, |
| 429 | November 2008. |
| 430 | |
| 431 | [800-56A] National Institute of Standards and Technology, |
| 432 | "Recommendation for Pair-Wise Key Establishment Schemes |
| 433 | Using Discrete Logarithm Cryptography (Revised)", NIST |
| 434 | Special Publication 800-56A, March 2007. |
| 435 | |
| 436 | [EAP-AKA] Arkko, J., Lehtovirta, V., and P. Eronen, "Improved |
| 437 | Extensible Authentication Protocol Method for 3rd |
| 438 | Generation Authentication and Key Agreement (EAP-AKA')", |
| 439 | RFC 5448, May 2009. |
| 440 | |
| 441 | [HKDF-paper] Krawczyk, H., "Cryptographic Extraction and Key |
| 442 | Derivation: The HKDF Scheme", Proceedings of CRYPTO 2010 |
| 443 | (to appear), 2010, <http://eprint.iacr.org/2010/264>. |
| 444 | |
| 445 | [IKEv2] Kaufman, C., Ed., "Internet Key Exchange (IKEv2) |
| 446 | Protocol", RFC 4306, December 2005. |
| 447 | |
| 448 | |
| 449 | |
| 450 | Krawczyk & Eronen Informational [Page 8] |
| 451 | |
| 452 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 453 | |
| 454 | |
| 455 | [PANA] Forsberg, D., Ohba, Y., Ed., Patil, B., Tschofenig, H., |
| 456 | and A. Yegin, "Protocol for Carrying Authentication for |
| 457 | Network Access (PANA)", RFC 5191, May 2008. |
| 458 | |
| 459 | [PKCS5] Kaliski, B., "PKCS #5: Password-Based Cryptography |
| 460 | Specification Version 2.0", RFC 2898, September 2000. |
| 461 | |
| 462 | |
| 463 | |
| 464 | |
| 465 | |
| 466 | |
| 467 | |
| 468 | |
| 469 | |
| 470 | |
| 471 | |
| 472 | |
| 473 | |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | |
| 479 | |
| 480 | |
| 481 | |
| 482 | |
| 483 | |
| 484 | |
| 485 | |
| 486 | |
| 487 | |
| 488 | |
| 489 | |
| 490 | |
| 491 | |
| 492 | |
| 493 | |
| 494 | |
| 495 | |
| 496 | |
| 497 | |
| 498 | |
| 499 | |
| 500 | |
| 501 | |
| 502 | |
| 503 | |
| 504 | |
| 505 | |
| 506 | Krawczyk & Eronen Informational [Page 9] |
| 507 | |
| 508 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 509 | |
| 510 | |
| 511 | Appendix A. Test Vectors |
| 512 | |
| 513 | This appendix provides test vectors for SHA-256 and SHA-1 hash |
| 514 | functions [SHS]. |
| 515 | |
| 516 | A.1. Test Case 1 |
| 517 | |
| 518 | Basic test case with SHA-256 |
| 519 | |
| 520 | Hash = SHA-256 |
| 521 | IKM = 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b (22 octets) |
| 522 | salt = 0x000102030405060708090a0b0c (13 octets) |
| 523 | info = 0xf0f1f2f3f4f5f6f7f8f9 (10 octets) |
| 524 | L = 42 |
| 525 | |
| 526 | PRK = 0x077709362c2e32df0ddc3f0dc47bba63 |
| 527 | 90b6c73bb50f9c3122ec844ad7c2b3e5 (32 octets) |
| 528 | OKM = 0x3cb25f25faacd57a90434f64d0362f2a |
| 529 | 2d2d0a90cf1a5a4c5db02d56ecc4c5bf |
| 530 | 34007208d5b887185865 (42 octets) |
| 531 | |
| 532 | |
| 533 | |
| 534 | |
| 535 | |
| 536 | |
| 537 | |
| 538 | |
| 539 | |
| 540 | |
| 541 | |
| 542 | |
| 543 | |
| 544 | |
| 545 | |
| 546 | |
| 547 | |
| 548 | |
| 549 | |
| 550 | |
| 551 | |
| 552 | |
| 553 | |
| 554 | |
| 555 | |
| 556 | |
| 557 | |
| 558 | |
| 559 | |
| 560 | |
| 561 | |
| 562 | Krawczyk & Eronen Informational [Page 10] |
| 563 | |
| 564 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 565 | |
| 566 | |
| 567 | A.2. Test Case 2 |
| 568 | |
| 569 | Test with SHA-256 and longer inputs/outputs |
| 570 | |
| 571 | Hash = SHA-256 |
| 572 | IKM = 0x000102030405060708090a0b0c0d0e0f |
| 573 | 101112131415161718191a1b1c1d1e1f |
| 574 | 202122232425262728292a2b2c2d2e2f |
| 575 | 303132333435363738393a3b3c3d3e3f |
| 576 | 404142434445464748494a4b4c4d4e4f (80 octets) |
| 577 | salt = 0x606162636465666768696a6b6c6d6e6f |
| 578 | 707172737475767778797a7b7c7d7e7f |
| 579 | 808182838485868788898a8b8c8d8e8f |
| 580 | 909192939495969798999a9b9c9d9e9f |
| 581 | a0a1a2a3a4a5a6a7a8a9aaabacadaeaf (80 octets) |
| 582 | info = 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebf |
| 583 | c0c1c2c3c4c5c6c7c8c9cacbcccdcecf |
| 584 | d0d1d2d3d4d5d6d7d8d9dadbdcdddedf |
| 585 | e0e1e2e3e4e5e6e7e8e9eaebecedeeef |
| 586 | f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff (80 octets) |
| 587 | L = 82 |
| 588 | |
| 589 | PRK = 0x06a6b88c5853361a06104c9ceb35b45c |
| 590 | ef760014904671014a193f40c15fc244 (32 octets) |
| 591 | OKM = 0xb11e398dc80327a1c8e7f78c596a4934 |
| 592 | 4f012eda2d4efad8a050cc4c19afa97c |
| 593 | 59045a99cac7827271cb41c65e590e09 |
| 594 | da3275600c2f09b8367793a9aca3db71 |
| 595 | cc30c58179ec3e87c14c01d5c1f3434f |
| 596 | 1d87 (82 octets) |
| 597 | |
| 598 | A.3. Test Case 3 |
| 599 | |
| 600 | Test with SHA-256 and zero-length salt/info |
| 601 | |
| 602 | Hash = SHA-256 |
| 603 | IKM = 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b (22 octets) |
| 604 | salt = (0 octets) |
| 605 | info = (0 octets) |
| 606 | L = 42 |
| 607 | |
| 608 | PRK = 0x19ef24a32c717b167f33a91d6f648bdf |
| 609 | 96596776afdb6377ac434c1c293ccb04 (32 octets) |
| 610 | OKM = 0x8da4e775a563c18f715f802a063c5a31 |
| 611 | b8a11f5c5ee1879ec3454e5f3c738d2d |
| 612 | 9d201395faa4b61a96c8 (42 octets) |
| 613 | |
| 614 | |
| 615 | |
| 616 | |
| 617 | |
| 618 | Krawczyk & Eronen Informational [Page 11] |
| 619 | |
| 620 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 621 | |
| 622 | |
| 623 | A.4. Test Case 4 |
| 624 | |
| 625 | Basic test case with SHA-1 |
| 626 | |
| 627 | Hash = SHA-1 |
| 628 | IKM = 0x0b0b0b0b0b0b0b0b0b0b0b (11 octets) |
| 629 | salt = 0x000102030405060708090a0b0c (13 octets) |
| 630 | info = 0xf0f1f2f3f4f5f6f7f8f9 (10 octets) |
| 631 | L = 42 |
| 632 | |
| 633 | PRK = 0x9b6c18c432a7bf8f0e71c8eb88f4b30baa2ba243 (20 octets) |
| 634 | OKM = 0x085a01ea1b10f36933068b56efa5ad81 |
| 635 | a4f14b822f5b091568a9cdd4f155fda2 |
| 636 | c22e422478d305f3f896 (42 octets) |
| 637 | |
| 638 | A.5. Test Case 5 |
| 639 | |
| 640 | Test with SHA-1 and longer inputs/outputs |
| 641 | |
| 642 | Hash = SHA-1 |
| 643 | IKM = 0x000102030405060708090a0b0c0d0e0f |
| 644 | 101112131415161718191a1b1c1d1e1f |
| 645 | 202122232425262728292a2b2c2d2e2f |
| 646 | 303132333435363738393a3b3c3d3e3f |
| 647 | 404142434445464748494a4b4c4d4e4f (80 octets) |
| 648 | salt = 0x606162636465666768696a6b6c6d6e6f |
| 649 | 707172737475767778797a7b7c7d7e7f |
| 650 | 808182838485868788898a8b8c8d8e8f |
| 651 | 909192939495969798999a9b9c9d9e9f |
| 652 | a0a1a2a3a4a5a6a7a8a9aaabacadaeaf (80 octets) |
| 653 | info = 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebf |
| 654 | c0c1c2c3c4c5c6c7c8c9cacbcccdcecf |
| 655 | d0d1d2d3d4d5d6d7d8d9dadbdcdddedf |
| 656 | e0e1e2e3e4e5e6e7e8e9eaebecedeeef |
| 657 | f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff (80 octets) |
| 658 | L = 82 |
| 659 | |
| 660 | PRK = 0x8adae09a2a307059478d309b26c4115a224cfaf6 (20 octets) |
| 661 | OKM = 0x0bd770a74d1160f7c9f12cd5912a06eb |
| 662 | ff6adcae899d92191fe4305673ba2ffe |
| 663 | 8fa3f1a4e5ad79f3f334b3b202b2173c |
| 664 | 486ea37ce3d397ed034c7f9dfeb15c5e |
| 665 | 927336d0441f4c4300e2cff0d0900b52 |
| 666 | d3b4 (82 octets) |
| 667 | |
| 668 | |
| 669 | |
| 670 | |
| 671 | |
| 672 | |
| 673 | |
| 674 | Krawczyk & Eronen Informational [Page 12] |
| 675 | |
| 676 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 677 | |
| 678 | |
| 679 | A.6. Test Case 6 |
| 680 | |
| 681 | Test with SHA-1 and zero-length salt/info |
| 682 | |
| 683 | Hash = SHA-1 |
| 684 | IKM = 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b (22 octets) |
| 685 | salt = (0 octets) |
| 686 | info = (0 octets) |
| 687 | L = 42 |
| 688 | |
| 689 | PRK = 0xda8c8a73c7fa77288ec6f5e7c297786aa0d32d01 (20 octets) |
| 690 | OKM = 0x0ac1af7002b3d761d1e55298da9d0506 |
| 691 | b9ae52057220a306e07b6b87e8df21d0 |
| 692 | ea00033de03984d34918 (42 octets) |
| 693 | |
| 694 | A.7. Test Case 7 |
| 695 | |
| 696 | Test with SHA-1, salt not provided (defaults to HashLen zero octets), |
| 697 | zero-length info |
| 698 | |
| 699 | Hash = SHA-1 |
| 700 | IKM = 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c (22 octets) |
| 701 | salt = not provided (defaults to HashLen zero octets) |
| 702 | info = (0 octets) |
| 703 | L = 42 |
| 704 | |
| 705 | PRK = 0x2adccada18779e7c2077ad2eb19d3f3e731385dd (20 octets) |
| 706 | OKM = 0x2c91117204d745f3500d636a62f64f0a |
| 707 | b3bae548aa53d423b0d1f27ebba6f5e5 |
| 708 | 673a081d70cce7acfc48 (42 octets) |
| 709 | |
| 710 | |
| 711 | |
| 712 | |
| 713 | |
| 714 | |
| 715 | |
| 716 | |
| 717 | |
| 718 | |
| 719 | |
| 720 | |
| 721 | |
| 722 | |
| 723 | |
| 724 | |
| 725 | |
| 726 | |
| 727 | |
| 728 | |
| 729 | |
| 730 | Krawczyk & Eronen Informational [Page 13] |
| 731 | |
| 732 | RFC 5869 Extract-and-Expand HKDF May 2010 |
| 733 | |
| 734 | |
| 735 | Authors' Addresses |
| 736 | |
| 737 | Hugo Krawczyk |
| 738 | IBM Research |
| 739 | 19 Skyline Drive |
| 740 | Hawthorne, NY 10532 |
| 741 | USA |
| 742 | |
| 743 | EMail: hugokraw@us.ibm.com |
| 744 | |
| 745 | |
| 746 | Pasi Eronen |
| 747 | Nokia Research Center |
| 748 | P.O. Box 407 |
| 749 | FI-00045 Nokia Group |
| 750 | Finland |
| 751 | |
| 752 | EMail: pasi.eronen@nokia.com |
| 753 | |
| 754 | |
| 755 | |
| 756 | |
| 757 | |
| 758 | |
| 759 | |
| 760 | |
| 761 | |
| 762 | |
| 763 | |
| 764 | |
| 765 | |
| 766 | |
| 767 | |
| 768 | |
| 769 | |
| 770 | |
| 771 | |
| 772 | |
| 773 | |
| 774 | |
| 775 | |
| 776 | |
| 777 | |
| 778 | |
| 779 | |
| 780 | |
| 781 | |
| 782 | |
| 783 | |
| 784 | |
| 785 | |
| 786 | Krawczyk & Eronen Informational [Page 14] |
| 787 |