Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/om/tls/test/gcmsiv/vectors/rfc8452.txt # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / om / tls / test / gcmsiv / vectors / rfc8452.txt` 2355 lines ยท 102765 bytes Raw Blame History 1 2 3 4 5 6 7 Internet Research Task Force (IRTF) S. Gueron 8 Request for Comments: 8452 University of Haifa and Amazon 9 Category: Informational A. Langley 10 ISSN: 2070-1721 Google LLC 11 Y. Lindell 12 Bar-Ilan University and Unbound Tech 13 April 2019 14 15 16 AES-GCM-SIV: Nonce Misuse-Resistant Authenticated Encryption 17 18 Abstract 19 20 This memo specifies two authenticated encryption algorithms that are 21 nonce misuse resistant -- that is, they do not fail catastrophically 22 if a nonce is repeated. 23 24 This document is the product of the Crypto Forum Research Group. 25 26 Status of This Memo 27 28 This document is not an Internet Standards Track specification; it is 29 published for informational purposes. 30 31 This document is a product of the Internet Research Task Force 32 (IRTF). The IRTF publishes the results of Internet-related research 33 and development activities. These results might not be suitable for 34 deployment. This RFC represents the consensus of the Crypto Forum 35 Research Group of the Internet Research Task Force (IRTF). Documents 36 approved for publication by the IRSG are not candidates for any level 37 of Internet Standard; see Section 2 of RFC 7841. 38 39 Information about the current status of this document, any errata, 40 and how to provide feedback on it may be obtained at 41 https://www.rfc-editor.org/info/rfc8452. 42 43 Copyright Notice 44 45 Copyright (c) 2019 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 47 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (https://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. 54 55 56 57 58 Gueron, et al. Informational [Page 1] 59 60 RFC 8452 AES-GCM-SIV April 2019 61 62 63 Table of Contents 64 65 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 66 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 3 67 3. POLYVAL . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 68 4. Encryption . . . . . . . . . . . . . . . . . . . . . . . . . 4 69 5. Decryption . . . . . . . . . . . . . . . . . . . . . . . . . 7 70 6. AEADs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 71 7. Field Operation Examples . . . . . . . . . . . . . . . . . . 10 72 8. Worked Example . . . . . . . . . . . . . . . . . . . . . . . 10 73 9. Security Considerations . . . . . . . . . . . . . . . . . . . 11 74 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 75 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 14 76 11.1. Normative References . . . . . . . . . . . . . . . . . . 14 77 11.2. Informative References . . . . . . . . . . . . . . . . . 15 78 Appendix A. The Relationship between POLYVAL and GHASH . . . . . 17 79 Appendix B. Additional Comparisons with AES-GCM . . . . . . . . 19 80 Appendix C. Test Vectors . . . . . . . . . . . . . . . . . . . . 20 81 C.1. AEAD_AES_128_GCM_SIV . . . . . . . . . . . . . . . . . . 20 82 C.2. AEAD_AES_256_GCM_SIV . . . . . . . . . . . . . . . . . . 30 83 C.3. Counter Wrap Tests . . . . . . . . . . . . . . . . . . . 41 84 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 42 85 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 42 86 87 1. Introduction 88 89 The concept of Authenticated Encryption with Additional Data (AEAD) 90 [RFC5116] couples confidentiality and integrity in a single 91 operation, avoiding the risks of the previously common practice of 92 using ad hoc constructions of block-cipher and hash primitives. The 93 most popular AEAD, AES-GCM [GCM], is seeing widespread use due to its 94 attractive performance. 95 96 However, some AEADs (including AES-GCM) suffer catastrophic failures 97 of confidentiality and/or integrity when two distinct messages are 98 encrypted with the same key and nonce. While the requirements for 99 AEADs specify that the pair of (key, nonce) shall only ever be used 100 once, and thus prohibit this, this is a worry in practice. 101 102 Nonce misuse-resistant AEADs do not suffer from this problem. For 103 this class of AEADs, encrypting two messages with the same nonce only 104 discloses whether the messages were equal or not. This is the 105 minimum amount of information that a deterministic algorithm can leak 106 in this situation. 107 108 This memo specifies two nonce misuse-resistant AEADs: 109 AEAD_AES_128_GCM_SIV and AEAD_AES_256_GCM_SIV. These AEADs are 110 designed to be able to take advantage of existing hardware support 111 112 113 114 Gueron, et al. Informational [Page 2] 115 116 RFC 8452 AES-GCM-SIV April 2019 117 118 119 for AES-GCM and can decrypt within 5% of the speed of AES-GCM (for 120 multikilobyte messages). Encryption is, perforce, slower than 121 AES-GCM, because two passes are required in order to achieve that 122 nonce misuse-resistance property. However, measurements suggest that 123 it can still run at two-thirds of the speed of AES-GCM. 124 125 We suggest that these AEADs be considered in any situation where 126 nonce uniqueness cannot be guaranteed. This includes situations 127 where there is no stateful counter or where such state cannot be 128 guaranteed, as when multiple encryptors use the same key. As 129 discussed in Section 9, it is RECOMMENDED to use this scheme with 130 randomly chosen nonces. 131 132 This document represents the consensus of the Crypto Forum Research 133 Group (CFRG). 134 135 2. Requirements Language 136 137 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 138 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 139 "OPTIONAL" in this document are to be interpreted as described in 140 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 141 capitals, as shown here. 142 143 3. POLYVAL 144 145 The GCM-SIV construction is similar to GCM: the block cipher is used 146 in counter mode to encrypt the plaintext, and a polynomial 147 authenticator is used to provide integrity. The authenticator in 148 GCM-SIV is called POLYVAL. 149 150 POLYVAL, like GHASH (the authenticator in AES-GCM; see [GCM], 151 Section 6.4), operates in a binary field of size 2^128. The field is 152 defined by the irreducible polynomial x^128 + x^127 + x^126 + x^121 + 153 1. The sum of any two elements in the field is the result of XORing 154 them. The product of any two elements is calculated using standard 155 (binary) polynomial multiplication followed by reduction modulo the 156 irreducible polynomial. 157 158 We define another binary operation on elements of the field: 159 dot(a, b), where dot(a, b) = a * b * x^-128. The value of the field 160 element x^-128 is equal to x^127 + x^124 + x^121 + x^114 + 1. The 161 result of this multiplication, dot(a, b), is another field element. 162 163 164 165 166 167 168 169 170 Gueron, et al. Informational [Page 3] 171 172 RFC 8452 AES-GCM-SIV April 2019 173 174 175 Polynomials in this field are converted to and from 128-bit strings 176 by taking the least significant bit of the first byte to be the 177 coefficient of x^0, the most significant bit of the first byte to be 178 the coefficient of x^7, and so on, until the most significant bit of 179 the last byte is the coefficient of x^127. 180 181 POLYVAL takes a field element, H, and a series of field elements 182 X_1, ..., X_s. Its result is S_s, where S is defined by the 183 iteration S_0 = 0; S_j = dot(S_{j-1} + X_j, H), for j = 1..s. 184 185 We note that POLYVAL(H, X_1, X_2, ...) is equal to 186 ByteReverse(GHASH(ByteReverse(H) * x, ByteReverse(X_1), 187 ByteReverse(X_2), ...)), where ByteReverse is a function that 188 reverses the order of 16 bytes. See Appendix A for a more detailed 189 explanation. 190 191 4. Encryption 192 193 AES-GCM-SIV encryption takes a 16- or 32-byte key-generating key, a 194 96-bit nonce, and plaintext and additional data byte strings of 195 variable length. It outputs an authenticated ciphertext that will be 196 16 bytes longer than the plaintext. Both encryption and decryption 197 are only defined on inputs that are a whole number of bytes. 198 199 If the key-generating key is 16 bytes long, then AES-128 is used 200 throughout. Otherwise, AES-256 is used throughout. 201 202 The first step of encryption is to generate per-nonce, message- 203 authentication and message-encryption keys. The message- 204 authentication key is 128 bit, and the message-encryption key is 205 either 128 (for AES-128) or 256 bit (for AES-256). 206 207 These keys are generated by encrypting a series of plaintext blocks 208 that contain a 32-bit, little-endian counter followed by the nonce, 209 and then discarding the second half of the resulting ciphertext. In 210 the AES-128 case, 128 + 128 = 256 bits of key material need to be 211 generated, and, since encrypting each block yields 64 bits after 212 discarding half, four blocks need to be encrypted. The counter 213 values for these blocks are 0, 1, 2, and 3. For AES-256, six blocks 214 are needed in total, with counter values 0 through 5 (inclusive). 215 216 217 218 219 220 221 222 223 224 225 226 Gueron, et al. Informational [Page 4] 227 228 RFC 8452 AES-GCM-SIV April 2019 229 230 231 In pseudocode form, where "++" indicates concatenation and "x[:8]" 232 indicates taking only the first eight bytes from x: 233 234 func derive_keys(key_generating_key, nonce) { 235 message_authentication_key = 236 AES(key = key_generating_key, 237 block = little_endian_uint32(0) ++ nonce)[:8] ++ 238 AES(key = key_generating_key, 239 block = little_endian_uint32(1) ++ nonce)[:8] 240 message_encryption_key = 241 AES(key = key_generating_key, 242 block = little_endian_uint32(2) ++ nonce)[:8] ++ 243 AES(key = key_generating_key, 244 block = little_endian_uint32(3) ++ nonce)[:8] 245 246 if bytelen(key_generating_key) == 32 { 247 message_encryption_key ++= 248 AES(key = key_generating_key, 249 block = little_endian_uint32(4) ++ nonce)[:8] ++ 250 AES(key = key_generating_key, 251 block = little_endian_uint32(5) ++ nonce)[:8] 252 } 253 254 return message_authentication_key, message_encryption_key 255 } 256 257 Define the "length block" as a 16-byte value that is the 258 concatenation of the 64-bit, little-endian encodings of 259 bytelen(additional_data) * 8 and bytelen(plaintext) * 8. Pad the 260 plaintext and additional data with zeros until they are each a 261 multiple of 16 bytes, the AES block size. Then X_1, X_2, ... (the 262 series of field elements that are inputs to POLYVAL) are the 263 concatenation of the padded additional data, the padded plaintext, 264 and the length block. 265 266 Calculate S_s = POLYVAL(message-authentication-key, X_1, X_2, ...). 267 XOR the first twelve bytes of S_s with the nonce and clear the most 268 significant bit of the last byte. Encrypt the result with AES using 269 the message-encryption key to produce the tag. 270 271 (It's worth highlighting a contrast with AES-GCM here: AES-GCM 272 authenticates the encoded additional data and ciphertext, while 273 AES-GCM-SIV authenticates the encoded additional data and plaintext.) 274 275 The encrypted plaintext is produced by using AES, with the message- 276 encryption key, in counter mode (see [SP800-38A], Section 6.5) on the 277 unpadded plaintext. The initial counter block is the tag with the 278 most significant bit of the last byte set to one. The counter 279 280 281 282 Gueron, et al. Informational [Page 5] 283 284 RFC 8452 AES-GCM-SIV April 2019 285 286 287 advances by incrementing the first 32 bits interpreted as an 288 unsigned, little-endian integer, wrapping at 2^32. The result of the 289 encryption is the encrypted plaintext (truncated to the length of the 290 plaintext), followed by the tag. 291 292 In pseudocode form, the encryption process can be expressed as: 293 294 func right_pad_to_multiple_of_16_bytes(input) { 295 while (bytelen(input) % 16 != 0) { 296 input = input ++ "\x00" 297 } 298 return input 299 } 300 301 func AES_CTR(key, initial_counter_block, in) { 302 block = initial_counter_block 303 304 output = "" 305 while bytelen(in) > 0 { 306 keystream_block = AES(key = key, block = block) 307 block[0:4] = little_endian_uint32( 308 read_little_endian_uint32(block[0:4]) + 1) 309 310 todo = min(bytelen(in), bytelen(keystream_block) 311 for j = 0; j < todo; j++ { 312 output = output ++ (keystream_block[j] ^ in[j]) 313 } 314 315 in = in[todo:] 316 } 317 318 return output 319 } 320 321 func encrypt(key_generating_key, 322 nonce, 323 plaintext, 324 additional_data) { 325 if bytelen(plaintext) > 2^36 { 326 fail() 327 } 328 if bytelen(additional_data) > 2^36 { 329 fail() 330 } 331 332 message_encryption_key, message_authentication_key = 333 derive_keys(key_generating_key, nonce) 334 335 336 337 338 Gueron, et al. Informational [Page 6] 339 340 RFC 8452 AES-GCM-SIV April 2019 341 342 343 length_block = 344 little_endian_uint64(bytelen(additional_data) * 8) ++ 345 little_endian_uint64(bytelen(plaintext) * 8) 346 padded_plaintext = right_pad_to_multiple_of_16_bytes(plaintext) 347 padded_ad = right_pad_to_multiple_of_16_bytes(additional_data) 348 S_s = POLYVAL(key = message_authentication_key, 349 input = padded_ad ++ padded_plaintext ++ 350 length_block) 351 for i = 0; i < 12; i++ { 352 S_s[i] ^= nonce[i] 353 } 354 S_s[15] &= 0x7f 355 tag = AES(key = message_encryption_key, block = S_s) 356 357 counter_block = tag 358 counter_block[15] |= 0x80 359 return AES_CTR(key = message_encryption_key, 360 initial_counter_block = counter_block, 361 in = plaintext) ++ 362 tag 363 } 364 365 5. Decryption 366 367 Decryption takes a 16- or 32-byte key-generating key, a 96-bit nonce, 368 and ciphertext and additional data byte strings of variable length. 369 It either fails or outputs a plaintext that is 16 bytes shorter than 370 the ciphertext. 371 372 To decrypt an AES-GCM-SIV ciphertext, first derive the message- 373 encryption and message-authentication keys in the same manner as when 374 encrypting. 375 376 If the ciphertext is less than 16 bytes or more than 2^36 + 16 bytes, 377 then fail. Otherwise, split the input into the encrypted plaintext 378 and a 16-byte tag. Decrypt the encrypted plaintext with the message- 379 encryption key in counter mode, where the initial counter block is 380 the tag with the most significant bit of the last byte set to one. 381 Advance the counter for each block in the same way as when 382 encrypting. At this point, the plaintext is unauthenticated and MUST 383 NOT be output until the following tag confirmation is complete: 384 385 Pad the additional data and plaintext with zeros until they are each 386 a multiple of 16 bytes, the AES block size. Calculate the length 387 block and X_1, X_2, ... as above and compute 388 S_s = POLYVAL(message-authentication-key, X_1, X_2, ...) 389 390 391 392 393 394 Gueron, et al. Informational [Page 7] 395 396 RFC 8452 AES-GCM-SIV April 2019 397 398 399 Compute the expected tag by XORing S_s and the nonce, clearing the 400 most significant bit of the last byte and encrypting with the 401 message-encryption key. Compare the provided and expected tag values 402 in constant time. Fail the decryption if they do not match (and do 403 not release the plaintext); otherwise, return the plaintext. 404 405 In pseudocode form, the decryption process can be expressed as: 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 Gueron, et al. Informational [Page 8] 451 452 RFC 8452 AES-GCM-SIV April 2019 453 454 455 func decrypt(key_generating_key, 456 nonce, 457 ciphertext, 458 additional_data) { 459 if bytelen(ciphertext) < 16 || bytelen(ciphertext) > 2^36 + 16 { 460 fail() 461 } 462 if bytelen(additional_data) > 2^36 { 463 fail() 464 } 465 466 message_encryption_key, message_authentication_key = 467 derive_keys(key_generating_key, nonce) 468 469 tag = ciphertext[bytelen(ciphertext)-16:] 470 471 counter_block = tag 472 counter_block[15] |= 0x80 473 plaintext = AES_CTR(key = message_encryption_key, 474 initial_counter_block = counter_block, 475 in = ciphertext[:bytelen(ciphertext)-16]) 476 477 length_block = 478 little_endian_uint64(bytelen(additional_data) * 8) ++ 479 little_endian_uint64(bytelen(plaintext) * 8) 480 padded_plaintext = right_pad_to_multiple_of_16_bytes(plaintext) 481 padded_ad = right_pad_to_multiple_of_16_bytes(additional_data) 482 S_s = POLYVAL(key = message_authentication_key, 483 input = padded_ad ++ padded_plaintext ++ 484 length_block) 485 for i = 0; i < 12; i++ { 486 S_s[i] ^= nonce[i] 487 } 488 S_s[15] &= 0x7f 489 expected_tag = AES(key = message_encryption_key, block = S_s) 490 491 xor_sum = 0 492 for i := 0; i < bytelen(expected_tag); i++ { 493 xor_sum |= expected_tag[i] ^ tag[i] 494 } 495 496 if xor_sum != 0 { 497 fail() 498 } 499 500 return plaintext 501 } 502 503 504 505 506 Gueron, et al. Informational [Page 9] 507 508 RFC 8452 AES-GCM-SIV April 2019 509 510 511 6. AEADs 512 513 We define two AEADs, in the format of RFC 5116, that use AES-GCM-SIV: 514 AEAD_AES_128_GCM_SIV and AEAD_AES_256_GCM_SIV. They differ only in 515 the size of the AES key used. 516 517 The key input to these AEADs becomes the key-generating key. Thus, 518 AEAD_AES_128_GCM_SIV takes a 16-byte key and AEAD_AES_256_GCM_SIV 519 takes a 32-byte key. 520 521 The parameters for AEAD_AES_128_GCM_SIV are then as follows: 522 K_LEN is 16, P_MAX is 2^36, A_MAX is 2^36, N_MIN and N_MAX are 12, 523 and C_MAX is 2^36 + 16. 524 525 The parameters for AEAD_AES_256_GCM_SIV differ only in the key size: 526 K_LEN is 32, P_MAX is 2^36, A_MAX is 2^36, N_MIN and N_MAX are 12, 527 and C_MAX is 2^36 + 16. 528 529 7. Field Operation Examples 530 531 Polynomials in this document will be written as 16-byte values. For 532 example, the sixteen bytes `01000000000000000000000000000492` would 533 represent the polynomial x^127 + x^124 + x^121 + x^114 + 1, which is 534 also the value of x^-128 in this field. 535 536 If a = `66e94bd4ef8a2c3b884cfa59ca342b2e` and 537 b = `ff000000000000000000000000000000`, 538 then a + b = `99e94bd4ef8a2c3b884cfa59ca342b2e`, 539 a * b = `37856175e9dc9df26ebc6d6171aa0ae9`, and 540 dot(a, b) = `ebe563401e7e91ea3ad6426b8140c394`. 541 542 8. Worked Example 543 544 Consider the encryption of the plaintext "Hello world" with the 545 additional data "example" under key `ee8e1ed9ff2540ae8f2ba9f50bc2f27c` 546 using AEAD_AES_128_GCM_SIV. The random nonce that we'll use for this 547 example is `752abad3e0afb5f434dc4310`. 548 549 In order to generate the message-authentication and message- 550 encryption keys, a counter is combined with the nonce to form four 551 blocks. These blocks are encrypted with the key given above: 552 553 Counter | Nonce Ciphertext 554 `00000000752abad3e0afb5f434dc4310` -> `310728d9911f1f38c40e952ca83d093e` 555 `01000000752abad3e0afb5f434dc4310` -> `37b24316c3fab9a046ae90952daa0450` 556 `02000000752abad3e0afb5f434dc4310` -> `a4c5ae624996327947920b2d2412474b` 557 `03000000752abad3e0afb5f434dc4310` -> `c100be4d7e2c6edd1efef004305ab1e7` 558 559 560 561 562 Gueron, et al. Informational [Page 10] 563 564 RFC 8452 AES-GCM-SIV April 2019 565 566 567 The latter halves of the ciphertext blocks are discarded and the 568 remaining bytes are concatenated to form the per-message keys. Thus, 569 the message-authentication key is `310728d9911f1f3837b24316c3fab9a0`, 570 and the message-encryption key is `a4c5ae6249963279c100be4d7e2c6edd`. 571 572 The length block contains the encoding of the bit lengths of the 573 additional data and plaintext, respectively. The string "example" is 574 seven characters, thus 56 bits (or 0x38 in hex). The string "Hello 575 world" is 11 characters, or 88 = 0x58 bits. Thus, the length block 576 is `38000000000000005800000000000000`. 577 578 The input to POLYVAL is the padded additional data, padded plaintext, 579 and then the length block. This is `6578616d706c650000000000000000004` 580 `8656c6c6f20776f726c64000000000038000000000000005800000000000000`, 581 based on the ASCII encoding of "example" (`6578616d706c65`) and "Hello 582 world" (`48656c6c6f20776f726c64`). 583 584 Calling POLYVAL with the message-authentication key and the input 585 above results in S_s = `ad7fcf0b5169851662672f3c5f95138f`. 586 587 Before encrypting, the nonce is XORed in and the most significant bit 588 of the last byte is cleared. This gives 589 `d85575d8b1c630e256bb6c2c5f95130f`, because that bit happened to be one 590 previously. Encrypting with the message-encryption key (using 591 AES-128) gives the tag, which is `4fbcdeb7e4793f4a1d7e4faa70100af1`. 592 593 In order to form the initial counter block, the most significant bit 594 of the last byte of the tag is set to one. That doesn't result in a 595 change in this example. Encrypting this with the message key (using 596 AES-128) gives the first block of the keystream: 597 `1551f2c1787e81deac9a99f139540ab5`. 598 599 The final ciphertext is the result of XORing the plaintext with the 600 keystream and appending the tag. That gives 601 `5d349ead175ef6b1def6fd4fbcdeb7e4793f4a1d7e4faa70100af1`. 602 603 9. Security Considerations 604 605 AES-GCM-SIV decryption involves first producing an unauthenticated 606 plaintext. This plaintext is vulnerable to manipulation by an 607 attacker; thus, if an implementation released some or all of the 608 plaintext before authenticating it, other parts of a system may 609 process malicious data as if it were authentic. AES-GCM might be 610 less likely to lead implementations to do this because there the 611 ciphertext is generally authenticated before, or concurrently with, 612 the plaintext calculation. Therefore, this text requires that 613 implementations MUST NOT release unauthenticated plaintext. Thus, 614 system designers should consider memory limitations when picking the 615 616 617 618 Gueron, et al. Informational [Page 11] 619 620 RFC 8452 AES-GCM-SIV April 2019 621 622 623 size of AES-GCM-SIV plaintexts: large plaintexts may not fit in the 624 available memory of some machines, tempting implementations to 625 release unverified plaintext. 626 627 A detailed cryptographic analysis of AES-GCM-SIV appears in 628 [AES-GCM-SIV], and the remainder of this section is a summary of that 629 paper. 630 631 The AEADs defined in this document calculate fresh AES keys for each 632 nonce. This allows a larger number of plaintexts to be encrypted 633 under a given key. Without this step, AES-GCM-SIV encryption would 634 be limited by the birthday bound like other standard modes (e.g., 635 AES-GCM, AES-CCM [RFC3610], and AES-SIV [RFC5297]). This means that 636 when 2^64 blocks have been encrypted overall, a distinguishing 637 adversary who is trying to break the confidentiality of the scheme 638 has an advantage of 1/2. Thus, in order to limit the adversary's 639 advantage to 2^-32, at most 2^48 blocks can be encrypted overall. In 640 contrast, by deriving fresh keys from each nonce, it is possible to 641 encrypt a far larger number of messages and blocks with AES-GCM-SIV. 642 643 We stress that nonce misuse-resistant schemes guarantee that if a 644 nonce repeats, then the only security loss is that identical 645 plaintexts will produce identical ciphertexts. Since this can also 646 be a concern (as the fact that the same plaintext has been encrypted 647 twice is revealed), we do not recommend using a fixed nonce as a 648 policy. In addition, as we show below, better-than-birthday bounds 649 are achieved by AES-GCM-SIV when the nonce repetition rate is low. 650 Finally, as shown in [BHT18], there is a great security benefit in 651 the multiuser/multikey setting when each particular nonce is reused 652 by a small number of users only. We stress that the nonce misuse- 653 resistance property is not intended to be coupled with intentional 654 nonce reuse; rather, such schemes provide the best possible security 655 in the event of nonce reuse. Due to all of the above, it is 656 RECOMMENDED that AES-GCM-SIV nonces be randomly generated. 657 658 Some example usage bounds for AES-GCM-SIV are given below. The 659 adversary's advantage is the "AdvEnc" from [key-derive] and is 660 colloquially the ability of an attacker to distinguish ciphertexts 661 from random bit strings. The bounds below limit this advantage to 662 2^-32. For up to 256 uses of the same nonce and key (i.e., where one 663 can assume that nonce misuse is no more than this bound), the 664 following message limits should be respected (this assumes a short 665 additional authenticated data (AAD), i.e., less than 64 bytes): 666 667 2^29 messages, where each plaintext is at most 1 GiB 668 669 2^35 messages, where each plaintext is at most 128 MiB 670 671 672 673 674 Gueron, et al. Informational [Page 12] 675 676 RFC 8452 AES-GCM-SIV April 2019 677 678 679 2^49 messages, where each plaintext is at most 1 MiB 680 681 2^61 messages, where each plaintext is at most 16 KiB 682 683 Suzuki et al. [multi-birthday] show that even if nonces are selected 684 uniformly at random, the probability that one or more values would be 685 repeated 256 or more times is negligible until the number of nonces 686 reaches 2^102. (Specifically, the probability is 1/((2^96)^(255)) * 687 Binomial(q, 256), where q is the number of nonces.) Since 2^102 is 688 vastly greater than the limit on the number of plaintexts per key 689 given above, we don't feel that this limit on the number of repeated 690 nonces will be a problem. This also means that selecting nonces at 691 random is a safe practice with AES-GCM-SIV. The bounds obtained for 692 random nonces are as follows (as above, for these bounds, the 693 adversary's advantage is at most 2^-32): 694 695 2^32 messages, where each plaintext is at most 8 GiB 696 697 2^48 messages, where each plaintext is at most 32 MiB 698 699 2^64 messages, where each plaintext is at most 128 KiB 700 701 For situations where, for some reason, an even higher number of nonce 702 repeats is possible (e.g., in devices with very poor randomness), the 703 message limits need to be reconsidered. Theorem 7 in [AES-GCM-SIV] 704 contains more details, but for up to 1,024 repeats of each nonce, the 705 limits would be (again assuming a short AAD, i.e., less than 64 706 bytes): 707 708 2^25 messages, where each plaintext is at most 1 GiB 709 710 2^31 messages, where each plaintext is at most 128 MiB 711 712 2^45 messages, where each plaintext is at most 1 MiB 713 714 2^57 messages, where each plaintext is at most 16 KiB 715 716 In addition to calculating fresh AES keys for each nonce, these AEADs 717 also calculate fresh POLYVAL keys. Previous versions of GCM-SIV did 718 not do this and instead used part of the AEAD's key as the POLYVAL 719 key. Bleichenbacher pointed out [Bleichenbacher16] that this allowed 720 an attacker who controlled the AEAD key to force the POLYVAL key to 721 be zero. If a user of this AEAD authenticated messages with a secret 722 additional-data value, then this would be insecure as the attacker 723 could calculate a valid authenticator without knowing the input. 724 This does not violate the standard properties of an AEAD as the 725 726 727 728 729 730 Gueron, et al. Informational [Page 13] 731 732 RFC 8452 AES-GCM-SIV April 2019 733 734 735 additional data is not assumed to be confidential. However, we want 736 these AEADs to be robust against plausible misuse and also to be 737 drop-in replacements for AES-GCM and so derive nonce-specific POLYVAL 738 keys to avoid this issue. 739 740 We also wish to note that the probability of successful forgery 741 increases with the number of attempts that an attacker is permitted. 742 The advantage defined in [key-derive] and used above is specified in 743 terms of the ability of an attacker to distinguish ciphertexts from 744 random bit strings. It thus covers both confidentiality and 745 integrity, and Theorem 6.2 in [key-derive] shows that the advantage 746 increases with the number of decryption attempts, although much more 747 slowly than with the number of encryptions; the dependence on the 748 number of decryption queries for forgery is actually only linear, not 749 quadratic. The latter is an artifact of the bound in the paper not 750 being tight. If an attacker is permitted extremely large numbers of 751 attempts, then the tiny probability that any given attempt succeeds 752 may sum to a non-trivial chance. 753 754 A security analysis of a similar scheme without nonce-based key 755 derivation appears in [GCM-SIV], and a full analysis of the bounds 756 when applying nonce-based key derivation appears in [key-derive]. A 757 larger table of bounds and other information appears at 758 [aes-gcm-siv-homepage]. 759 760 The multiuser/multikey security of AES-GCM-SIV was studied by 761 [BHT18], which showed that security is almost the same as in the 762 single-user setting, as long as nonces do not repeat many times 763 across many users. This is the case when nonces are chosen randomly. 764 765 10. IANA Considerations 766 767 IANA has added two entries to the "AEAD Algorithms" registry: 768 AEAD_AES_128_GCM_SIV (Numeric ID 30) and AEAD_AES_256_GCM_SIV 769 (Numeric ID 31), both referencing this document as their 770 specification. 771 772 11. References 773 774 11.1. Normative References 775 776 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 777 Requirement Levels", BCP 14, RFC 2119, 778 DOI 10.17487/RFC2119, March 1997, 779 . 780 781 782 783 784 785 786 Gueron, et al. Informational [Page 14] 787 788 RFC 8452 AES-GCM-SIV April 2019 789 790 791 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 792 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 793 May 2017, . 794 795 [SP800-38A] 796 Dworkin, M., "Recommendation for Block Cipher Modes of 797 Operation: Methods and Techniques", NIST SP 800-38A, 798 DOI 10.6028/NIST.SP.800-38A, December 2001, 799 . 801 802 11.2. Informative References 803 804 [AES-GCM-SIV] 805 Gueron, S., Langley, A., and Y. Lindell, "AES-GCM-SIV: 806 Specification and Analysis", July 2017, 807 . 808 809 [aes-gcm-siv-homepage] 810 Gueron, S., Langley, A., and Y. Lindell, "Webpage for the 811 AES-GCM-SIV Mode of Operation", 812 . 813 814 [BHT18] Bose, P., Hoang, V., and S. Tessaro, "Revisiting AES-GCM- 815 SIV: Multi-user Security, Faster Key Derivation, and 816 Better Bounds", Advances in Cryptology - EUROCRYPT 2018, 817 DOI 10.1007/978-3-319-78381-9_18, May 2018, 818 . 819 820 [Bleichenbacher16] 821 Bleichenbacher, D., "Subject: AES-GCM-SIV security of the 822 additional data", message to the cfrg mailing list, 24 823 June 2016, . 825 826 [GCM] Dworkin, M., "Recommendation for Block Cipher Modes of 827 Operation: Galois/Counter Mode (GCM) and GMAC", NIST 828 SP 800-38D, DOI 10.6028/NIST.SP.800-38D, November 2007, 829 . 831 832 [GCM-SIV] Gueron, S. and Y. Lindell, "GCM-SIV: Full Nonce Misuse- 833 Resistant Authenticated Encryption at Under One Cycle Per 834 Byte", Proceedings of the 22nd ACM SIGSAC Conference on 835 Computer and Communications Security, 836 DOI 10.1145/`2810103`.`2813613`, October 2015, 837 . 838 839 840 841 842 Gueron, et al. Informational [Page 15] 843 844 RFC 8452 AES-GCM-SIV April 2019 845 846 847 [key-derive] 848 Gueron, S. and Y. Lindell, "Better Bounds for Block Cipher 849 Modes of Operation via Nonce-Based Key Derivation", 850 Proceedings of the 2017 ACM SIGSAC Conference on Computer 851 and Communications Security, DOI 10.1145/`3133956`.`3133992`, 852 2017, . 853 854 [multi-birthday] 855 Suzuki, K., Tonien, D., Kurosawa, K., and K. Toyota, 856 "Birthday Paradox for Multi-collisions", Information 857 Security and Cryptology - ICISC 2006, Lecture Notes in 858 Computer Science, Volume 4296, DOI 10.1007/`11927587`_5, 859 2006, . 860 861 [RFC3610] Whiting, D., Housley, R., and N. Ferguson, "Counter with 862 CBC-MAC (CCM)", RFC 3610, DOI 10.17487/RFC3610, September 863 2003, . 864 865 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 866 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 867 . 868 869 [RFC5297] Harkins, D., "Synthetic Initialization Vector (SIV) 870 Authenticated Encryption Using the Advanced Encryption 871 Standard (AES)", RFC 5297, DOI 10.17487/RFC5297, October 872 2008, . 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 Gueron, et al. Informational [Page 16] 899 900 RFC 8452 AES-GCM-SIV April 2019 901 902 903 Appendix A. The Relationship between POLYVAL and GHASH 904 905 GHASH and POLYVAL both operate in GF(2^128), although with different 906 irreducible polynomials: POLYVAL works modulo x^128 + x^127 + x^126 + 907 x^121 + 1 and GHASH works modulo x^128 + x^7 + x^2 + x + 1. Note 908 that these irreducible polynomials are the "reverse" of each other. 909 910 GHASH also has a different mapping between 128-bit strings and field 911 elements. Whereas POLYVAL takes the least significant to most 912 significant bits of the first byte to be the coefficients of x^0 to 913 x^7, GHASH takes them to be the coefficients of x^7 to x^0. This 914 continues until, for the last byte, POLYVAL takes the least 915 significant to most significant bits to be the coefficients of x^120 916 to x^127, while GHASH takes them to be the coefficients of x^127 to 917 x^120. 918 919 The combination of these facts means that it's possible to "convert" 920 values between the two by reversing the order of the bytes in a 921 16-byte string. The differing interpretations of bit order takes 922 care of reversing the bits within each byte, and then reversing the 923 bytes does the rest. This may have a practical benefit for 924 implementations that wish to implement both GHASH and POLYVAL. 925 926 In order to be clear which field a given operation is performed in, 927 let mulX_GHASH be a function that takes a 16-byte string, converts it 928 to an element of GHASH's field using GHASH's convention, multiplies 929 it by x, and converts it back to a string. Likewise, let 930 mulX_POLYVAL be a function that converts a 16-byte string to an 931 element of POLYVAL's field using POLYVAL's convention, multiplies it 932 by x, and converts it back. 933 934 Given the 16-byte string `01000000000000000000000000000000`, mulX_GHASH 935 of that string is `00800000000000000000000000000000` and mulX_POLYVAL 936 of that string is `02000000000000000000000000000000`. As a more 937 general example, given `9c98c04df9387ded828175a92ba652d8`, mulX_GHASH 938 of that string is `4e4c6026fc9c3ef6c140bad495d3296c` and mulX_POLYVAL 939 of it is `3931819bf271fada0503eb52574ca5f2`. 940 941 Lastly, let ByteReverse be the function that takes a 16-byte string 942 and returns a copy where the order of the bytes has been reversed. 943 944 945 946 947 948 949 950 951 952 953 954 Gueron, et al. Informational [Page 17] 955 956 RFC 8452 AES-GCM-SIV April 2019 957 958 959 Now GHASH and POLYVAL can be defined in terms of one another: 960 961 POLYVAL(H, X_1, ..., X_n) = 962 ByteReverse(GHASH(mulX_GHASH(ByteReverse(H)), ByteReverse(X_1), ..., 963 ByteReverse(X_n))) 964 965 GHASH(H, X_1, ..., X_n) = 966 ByteReverse(POLYVAL(mulX_POLYVAL(ByteReverse(H)), ByteReverse(X_1), 967 ..., ByteReverse(X_n))) 968 969 As a worked example: 970 let H = `25629347589242761d31f826ba4b757b`, 971 X_1 = `4f4f95668c83dfb6401762bb2d01a262`, and 972 X_2 = `d1a24ddd2721d006bbe45f20d3c9f362`. 973 POLYVAL(H, X_1, X_2) = `f7a3b47b846119fae5b7866cf5e5b77e`. 974 975 If we wished to calculate this given only an implementation of GHASH, 976 then the key for GHASH would be 977 978 mulX_GHASH(ByteReverse(H)) = `dcbaa5dd137c188ebb21492c23c9b112`. 979 980 Then ByteReverse(GHASH(dcba..., ByteReverse(X_1), ByteReverse(X_2))) 981 = `f7a3b47b846119fae5b7866cf5e5b77e`, as required. 982 983 In the other direction, GHASH(H, X_1, X_2) = 984 `bd9b3997046731fb96251b91f9c99d7a`. If we wished to calculate this 985 given only an implementation of POLYVAL, then we would first 986 calculate the key for POLYVAL: 987 988 mulX_POLYVAL(ByteReverse(H)) = `f6ea96744df0633aec8424b18e26c54a`. 989 990 Then ByteReverse(POLYVAL(f6ea..., ByteReverse(X_1), ByteReverse(X_2))) 991 = `bd9b3997046731fb96251b91f9c99d7a`. 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 Gueron, et al. Informational [Page 18] 1011 1012 RFC 8452 AES-GCM-SIV April 2019 1013 1014 1015 Appendix B. Additional Comparisons with AES-GCM 1016 1017 Some functional properties that differ between AES-GCM and AES-GCM- 1018 SIV that are also worth noting: 1019 1020 AES-GCM allows plaintexts to be encrypted in a streaming fashion -- 1021 i.e., the beginning of the plaintext can be encrypted and transmitted 1022 before the entire message has been processed. AES-GCM-SIV requires 1023 two passes for encryption and so cannot do this. 1024 1025 AES-GCM allows a constant additional-data input to be precomputed in 1026 order to save per-message computation. AES-GCM-SIV varies the 1027 authenticator key based on the nonce and so does not permit this. 1028 1029 The performance for AES-GCM versus AES-GCM-SIV on small machines can 1030 be roughly characterized by the number of AES operations and the 1031 number of GF(2^128) multiplications needed to process a message. 1032 1033 Let a = (bytelen(additional-data) + 15) / 16 and 1034 p = (bytelen(plaintext) + 15) / 16. 1035 1036 Then AES-GCM requires p + 1 AES operations and p + a + 1 field 1037 multiplications. 1038 1039 Defined similarly, AES-GCM-SIV with AES-128 requires p + 5 AES 1040 operations and p + a + 1 field multiplications. With AES-256, that 1041 becomes p + 7 AES operations. 1042 1043 With large machines, the available parallelism becomes far more 1044 important, and such simple performance analysis is no longer 1045 representative. For such machines, we find that decryption of AES- 1046 GCM-SIV is only about 5% slower than AES-GCM, as long as the message 1047 is at least a couple of kilobytes. Encryption tends to run about 1048 two-thirds the speed because of the additional pass required. 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 Gueron, et al. Informational [Page 19] 1067 1068 RFC 8452 AES-GCM-SIV April 2019 1069 1070 1071 Appendix C. Test Vectors 1072 1073 C.1. AEAD_AES_128_GCM_SIV 1074 1075 Plaintext (0 bytes) = 1076 AAD (0 bytes) = 1077 Key = `01000000000000000000000000000000` 1078 Nonce = `030000000000000000000000` 1079 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1080 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1081 POLYVAL input = `00000000000000000000000000000000` 1082 POLYVAL result = `00000000000000000000000000000000` 1083 POLYVAL result XOR nonce = `03000000000000000000000000000000` 1084 ... and masked = `03000000000000000000000000000000` 1085 Tag = `dc20e2d83f25705bb49e439eca56de25` 1086 Initial counter = `dc20e2d83f25705bb49e439eca56dea5` 1087 Result (16 bytes) = `dc20e2d83f25705bb49e439eca56de25` 1088 1089 1090 Plaintext (8 bytes) = `0100000000000000` 1091 AAD (0 bytes) = 1092 Key = `01000000000000000000000000000000` 1093 Nonce = `030000000000000000000000` 1094 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1095 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1096 POLYVAL input = `01000000000000000000000000000000` 1097 `00000000000000004000000000000000` 1098 POLYVAL result = `eb93b7740962c5e49d2a90a7dc5cec74` 1099 POLYVAL result XOR nonce = `e893b7740962c5e49d2a90a7dc5cec74` 1100 ... and masked = `e893b7740962c5e49d2a90a7dc5cec74` 1101 Tag = `578782fff6013b815b287c22493a364c` 1102 Initial counter = `578782fff6013b815b287c22493a36cc` 1103 Result (24 bytes) = `b5d839330ac7b786578782fff6013b81` 1104 `5b287c22493a364c` 1105 1106 1107 Plaintext (12 bytes) = `010000000000000000000000` 1108 AAD (0 bytes) = 1109 Key = `01000000000000000000000000000000` 1110 Nonce = `030000000000000000000000` 1111 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1112 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1113 POLYVAL input = `01000000000000000000000000000000` 1114 `00000000000000006000000000000000` 1115 POLYVAL result = `48eb6c6c5a2dbe4a1dde508fee06361b` 1116 POLYVAL result XOR nonce = `4beb6c6c5a2dbe4a1dde508fee06361b` 1117 ... and masked = `4beb6c6c5a2dbe4a1dde508fee06361b` 1118 Tag = `a4978db357391a0bc4fdec8b0d106639` 1119 1120 1121 1122 Gueron, et al. Informational [Page 20] 1123 1124 RFC 8452 AES-GCM-SIV April 2019 1125 1126 1127 Initial counter = `a4978db357391a0bc4fdec8b0d1066b9` 1128 Result (28 bytes) = `7323ea61d05932260047d942a4978db3` 1129 `57391a0bc4fdec8b0d106639` 1130 1131 1132 Plaintext (16 bytes) = `01000000000000000000000000000000` 1133 AAD (0 bytes) = 1134 Key = `01000000000000000000000000000000` 1135 Nonce = `030000000000000000000000` 1136 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1137 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1138 POLYVAL input = `01000000000000000000000000000000` 1139 `00000000000000008000000000000000` 1140 POLYVAL result = `20806c26e3c1de019e111255708031d6` 1141 POLYVAL result XOR nonce = `23806c26e3c1de019e111255708031d6` 1142 ... and masked = `23806c26e3c1de019e11125570803156` 1143 Tag = `303aaf90f6fe21199c6068577437a0c4` 1144 Initial counter = `303aaf90f6fe21199c6068577437a0c4` 1145 Result (32 bytes) = `743f7c8077ab25f8624e2e948579cf77` 1146 `303aaf90f6fe21199c6068577437a0c4` 1147 1148 1149 Plaintext (32 bytes) = `01000000000000000000000000000000` 1150 `02000000000000000000000000000000` 1151 AAD (0 bytes) = 1152 Key = `01000000000000000000000000000000` 1153 Nonce = `030000000000000000000000` 1154 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1155 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1156 POLYVAL input = `01000000000000000000000000000000` 1157 `02000000000000000000000000000000` 1158 `00000000000000000001000000000000` 1159 POLYVAL result = `ce6edc9a50b36d9a98986bbf6a261c3b` 1160 POLYVAL result XOR nonce = `cd6edc9a50b36d9a98986bbf6a261c3b` 1161 ... and masked = `cd6edc9a50b36d9a98986bbf6a261c3b` 1162 Tag = `1a8e45dcd4578c667cd86847bf6155ff` 1163 Initial counter = `1a8e45dcd4578c667cd86847bf6155ff` 1164 Result (48 bytes) = `84e07e62ba83a6585417245d7ec413a9` 1165 `fe427d6315c09b57ce45f2e3936a9445` 1166 `1a8e45dcd4578c667cd86847bf6155ff` 1167 1168 1169 Plaintext (48 bytes) = `01000000000000000000000000000000` 1170 `02000000000000000000000000000000` 1171 `03000000000000000000000000000000` 1172 AAD (0 bytes) = 1173 Key = `01000000000000000000000000000000` 1174 Nonce = `030000000000000000000000` 1175 1176 1177 1178 Gueron, et al. Informational [Page 21] 1179 1180 RFC 8452 AES-GCM-SIV April 2019 1181 1182 1183 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1184 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1185 POLYVAL input = `01000000000000000000000000000000` 1186 `02000000000000000000000000000000` 1187 `03000000000000000000000000000000` 1188 `00000000000000008001000000000000` 1189 POLYVAL result = `81388746bc22d26b2abc3dcb15754222` 1190 POLYVAL result XOR nonce = `82388746bc22d26b2abc3dcb15754222` 1191 ... and masked = `82388746bc22d26b2abc3dcb15754222` 1192 Tag = `5e6e311dbf395d35b0fe39c2714388f8` 1193 Initial counter = `5e6e311dbf395d35b0fe39c2714388f8` 1194 Result (64 bytes) = `3fd24ce1f5a67b75bf2351f181a475c7` 1195 `b800a5b4d3dcf70106b1eea82fa1d64d` 1196 `f42bf7226122fa92e17a40eeaac1201b` 1197 `5e6e311dbf395d35b0fe39c2714388f8` 1198 1199 1200 Plaintext (64 bytes) = `01000000000000000000000000000000` 1201 `02000000000000000000000000000000` 1202 `03000000000000000000000000000000` 1203 `04000000000000000000000000000000` 1204 AAD (0 bytes) = 1205 Key = `01000000000000000000000000000000` 1206 Nonce = `030000000000000000000000` 1207 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1208 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1209 POLYVAL input = `01000000000000000000000000000000` 1210 `02000000000000000000000000000000` 1211 `03000000000000000000000000000000` 1212 `04000000000000000000000000000000` 1213 `00000000000000000002000000000000` 1214 POLYVAL result = `1e39b6d3344d348f6044f89935d1cf78` 1215 POLYVAL result XOR nonce = `1d39b6d3344d348f6044f89935d1cf78` 1216 ... and masked = `1d39b6d3344d348f6044f89935d1cf78` 1217 Tag = `8a263dd317aa88d56bdf3936dba75bb8` 1218 Initial counter = `8a263dd317aa88d56bdf3936dba75bb8` 1219 Result (80 bytes) = `2433668f1058190f6d43e360f4f35cd8` 1220 `e475127cfca7028ea8ab5c20f7ab2af0` 1221 `2516a2bdcbc08d521be37ff28c152bba` 1222 `36697f25b4cd169c6590d1dd39566d3f` 1223 `8a263dd317aa88d56bdf3936dba75bb8` 1224 1225 1226 Plaintext (8 bytes) = `0200000000000000` 1227 AAD (1 bytes) = 01 1228 Key = `01000000000000000000000000000000` 1229 Nonce = `030000000000000000000000` 1230 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1231 1232 1233 1234 Gueron, et al. Informational [Page 22] 1235 1236 RFC 8452 AES-GCM-SIV April 2019 1237 1238 1239 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1240 POLYVAL input = `01000000000000000000000000000000` 1241 `02000000000000000000000000000000` 1242 `08000000000000004000000000000000` 1243 POLYVAL result = `b26781e7e2c1376f96bec195f3709b2a` 1244 POLYVAL result XOR nonce = `b16781e7e2c1376f96bec195f3709b2a` 1245 ... and masked = `b16781e7e2c1376f96bec195f3709b2a` 1246 Tag = `3b0a1a2560969cdf790d99759abd1508` 1247 Initial counter = `3b0a1a2560969cdf790d99759abd1588` 1248 Result (24 bytes) = `1e6daba35669f4273b0a1a2560969cdf` 1249 `790d99759abd1508` 1250 1251 1252 Plaintext (12 bytes) = `020000000000000000000000` 1253 AAD (1 bytes) = 01 1254 Key = `01000000000000000000000000000000` 1255 Nonce = `030000000000000000000000` 1256 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1257 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1258 POLYVAL input = `01000000000000000000000000000000` 1259 `02000000000000000000000000000000` 1260 `08000000000000006000000000000000` 1261 POLYVAL result = `111f5affb18e4cc1164a01bdc12a4145` 1262 POLYVAL result XOR nonce = `121f5affb18e4cc1164a01bdc12a4145` 1263 ... and masked = `121f5affb18e4cc1164a01bdc12a4145` 1264 Tag = `08299c5102745aaa3a0c469fad9e075a` 1265 Initial counter = `08299c5102745aaa3a0c469fad9e07da` 1266 Result (28 bytes) = `296c7889fd99f41917f4462008299c51` 1267 `02745aaa3a0c469fad9e075a` 1268 1269 1270 Plaintext (16 bytes) = `02000000000000000000000000000000` 1271 AAD (1 bytes) = 01 1272 Key = `01000000000000000000000000000000` 1273 Nonce = `030000000000000000000000` 1274 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1275 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1276 POLYVAL input = `01000000000000000000000000000000` 1277 `02000000000000000000000000000000` 1278 `08000000000000008000000000000000` 1279 POLYVAL result = `79745ab508622c8a958543675fac4688` 1280 POLYVAL result XOR nonce = `7a745ab508622c8a958543675fac4688` 1281 ... and masked = `7a745ab508622c8a958543675fac4608` 1282 Tag = `8f8936ec039e4e4bb97ebd8c4457441f` 1283 Initial counter = `8f8936ec039e4e4bb97ebd8c4457449f` 1284 Result (32 bytes) = `e2b0c5da79a901c1745f700525cb335b` 1285 `8f8936ec039e4e4bb97ebd8c4457441f` 1286 1287 1288 1289 1290 Gueron, et al. Informational [Page 23] 1291 1292 RFC 8452 AES-GCM-SIV April 2019 1293 1294 1295 Plaintext (32 bytes) = `02000000000000000000000000000000` 1296 `03000000000000000000000000000000` 1297 AAD (1 bytes) = 01 1298 Key = `01000000000000000000000000000000` 1299 Nonce = `030000000000000000000000` 1300 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1301 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1302 POLYVAL input = `01000000000000000000000000000000` 1303 `02000000000000000000000000000000` 1304 `03000000000000000000000000000000` 1305 `08000000000000000001000000000000` 1306 POLYVAL result = `2ce7daaf7c89490822051255b12eca6b` 1307 POLYVAL result XOR nonce = `2fe7daaf7c89490822051255b12eca6b` 1308 ... and masked = `2fe7daaf7c89490822051255b12eca6b` 1309 Tag = `e6af6a7f87287da059a71684ed3498e1` 1310 Initial counter = `e6af6a7f87287da059a71684ed3498e1` 1311 Result (48 bytes) = `620048ef3c1e73e57e02bb8562c416a3` 1312 `19e73e4caac8e96a1ecb2933145a1d71` 1313 `e6af6a7f87287da059a71684ed3498e1` 1314 1315 1316 Plaintext (48 bytes) = `02000000000000000000000000000000` 1317 `03000000000000000000000000000000` 1318 `04000000000000000000000000000000` 1319 AAD (1 bytes) = 01 1320 Key = `01000000000000000000000000000000` 1321 Nonce = `030000000000000000000000` 1322 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1323 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1324 POLYVAL input = `01000000000000000000000000000000` 1325 `02000000000000000000000000000000` 1326 `03000000000000000000000000000000` 1327 `04000000000000000000000000000000` 1328 `08000000000000008001000000000000` 1329 POLYVAL result = `9ca987715d69c1786711dfcd22f830fc` 1330 POLYVAL result XOR nonce = `9fa987715d69c1786711dfcd22f830fc` 1331 ... and masked = `9fa987715d69c1786711dfcd22f8307c` 1332 Tag = `6a8cc3865f76897c2e4b245cf31c51f2` 1333 Initial counter = `6a8cc3865f76897c2e4b245cf31c51f2` 1334 Result (64 bytes) = `50c8303ea93925d64090d07bd109dfd9` 1335 `515a5a33431019c17d93465999a8b005` 1336 `3201d723120a8562b838cdff25bf9d1e` 1337 `6a8cc3865f76897c2e4b245cf31c51f2` 1338 1339 1340 Plaintext (64 bytes) = `02000000000000000000000000000000` 1341 `03000000000000000000000000000000` 1342 `04000000000000000000000000000000` 1343 1344 1345 1346 Gueron, et al. Informational [Page 24] 1347 1348 RFC 8452 AES-GCM-SIV April 2019 1349 1350 1351 `05000000000000000000000000000000` 1352 AAD (1 bytes) = 01 1353 Key = `01000000000000000000000000000000` 1354 Nonce = `030000000000000000000000` 1355 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1356 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1357 POLYVAL input = `01000000000000000000000000000000` 1358 `02000000000000000000000000000000` 1359 `03000000000000000000000000000000` 1360 `04000000000000000000000000000000` 1361 `05000000000000000000000000000000` 1362 `08000000000000000002000000000000` 1363 POLYVAL result = `ffcd05d5770f34ad9267f0a59994b15a` 1364 POLYVAL result XOR nonce = `fccd05d5770f34ad9267f0a59994b15a` 1365 ... and masked = `fccd05d5770f34ad9267f0a59994b15a` 1366 Tag = `cdc46ae475563de037001ef84ae21744` 1367 Initial counter = `cdc46ae475563de037001ef84ae217c4` 1368 Result (80 bytes) = `2f5c64059db55ee0fb847ed513003746` 1369 `aca4e61c711b5de2e7a77ffd02da42fe` 1370 `ec601910d3467bb8b36ebbaebce5fba3` 1371 `0d36c95f48a3e7980f0e7ac299332a80` 1372 `cdc46ae475563de037001ef84ae21744` 1373 1374 1375 Plaintext (4 bytes) = `02000000` 1376 AAD (12 bytes) = `010000000000000000000000` 1377 Key = `01000000000000000000000000000000` 1378 Nonce = `030000000000000000000000` 1379 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1380 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1381 POLYVAL input = `01000000000000000000000000000000` 1382 `02000000000000000000000000000000` 1383 `60000000000000002000000000000000` 1384 POLYVAL result = `f6ce9d3dcd68a2fd603c7ecc18fb9918` 1385 POLYVAL result XOR nonce = `f5ce9d3dcd68a2fd603c7ecc18fb9918` 1386 ... and masked = `f5ce9d3dcd68a2fd603c7ecc18fb9918` 1387 Tag = `07eb1f84fb28f8cb73de8e99e2f48a14` 1388 Initial counter = `07eb1f84fb28f8cb73de8e99e2f48a94` 1389 Result (20 bytes) = `a8fe3e8707eb1f84fb28f8cb73de8e99` 1390 `e2f48a14` 1391 1392 1393 Plaintext (20 bytes) = `03000000000000000000000000000000` 1394 `04000000` 1395 AAD (18 bytes) = `01000000000000000000000000000000` 1396 0200 1397 Key = `01000000000000000000000000000000` 1398 Nonce = `030000000000000000000000` 1399 1400 1401 1402 Gueron, et al. Informational [Page 25] 1403 1404 RFC 8452 AES-GCM-SIV April 2019 1405 1406 1407 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1408 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1409 POLYVAL input = `01000000000000000000000000000000` 1410 `02000000000000000000000000000000` 1411 `03000000000000000000000000000000` 1412 `04000000000000000000000000000000` 1413 `9000000000000000a000000000000000` 1414 POLYVAL result = `4781d492cb8f926c504caa36f61008fe` 1415 POLYVAL result XOR nonce = `4481d492cb8f926c504caa36f61008fe` 1416 ... and masked = `4481d492cb8f926c504caa36f610087e` 1417 Tag = `24afc9805e976f451e6d87f6fe106514` 1418 Initial counter = `24afc9805e976f451e6d87f6fe106594` 1419 Result (36 bytes) = `6bb0fecf5ded9b77f902c7d5da236a43` 1420 `91dd029724afc9805e976f451e6d87f6` 1421 `fe106514` 1422 1423 1424 Plaintext (18 bytes) = `03000000000000000000000000000000` 1425 0400 1426 AAD (20 bytes) = `01000000000000000000000000000000` 1427 `02000000` 1428 Key = `01000000000000000000000000000000` 1429 Nonce = `030000000000000000000000` 1430 Record authentication key = `d9b360279694941ac5dbc6987ada7377` 1431 Record encryption key = `4004a0dcd862f2a57360219d2d44ef6c` 1432 POLYVAL input = `01000000000000000000000000000000` 1433 `02000000000000000000000000000000` 1434 `03000000000000000000000000000000` 1435 `04000000000000000000000000000000` 1436 `a0000000000000009000000000000000` 1437 POLYVAL result = `75cbc23a1a10e348aeb8e384b5cc79fd` 1438 POLYVAL result XOR nonce = `76cbc23a1a10e348aeb8e384b5cc79fd` 1439 ... and masked = `76cbc23a1a10e348aeb8e384b5cc797d` 1440 Tag = `bff9b2ef00fb47920cc72a0c0f13b9fd` 1441 Initial counter = `bff9b2ef00fb47920cc72a0c0f13b9fd` 1442 Result (34 bytes) = `44d0aaf6fb2f1f34add5e8064e83e12a` 1443 `2adabff9b2ef00fb47920cc72a0c0f13` 1444 b9fd 1445 1446 Plaintext (0 bytes) = 1447 AAD (0 bytes) = 1448 Key = `e66021d5eb8e4f4066d4adb9c33560e4` 1449 Nonce = `f46e44bb3da0015c94f70887` 1450 Record authentication key = `036ee1fe2d7926af68898095e54e7b3c` 1451 Record encryption key = `5e46482396008223b5c1d25173d87539` 1452 POLYVAL input = `00000000000000000000000000000000` 1453 POLYVAL result = `00000000000000000000000000000000` 1454 POLYVAL result XOR nonce = `f46e44bb3da0015c94f7088700000000` 1455 1456 1457 1458 Gueron, et al. Informational [Page 26] 1459 1460 RFC 8452 AES-GCM-SIV April 2019 1461 1462 1463 ... and masked = `f46e44bb3da0015c94f7088700000000` 1464 Tag = `a4194b79071b01a87d65f706e3949578` 1465 Initial counter = `a4194b79071b01a87d65f706e39495f8` 1466 Result (16 bytes) = `a4194b79071b01a87d65f706e3949578` 1467 1468 1469 Plaintext (3 bytes) = 7a806c 1470 AAD (5 bytes) = `46bb91c3c5` 1471 Key = `36864200e0eaf5284d884a0e77d31646` 1472 Nonce = `bae8e37fc83441b16034566b` 1473 Record authentication key = `3e28de1120b2981a0155795ca2812af6` 1474 Record encryption key = `6d4b78b31a4c9c03d8db0f42f7507fae` 1475 POLYVAL input = `46bb91c3c50000000000000000000000` 1476 `7a806c00000000000000000000000000` 1477 `28000000000000001800000000000000` 1478 POLYVAL result = `43d9a745511dcfa21b96dd606f1d5720` 1479 POLYVAL result XOR nonce = `f931443a99298e137ba28b0b6f1d5720` 1480 ... and masked = `f931443a99298e137ba28b0b6f1d5720` 1481 Tag = `711bd85bc1e4d3e0a462e074eea428a8` 1482 Initial counter = `711bd85bc1e4d3e0a462e074eea428a8` 1483 Result (19 bytes) = `af60eb711bd85bc1e4d3e0a462e074ee` 1484 a428a8 1485 1486 1487 Plaintext (6 bytes) = `bdc66f146545` 1488 AAD (10 bytes) = `fc880c94a95198874296` 1489 Key = `aedb64a6c590bc84d1a5e269e4b47801` 1490 Nonce = `afc0577e34699b9e671fdd4f` 1491 Record authentication key = `43b8de9cea62330d15cccfc84a33e8c8` 1492 Record encryption key = `8e54631607e431e095b54852868e3a27` 1493 POLYVAL input = `fc880c94a95198874296000000000000` 1494 `bdc66f14654500000000000000000000` 1495 `50000000000000003000000000000000` 1496 POLYVAL result = `26498e0d2b1ef004e808c458e8f2f515` 1497 POLYVAL result XOR nonce = `8989d9731f776b9a8f171917e8f2f515` 1498 ... and masked = `8989d9731f776b9a8f171917e8f2f515` 1499 Tag = `d6a9c45545cfc11f03ad743dba20f966` 1500 Initial counter = `d6a9c45545cfc11f03ad743dba20f9e6` 1501 Result (22 bytes) = `bb93a3e34d3cd6a9c45545cfc11f03ad` 1502 `743dba20f966` 1503 1504 1505 Plaintext (9 bytes) = `1177441f195495860f` 1506 AAD (15 bytes) = `046787f3ea22c127aaf195d1894728` 1507 Key = `d5cc1fd161320b6920ce07787f86743b` 1508 Nonce = `275d1ab32f6d1f0434d8848c` 1509 Record authentication key = `8a51df64d93eaf667c2c09bd454ce5c5` 1510 Record encryption key = `43ab276c2b4a473918ca73f2dd85109c` 1511 1512 1513 1514 Gueron, et al. Informational [Page 27] 1515 1516 RFC 8452 AES-GCM-SIV April 2019 1517 1518 1519 POLYVAL input = `046787f3ea22c127aaf195d189472800` 1520 `1177441f195495860f00000000000000` 1521 `78000000000000004800000000000000` 1522 POLYVAL result = `63a3451c0b23345ad02bba59956517cf` 1523 POLYVAL result XOR nonce = `44fe5faf244e2b5ee4f33ed5956517cf` 1524 ... and masked = `44fe5faf244e2b5ee4f33ed59565174f` 1525 Tag = `1d02fd0cd174c84fc5dae2f60f52fd2b` 1526 Initial counter = `1d02fd0cd174c84fc5dae2f60f52fdab` 1527 Result (25 bytes) = `4f37281f7ad12949d01d02fd0cd174c8` 1528 `4fc5dae2f60f52fd2b` 1529 1530 1531 Plaintext (12 bytes) = `9f572c614b4745914474e7c7` 1532 AAD (20 bytes) = `c9882e5386fd9f92ec489c8fde2be2cf` 1533 `97e74e93` 1534 Key = `b3fed1473c528b8426a582995929a149` 1535 Nonce = `9e9ad8780c8d63d0ab4149c0` 1536 Record authentication key = `22f50707a95dd416df069d670cb775e8` 1537 Record encryption key = `f674a5584ee21fe97b4cebc468ab61e4` 1538 POLYVAL input = `c9882e5386fd9f92ec489c8fde2be2cf` 1539 `97e74e93000000000000000000000000` 1540 `9f572c614b4745914474e7c700000000` 1541 `a0000000000000006000000000000000` 1542 POLYVAL result = `0cca0423fba9d77fe7e2e6963b08cdd0` 1543 POLYVAL result XOR nonce = `9250dc5bf724b4af4ca3af563b08cdd0` 1544 ... and masked = `9250dc5bf724b4af4ca3af563b08cd50` 1545 Tag = `c1dc2f871fb7561da1286e655e24b7b0` 1546 Initial counter = `c1dc2f871fb7561da1286e655e24b7b0` 1547 Result (28 bytes) = `f54673c5ddf710c745641c8bc1dc2f87` 1548 `1fb7561da1286e655e24b7b0` 1549 1550 1551 Plaintext (15 bytes) = `0d8c8451178082355c9e940fea2f58` 1552 AAD (25 bytes) = `2950a70d5a1db2316fd568378da107b5` 1553 `2b0da55210cc1c1b0a` 1554 Key = `2d4ed87da44102952ef94b02b805249b` 1555 Nonce = `ac80e6f61455bfac8308a2d4` 1556 Record authentication key = `0b00a29a83e7e95b92e3a0783b29f140` 1557 Record encryption key = `a430c27f285aed913005975c42eed5f3` 1558 POLYVAL input = `2950a70d5a1db2316fd568378da107b5` 1559 `2b0da55210cc1c1b0a00000000000000` 1560 `0d8c8451178082355c9e940fea2f5800` 1561 `c8000000000000007800000000000000` 1562 POLYVAL result = `1086ef25247aa41009bbc40871d9b350` 1563 POLYVAL result XOR nonce = `bc0609d3302f1bbc8ab366dc71d9b350` 1564 ... and masked = `bc0609d3302f1bbc8ab366dc71d9b350` 1565 Tag = `83b3449b9f39552de99dc214a1190b0b` 1566 Initial counter = `83b3449b9f39552de99dc214a1190b8b` 1567 1568 1569 1570 Gueron, et al. Informational [Page 28] 1571 1572 RFC 8452 AES-GCM-SIV April 2019 1573 1574 1575 Result (31 bytes) = `c9ff545e07b88a015f05b274540aa183` 1576 `b3449b9f39552de99dc214a1190b0b` 1577 1578 1579 Plaintext (18 bytes) = `6b3db4da3d57aa94842b9803a96e07fb` 1580 6de7 1581 AAD (30 bytes) = `1860f762ebfbd08284e421702de0de18` 1582 `baa9c9596291b08466f37de21c7f` 1583 Key = `bde3b2f204d1e9f8b06bc47f9745b3d1` 1584 Nonce = `ae06556fb6aa7890bebc18fe` 1585 Record authentication key = `21c874a8bad3603d1c3e8784df5b3f9f` 1586 Record encryption key = `d1c16d72651c3df504eae27129d818e8` 1587 POLYVAL input = `1860f762ebfbd08284e421702de0de18` 1588 `baa9c9596291b08466f37de21c7f0000` 1589 `6b3db4da3d57aa94842b9803a96e07fb` 1590 `6de70000000000000000000000000000` 1591 `f0000000000000009000000000000000` 1592 POLYVAL result = `55462a5afa0da8d646481e049ef9c764` 1593 POLYVAL result XOR nonce = `fb407f354ca7d046f8f406fa9ef9c764` 1594 ... and masked = `fb407f354ca7d046f8f406fa9ef9c764` 1595 Tag = `3e377094f04709f64d7b985310a4db84` 1596 Initial counter = `3e377094f04709f64d7b985310a4db84` 1597 Result (34 bytes) = `6298b296e24e8cc35dce0bed484b7f30` 1598 `d5803e377094f04709f64d7b985310a4` 1599 db84 1600 1601 1602 Plaintext (21 bytes) = `e42a3c02c25b64869e146d7b233987bd` 1603 `dfc240871d` 1604 AAD (35 bytes) = `7576f7028ec6eb5ea7e298342a94d4b2` 1605 `02b370ef9768ec6561c4fe6b7e7296fa` 1606 859c21 1607 Key = `f901cfe8a69615a93fdf7a98cad48179` 1608 Nonce = `6245709fb18853f68d833640` 1609 Record authentication key = `3724f55f1d22ac0ab830da0b6a995d74` 1610 Record encryption key = `75ac87b70c05db287de779006105a344` 1611 POLYVAL input = `7576f7028ec6eb5ea7e298342a94d4b2` 1612 `02b370ef9768ec6561c4fe6b7e7296fa` 1613 `859c2100000000000000000000000000` 1614 `e42a3c02c25b64869e146d7b233987bd` 1615 `dfc240871d0000000000000000000000` 1616 `1801000000000000a800000000000000` 1617 POLYVAL result = `4cbba090f03f7d1188ea55749fa6c7bd` 1618 POLYVAL result XOR nonce = `2efed00f41b72ee7056963349fa6c7bd` 1619 ... and masked = `2efed00f41b72ee7056963349fa6c73d` 1620 Tag = `2d15506c84a9edd65e13e9d24a2a6e70` 1621 Initial counter = `2d15506c84a9edd65e13e9d24a2a6ef0` 1622 Result (37 bytes) = `391cc328d484a4f46406181bcd62efd9` 1623 1624 1625 1626 Gueron, et al. Informational [Page 29] 1627 1628 RFC 8452 AES-GCM-SIV April 2019 1629 1630 1631 `b3ee197d052d15506c84a9edd65e13e9` 1632 `d24a2a6e70` 1633 1634 C.2. AEAD_AES_256_GCM_SIV 1635 1636 Plaintext (0 bytes) = 1637 AAD (0 bytes) = 1638 Key = `01000000000000000000000000000000` 1639 `00000000000000000000000000000000` 1640 Nonce = `030000000000000000000000` 1641 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1642 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1643 `456e3c6c05ecc157cdbf0700fedad222` 1644 POLYVAL input = `00000000000000000000000000000000` 1645 POLYVAL result = `00000000000000000000000000000000` 1646 POLYVAL result XOR nonce = `03000000000000000000000000000000` 1647 ... and masked = `03000000000000000000000000000000` 1648 Tag = `07f5f4169bbf55a8400cd47ea6fd400f` 1649 Initial counter = `07f5f4169bbf55a8400cd47ea6fd408f` 1650 Result (16 bytes) = `07f5f4169bbf55a8400cd47ea6fd400f` 1651 1652 1653 Plaintext (8 bytes) = `0100000000000000` 1654 AAD (0 bytes) = 1655 Key = `01000000000000000000000000000000` 1656 `00000000000000000000000000000000` 1657 Nonce = `030000000000000000000000` 1658 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1659 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1660 `456e3c6c05ecc157cdbf0700fedad222` 1661 POLYVAL input = `01000000000000000000000000000000` 1662 `00000000000000004000000000000000` 1663 POLYVAL result = `05230f62f0eac8aa14fe4d646b59cd41` 1664 POLYVAL result XOR nonce = `06230f62f0eac8aa14fe4d646b59cd41` 1665 ... and masked = `06230f62f0eac8aa14fe4d646b59cd41` 1666 Tag = `843122130f7364b761e0b97427e3df28` 1667 Initial counter = `843122130f7364b761e0b97427e3dfa8` 1668 Result (24 bytes) = `c2ef328e5c71c83b843122130f7364b7` 1669 `61e0b97427e3df28` 1670 1671 1672 Plaintext (12 bytes) = `010000000000000000000000` 1673 AAD (0 bytes) = 1674 Key = `01000000000000000000000000000000` 1675 `00000000000000000000000000000000` 1676 Nonce = `030000000000000000000000` 1677 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1678 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1679 1680 1681 1682 Gueron, et al. Informational [Page 30] 1683 1684 RFC 8452 AES-GCM-SIV April 2019 1685 1686 1687 `456e3c6c05ecc157cdbf0700fedad222` 1688 POLYVAL input = `01000000000000000000000000000000` 1689 `00000000000000006000000000000000` 1690 POLYVAL result = `6d81a24732fd6d03ae5af544720a1c13` 1691 POLYVAL result XOR nonce = `6e81a24732fd6d03ae5af544720a1c13` 1692 ... and masked = `6e81a24732fd6d03ae5af544720a1c13` 1693 Tag = `8ca50da9ae6559e48fd10f6e5c9ca17e` 1694 Initial counter = `8ca50da9ae6559e48fd10f6e5c9ca1fe` 1695 Result (28 bytes) = `9aab2aeb3faa0a34aea8e2b18ca50da9` 1696 `ae6559e48fd10f6e5c9ca17e` 1697 1698 1699 Plaintext (16 bytes) = `01000000000000000000000000000000` 1700 AAD (0 bytes) = 1701 Key = `01000000000000000000000000000000` 1702 `00000000000000000000000000000000` 1703 Nonce = `030000000000000000000000` 1704 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1705 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1706 `456e3c6c05ecc157cdbf0700fedad222` 1707 POLYVAL input = `01000000000000000000000000000000` 1708 `00000000000000008000000000000000` 1709 POLYVAL result = `74eee2bf7c9a165f8b25dea73db32a6d` 1710 POLYVAL result XOR nonce = `77eee2bf7c9a165f8b25dea73db32a6d` 1711 ... and masked = `77eee2bf7c9a165f8b25dea73db32a6d` 1712 Tag = `c9eac6fa700942702e90862383c6c366` 1713 Initial counter = `c9eac6fa700942702e90862383c6c3e6` 1714 Result (32 bytes) = `85a01b63025ba19b7fd3ddfc033b3e76` 1715 `c9eac6fa700942702e90862383c6c366` 1716 1717 1718 Plaintext (32 bytes) = `01000000000000000000000000000000` 1719 `02000000000000000000000000000000` 1720 AAD (0 bytes) = 1721 Key = `01000000000000000000000000000000` 1722 `00000000000000000000000000000000` 1723 Nonce = `030000000000000000000000` 1724 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1725 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1726 `456e3c6c05ecc157cdbf0700fedad222` 1727 POLYVAL input = `01000000000000000000000000000000` 1728 `02000000000000000000000000000000` 1729 `00000000000000000001000000000000` 1730 POLYVAL result = `899b6381b3d46f0def7aa0517ba188f5` 1731 POLYVAL result XOR nonce = `8a9b6381b3d46f0def7aa0517ba188f5` 1732 ... and masked = `8a9b6381b3d46f0def7aa0517ba18875` 1733 Tag = `e819e63abcd020b006a976397632eb5d` 1734 Initial counter = `e819e63abcd020b006a976397632ebdd` 1735 1736 1737 1738 Gueron, et al. Informational [Page 31] 1739 1740 RFC 8452 AES-GCM-SIV April 2019 1741 1742 1743 Result (48 bytes) = `4a6a9db4c8c6549201b9edb53006cba8` 1744 `21ec9cf850948a7c86c68ac7539d027f` 1745 `e819e63abcd020b006a976397632eb5d` 1746 1747 1748 Plaintext (48 bytes) = `01000000000000000000000000000000` 1749 `02000000000000000000000000000000` 1750 `03000000000000000000000000000000` 1751 AAD (0 bytes) = 1752 Key = `01000000000000000000000000000000` 1753 `00000000000000000000000000000000` 1754 Nonce = `030000000000000000000000` 1755 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1756 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1757 `456e3c6c05ecc157cdbf0700fedad222` 1758 POLYVAL input = `01000000000000000000000000000000` 1759 `02000000000000000000000000000000` 1760 `03000000000000000000000000000000` 1761 `00000000000000008001000000000000` 1762 POLYVAL result = `c1f8593d8fc29b0c290cae1992f71f51` 1763 POLYVAL result XOR nonce = `c2f8593d8fc29b0c290cae1992f71f51` 1764 ... and masked = `c2f8593d8fc29b0c290cae1992f71f51` 1765 Tag = `790bc96880a99ba804bd12c0e6a22cc4` 1766 Initial counter = `790bc96880a99ba804bd12c0e6a22cc4` 1767 Result (64 bytes) = `c00d121893a9fa603f48ccc1ca3c57ce` 1768 `7499245ea0046db16c53c7c66fe717e3` 1769 `9cf6c748837b61f6ee3adcee17534ed5` 1770 `790bc96880a99ba804bd12c0e6a22cc4` 1771 1772 1773 Plaintext (64 bytes) = `01000000000000000000000000000000` 1774 `02000000000000000000000000000000` 1775 `03000000000000000000000000000000` 1776 `04000000000000000000000000000000` 1777 AAD (0 bytes) = 1778 Key = `01000000000000000000000000000000` 1779 `00000000000000000000000000000000` 1780 Nonce = `030000000000000000000000` 1781 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1782 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1783 `456e3c6c05ecc157cdbf0700fedad222` 1784 POLYVAL input = `01000000000000000000000000000000` 1785 `02000000000000000000000000000000` 1786 `03000000000000000000000000000000` 1787 `04000000000000000000000000000000` 1788 `00000000000000000002000000000000` 1789 POLYVAL result = `6ef38b06046c7c0e225efaef8e2ec4c4` 1790 POLYVAL result XOR nonce = `6df38b06046c7c0e225efaef8e2ec4c4` 1791 1792 1793 1794 Gueron, et al. Informational [Page 32] 1795 1796 RFC 8452 AES-GCM-SIV April 2019 1797 1798 1799 ... and masked = `6df38b06046c7c0e225efaef8e2ec444` 1800 Tag = `112864c269fc0d9d88c61fa47e39aa08` 1801 Initial counter = `112864c269fc0d9d88c61fa47e39aa88` 1802 Result (80 bytes) = `c2d5160a1f8683834910acdafc41fbb1` 1803 `632d4a353e8b905ec9a5499ac34f96c7` 1804 `e1049eb080883891a4db8caaa1f99dd0` 1805 `04d80487540735234e3744512c6f90ce` 1806 `112864c269fc0d9d88c61fa47e39aa08` 1807 1808 1809 Plaintext (8 bytes) = `0200000000000000` 1810 AAD (1 bytes) = 01 1811 Key = `01000000000000000000000000000000` 1812 `00000000000000000000000000000000` 1813 Nonce = `030000000000000000000000` 1814 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1815 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1816 `456e3c6c05ecc157cdbf0700fedad222` 1817 POLYVAL input = `01000000000000000000000000000000` 1818 `02000000000000000000000000000000` 1819 `08000000000000004000000000000000` 1820 POLYVAL result = `34e57bafe011b9b36fc6821b7ffb3354` 1821 POLYVAL result XOR nonce = `37e57bafe011b9b36fc6821b7ffb3354` 1822 ... and masked = `37e57bafe011b9b36fc6821b7ffb3354` 1823 Tag = `91213f267e3b452f02d01ae33e4ec854` 1824 Initial counter = `91213f267e3b452f02d01ae33e4ec8d4` 1825 Result (24 bytes) = `1de22967237a813291213f267e3b452f` 1826 `02d01ae33e4ec854` 1827 1828 1829 Plaintext (12 bytes) = `020000000000000000000000` 1830 AAD (1 bytes) = 01 1831 Key = `01000000000000000000000000000000` 1832 `00000000000000000000000000000000` 1833 Nonce = `030000000000000000000000` 1834 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1835 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1836 `456e3c6c05ecc157cdbf0700fedad222` 1837 POLYVAL input = `01000000000000000000000000000000` 1838 `02000000000000000000000000000000` 1839 `08000000000000006000000000000000` 1840 POLYVAL result = `5c47d68a22061c1ad5623a3b66a8e206` 1841 POLYVAL result XOR nonce = `5f47d68a22061c1ad5623a3b66a8e206` 1842 ... and masked = `5f47d68a22061c1ad5623a3b66a8e206` 1843 Tag = `c1a4a19ae800941ccdc57cc8413c277f` 1844 Initial counter = `c1a4a19ae800941ccdc57cc8413c27ff` 1845 Result (28 bytes) = `163d6f9cc1b346cd453a2e4cc1a4a19a` 1846 `e800941ccdc57cc8413c277f` 1847 1848 1849 1850 Gueron, et al. Informational [Page 33] 1851 1852 RFC 8452 AES-GCM-SIV April 2019 1853 1854 1855 Plaintext (16 bytes) = `02000000000000000000000000000000` 1856 AAD (1 bytes) = 01 1857 Key = `01000000000000000000000000000000` 1858 `00000000000000000000000000000000` 1859 Nonce = `030000000000000000000000` 1860 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1861 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1862 `456e3c6c05ecc157cdbf0700fedad222` 1863 POLYVAL input = `01000000000000000000000000000000` 1864 `02000000000000000000000000000000` 1865 `08000000000000008000000000000000` 1866 POLYVAL result = `452896726c616746f01d11d82911d478` 1867 POLYVAL result XOR nonce = `462896726c616746f01d11d82911d478` 1868 ... and masked = `462896726c616746f01d11d82911d478` 1869 Tag = `b292d28ff61189e8e49f3875ef91aff7` 1870 Initial counter = `b292d28ff61189e8e49f3875ef91aff7` 1871 Result (32 bytes) = `c91545823cc24f17dbb0e9e807d5ec17` 1872 `b292d28ff61189e8e49f3875ef91aff7` 1873 1874 1875 Plaintext (32 bytes) = `02000000000000000000000000000000` 1876 `03000000000000000000000000000000` 1877 AAD (1 bytes) = 01 1878 Key = `01000000000000000000000000000000` 1879 `00000000000000000000000000000000` 1880 Nonce = `030000000000000000000000` 1881 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1882 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1883 `456e3c6c05ecc157cdbf0700fedad222` 1884 POLYVAL input = `01000000000000000000000000000000` 1885 `02000000000000000000000000000000` 1886 `03000000000000000000000000000000` 1887 `08000000000000000001000000000000` 1888 POLYVAL result = `4e58c1e341c9bb0ae34eda9509dfc90c` 1889 POLYVAL result XOR nonce = `4d58c1e341c9bb0ae34eda9509dfc90c` 1890 ... and masked = `4d58c1e341c9bb0ae34eda9509dfc90c` 1891 Tag = `aea1bad12702e1965604374aab96dbbc` 1892 Initial counter = `aea1bad12702e1965604374aab96dbbc` 1893 Result (48 bytes) = `07dad364bfc2b9da89116d7bef6daaaf` 1894 `6f255510aa654f920ac81b94e8bad365` 1895 `aea1bad12702e1965604374aab96dbbc` 1896 1897 1898 Plaintext (48 bytes) = `02000000000000000000000000000000` 1899 `03000000000000000000000000000000` 1900 `04000000000000000000000000000000` 1901 AAD (1 bytes) = 01 1902 Key = `01000000000000000000000000000000` 1903 1904 1905 1906 Gueron, et al. Informational [Page 34] 1907 1908 RFC 8452 AES-GCM-SIV April 2019 1909 1910 1911 `00000000000000000000000000000000` 1912 Nonce = `030000000000000000000000` 1913 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1914 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1915 `456e3c6c05ecc157cdbf0700fedad222` 1916 POLYVAL input = `01000000000000000000000000000000` 1917 `02000000000000000000000000000000` 1918 `03000000000000000000000000000000` 1919 `04000000000000000000000000000000` 1920 `08000000000000008001000000000000` 1921 POLYVAL result = `2566a4aff9a525df9772c16d4eaf8d2a` 1922 POLYVAL result XOR nonce = `2666a4aff9a525df9772c16d4eaf8d2a` 1923 ... and masked = `2666a4aff9a525df9772c16d4eaf8d2a` 1924 Tag = `03332742b228c647173616cfd44c54eb` 1925 Initial counter = `03332742b228c647173616cfd44c54eb` 1926 Result (64 bytes) = `c67a1f0f567a5198aa1fcc8e3f213143` 1927 `36f7f51ca8b1af61feac35a86416fa47` 1928 `fbca3b5f749cdf564527f2314f42fe25` 1929 `03332742b228c647173616cfd44c54eb` 1930 1931 1932 Plaintext (64 bytes) = `02000000000000000000000000000000` 1933 `03000000000000000000000000000000` 1934 `04000000000000000000000000000000` 1935 `05000000000000000000000000000000` 1936 AAD (1 bytes) = 01 1937 Key = `01000000000000000000000000000000` 1938 `00000000000000000000000000000000` 1939 Nonce = `030000000000000000000000` 1940 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1941 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1942 `456e3c6c05ecc157cdbf0700fedad222` 1943 POLYVAL input = `01000000000000000000000000000000` 1944 `02000000000000000000000000000000` 1945 `03000000000000000000000000000000` 1946 `04000000000000000000000000000000` 1947 `05000000000000000000000000000000` 1948 `08000000000000000002000000000000` 1949 POLYVAL result = `da58d2f61b0a9d343b2f37fb0c519733` 1950 POLYVAL result XOR nonce = `d958d2f61b0a9d343b2f37fb0c519733` 1951 ... and masked = `d958d2f61b0a9d343b2f37fb0c519733` 1952 Tag = `5bde0285037c5de81e5b570a049b62a0` 1953 Initial counter = `5bde0285037c5de81e5b570a049b62a0` 1954 Result (80 bytes) = `67fd45e126bfb9a79930c43aad2d3696` 1955 `7d3f0e4d217c1e551f59727870beefc9` 1956 `8cb933a8fce9de887b1e40799988db1f` 1957 `c3f91880ed405b2dd298318858467c89` 1958 `5bde0285037c5de81e5b570a049b62a0` 1959 1960 1961 1962 Gueron, et al. Informational [Page 35] 1963 1964 RFC 8452 AES-GCM-SIV April 2019 1965 1966 1967 Plaintext (4 bytes) = `02000000` 1968 AAD (12 bytes) = `010000000000000000000000` 1969 Key = `01000000000000000000000000000000` 1970 `00000000000000000000000000000000` 1971 Nonce = `030000000000000000000000` 1972 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1973 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1974 `456e3c6c05ecc157cdbf0700fedad222` 1975 POLYVAL input = `01000000000000000000000000000000` 1976 `02000000000000000000000000000000` 1977 `60000000000000002000000000000000` 1978 POLYVAL result = `6dc76ae84b88916e073a303aafde05cf` 1979 POLYVAL result XOR nonce = `6ec76ae84b88916e073a303aafde05cf` 1980 ... and masked = `6ec76ae84b88916e073a303aafde054f` 1981 Tag = `1835e517741dfddccfa07fa4661b74cf` 1982 Initial counter = `1835e517741dfddccfa07fa4661b74cf` 1983 Result (20 bytes) = `22b3f4cd1835e517741dfddccfa07fa4` 1984 `661b74cf` 1985 1986 1987 Plaintext (20 bytes) = `03000000000000000000000000000000` 1988 `04000000` 1989 AAD (18 bytes) = `01000000000000000000000000000000` 1990 0200 1991 Key = `01000000000000000000000000000000` 1992 `00000000000000000000000000000000` 1993 Nonce = `030000000000000000000000` 1994 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 1995 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 1996 `456e3c6c05ecc157cdbf0700fedad222` 1997 POLYVAL input = `01000000000000000000000000000000` 1998 `02000000000000000000000000000000` 1999 `03000000000000000000000000000000` 2000 `04000000000000000000000000000000` 2001 `9000000000000000a000000000000000` 2002 POLYVAL result = `973ef4fd04bd31d193816ab26f8655ca` 2003 POLYVAL result XOR nonce = `943ef4fd04bd31d193816ab26f8655ca` 2004 ... and masked = `943ef4fd04bd31d193816ab26f86554a` 2005 Tag = `b879ad976d8242acc188ab59cabfe307` 2006 Initial counter = `b879ad976d8242acc188ab59cabfe387` 2007 Result (36 bytes) = `43dd0163cdb48f9fe3212bf61b201976` 2008 `067f342bb879ad976d8242acc188ab59` 2009 `cabfe307` 2010 2011 2012 Plaintext (18 bytes) = `03000000000000000000000000000000` 2013 0400 2014 AAD (20 bytes) = `01000000000000000000000000000000` 2015 2016 2017 2018 Gueron, et al. Informational [Page 36] 2019 2020 RFC 8452 AES-GCM-SIV April 2019 2021 2022 2023 `02000000` 2024 Key = `01000000000000000000000000000000` 2025 `00000000000000000000000000000000` 2026 Nonce = `030000000000000000000000` 2027 Record authentication key = `b5d3c529dfafac43136d2d11be284d7f` 2028 Record encryption key = `b914f4742be9e1d7a2f84addbf96dec3` 2029 `456e3c6c05ecc157cdbf0700fedad222` 2030 POLYVAL input = `01000000000000000000000000000000` 2031 `02000000000000000000000000000000` 2032 `03000000000000000000000000000000` 2033 `04000000000000000000000000000000` 2034 `a0000000000000009000000000000000` 2035 POLYVAL result = `2cbb6b7ab2dbffefb797f825f826870c` 2036 POLYVAL result XOR nonce = `2fbb6b7ab2dbffefb797f825f826870c` 2037 ... and masked = `2fbb6b7ab2dbffefb797f825f826870c` 2038 Tag = `cfcdf5042112aa29685c912fc2056543` 2039 Initial counter = `cfcdf5042112aa29685c912fc20565c3` 2040 Result (34 bytes) = `462401724b5ce6588d5a54aae5375513` 2041 `a075cfcdf5042112aa29685c912fc205` 2042 6543 2043 2044 Plaintext (0 bytes) = 2045 AAD (0 bytes) = 2046 Key = `e66021d5eb8e4f4066d4adb9c33560e4` 2047 `f46e44bb3da0015c94f7088736864200` 2048 Nonce = `e0eaf5284d884a0e77d31646` 2049 Record authentication key = `e40d26f82774aa27f47b047b608b9585` 2050 Record encryption key = `7c7c3d9a542cef53dde0e6de9b580040` 2051 `0f82e73ec5f7ee41b7ba8dcb9ba078c3` 2052 POLYVAL input = `00000000000000000000000000000000` 2053 POLYVAL result = `00000000000000000000000000000000` 2054 POLYVAL result XOR nonce = `e0eaf5284d884a0e77d3164600000000` 2055 ... and masked = `e0eaf5284d884a0e77d3164600000000` 2056 Tag = `169fbb2fbf389a995f6390af22228a62` 2057 Initial counter = `169fbb2fbf389a995f6390af22228ae2` 2058 Result (16 bytes) = `169fbb2fbf389a995f6390af22228a62` 2059 2060 2061 Plaintext (3 bytes) = 671fdd 2062 AAD (5 bytes) = `4fbdc66f14` 2063 Key = `bae8e37fc83441b16034566b7a806c46` 2064 `bb91c3c5aedb64a6c590bc84d1a5e269` 2065 Nonce = `e4b47801afc0577e34699b9e` 2066 Record authentication key = `b546f5a850d0a90adfe39e95c2510fc6` 2067 Record encryption key = `b9d1e239d62cbb5c49273ddac8838bdc` 2068 `c53bca478a770f07087caa4e0a924a55` 2069 POLYVAL input = `4fbdc66f140000000000000000000000` 2070 `671fdd00000000000000000000000000` 2071 2072 2073 2074 Gueron, et al. Informational [Page 37] 2075 2076 RFC 8452 AES-GCM-SIV April 2019 2077 2078 2079 `28000000000000001800000000000000` 2080 POLYVAL result = `b91f91f96b159a7c611c05035b839e92` 2081 POLYVAL result XOR nonce = `5dabe9f8c4d5cd0255759e9d5b839e92` 2082 ... and masked = `5dabe9f8c4d5cd0255759e9d5b839e12` 2083 Tag = `93da9bb81333aee0c785b240d319719d` 2084 Initial counter = `93da9bb81333aee0c785b240d319719d` 2085 Result (19 bytes) = `0eaccb93da9bb81333aee0c785b240d3` 2086 19719d 2087 2088 2089 Plaintext (6 bytes) = `195495860f04` 2090 AAD (10 bytes) = `6787f3ea22c127aaf195` 2091 Key = `6545fc880c94a95198874296d5cc1fd1` 2092 `61320b6920ce07787f86743b275d1ab3` 2093 Nonce = `2f6d1f0434d8848c1177441f` 2094 Record authentication key = `e156e1f9b0b07b780cbe30f259e3c8da` 2095 Record encryption key = `6fc1c494519f944aae52fcd8b14e5b17` 2096 `1b5a9429d3b76e430d49940c0021d612` 2097 POLYVAL input = `6787f3ea22c127aaf195000000000000` 2098 `195495860f0400000000000000000000` 2099 `50000000000000003000000000000000` 2100 POLYVAL result = `2c480ed9d236b1df24c6eec109bd40c1` 2101 POLYVAL result XOR nonce = `032511dde6ee355335b1aade09bd40c1` 2102 ... and masked = `032511dde6ee355335b1aade09bd4041` 2103 Tag = `6b62b84dc40c84636a5ec12020ec8c2c` 2104 Initial counter = `6b62b84dc40c84636a5ec12020ec8cac` 2105 Result (22 bytes) = `a254dad4f3f96b62b84dc40c84636a5e` 2106 `c12020ec8c2c` 2107 2108 2109 Plaintext (9 bytes) = `c9882e5386fd9f92ec` 2110 AAD (15 bytes) = `489c8fde2be2cf97e74e932d4ed87d` 2111 Key = `d1894728b3fed1473c528b8426a58299` 2112 `5929a1499e9ad8780c8d63d0ab4149c0` 2113 Nonce = `9f572c614b4745914474e7c7` 2114 Record authentication key = `0533fd71f4119257361a3ff1469dd4e5` 2115 Record encryption key = `4feba89799be8ac3684fa2bb30ade0ea` 2116 `51390e6d87dcf3627d2ee44493853abe` 2117 POLYVAL input = `489c8fde2be2cf97e74e932d4ed87d00` 2118 `c9882e5386fd9f92ec00000000000000` 2119 `78000000000000004800000000000000` 2120 POLYVAL result = `bf160bc9ded8c63057d2c38aae552fb4` 2121 POLYVAL result XOR nonce = `204127a8959f83a113a6244dae552fb4` 2122 ... and masked = `204127a8959f83a113a6244dae552f34` 2123 Tag = `c0fd3dc6628dfe55ebb0b9fb2295c8c2` 2124 Initial counter = `c0fd3dc6628dfe55ebb0b9fb2295c8c2` 2125 Result (25 bytes) = `0df9e308678244c44bc0fd3dc6628dfe` 2126 `55ebb0b9fb2295c8c2` 2127 2128 2129 2130 Gueron, et al. Informational [Page 38] 2131 2132 RFC 8452 AES-GCM-SIV April 2019 2133 2134 2135 Plaintext (12 bytes) = `1db2316fd568378da107b52b` 2136 AAD (20 bytes) = `0da55210cc1c1b0abde3b2f204d1e9f8` 2137 `b06bc47f` 2138 Key = `a44102952ef94b02b805249bac80e6f6` 2139 `1455bfac8308a2d40d8c845117808235` 2140 Nonce = `5c9e940fea2f582950a70d5a` 2141 Record authentication key = `64779ab10ee8a280272f14cc8851b727` 2142 Record encryption key = `25f40fc63f49d3b9016a8eeeb75846e0` 2143 `d72ca36ddbd312b6f5ef38ad14bd2651` 2144 POLYVAL input = `0da55210cc1c1b0abde3b2f204d1e9f8` 2145 `b06bc47f000000000000000000000000` 2146 `1db2316fd568378da107b52b00000000` 2147 `a0000000000000006000000000000000` 2148 POLYVAL result = `cc86ee22c861e1fd474c84676b42739c` 2149 POLYVAL result XOR nonce = `90187a2d224eb9d417eb893d6b42739c` 2150 ... and masked = `90187a2d224eb9d417eb893d6b42731c` 2151 Tag = `404099c2587f64979f21826706d497d5` 2152 Initial counter = `404099c2587f64979f21826706d497d5` 2153 Result (28 bytes) = `8dbeb9f7255bf5769dd56692404099c2` 2154 `587f64979f21826706d497d5` 2155 2156 2157 Plaintext (15 bytes) = `21702de0de18baa9c9596291b08466` 2158 AAD (25 bytes) = `f37de21c7ff901cfe8a69615a93fdf7a` 2159 `98cad481796245709f` 2160 Key = `9745b3d1ae06556fb6aa7890bebc18fe` 2161 `6b3db4da3d57aa94842b9803a96e07fb` 2162 Nonce = `6de71860f762ebfbd08284e4` 2163 Record authentication key = `27c2959ed4daea3b1f52e849478de376` 2164 Record encryption key = `307a38a5a6cf231c0a9af3b527f23a62` 2165 `e9a6ff09aff8ae669f760153e864fc93` 2166 POLYVAL input = `f37de21c7ff901cfe8a69615a93fdf7a` 2167 `98cad481796245709f00000000000000` 2168 `21702de0de18baa9c9596291b0846600` 2169 `c8000000000000007800000000000000` 2170 POLYVAL result = `c4fa5e5b713853703bcf8e6424505fa5` 2171 POLYVAL result XOR nonce = `a91d463b865ab88beb4d0a8024505fa5` 2172 ... and masked = `a91d463b865ab88beb4d0a8024505f25` 2173 Tag = `b3080d28f6ebb5d3648ce97bd5ba67fd` 2174 Initial counter = `b3080d28f6ebb5d3648ce97bd5ba67fd` 2175 Result (31 bytes) = `793576dfa5c0f88729a7ed3c2f1bffb3` 2176 `080d28f6ebb5d3648ce97bd5ba67fd` 2177 2178 2179 Plaintext (18 bytes) = `b202b370ef9768ec6561c4fe6b7e7296` 2180 fa85 2181 AAD (30 bytes) = `9c2159058b1f0fe91433a5bdc20e214e` 2182 `ab7fecef4454a10ef0657df21ac7` 2183 2184 2185 2186 Gueron, et al. Informational [Page 39] 2187 2188 RFC 8452 AES-GCM-SIV April 2019 2189 2190 2191 Key = `b18853f68d833640e42a3c02c25b6486` 2192 `9e146d7b233987bddfc240871d7576f7` 2193 Nonce = `028ec6eb5ea7e298342a94d4` 2194 Record authentication key = `670b98154076ddb59b7a9137d0dcc0f0` 2195 Record encryption key = `78116d78507fbe69d4a820c350f55c7c` 2196 `b36c3c9287df0e9614b142b76a587c3f` 2197 POLYVAL input = `9c2159058b1f0fe91433a5bdc20e214e` 2198 `ab7fecef4454a10ef0657df21ac70000` 2199 `b202b370ef9768ec6561c4fe6b7e7296` 2200 `fa850000000000000000000000000000` 2201 `f0000000000000009000000000000000` 2202 POLYVAL result = `4e4108f09f41d797dc9256f8da8d58c7` 2203 POLYVAL result XOR nonce = `4ccfce1bc1e6350fe8b8c22cda8d58c7` 2204 ... and masked = `4ccfce1bc1e6350fe8b8c22cda8d5847` 2205 Tag = `454fc2a154fea91f8363a39fec7d0a49` 2206 Initial counter = `454fc2a154fea91f8363a39fec7d0ac9` 2207 Result (34 bytes) = `857e16a64915a787637687db4a951963` 2208 `5cdd454fc2a154fea91f8363a39fec7d` 2209 0a49 2210 2211 2212 Plaintext (21 bytes) = `ced532ce4159b035277d4dfbb7db6296` 2213 `8b13cd4eec` 2214 AAD (35 bytes) = `734320ccc9d9bbbb19cb81b2af4ecbc3` 2215 `e72834321f7aa0f70b7282b4f33df23f` 2216 167541 2217 Key = `3c535de192eaed3822a2fbbe2ca9dfc8` 2218 `8255e14a661b8aa82cc54236093bbc23` 2219 Nonce = `688089e55540db1872504e1c` 2220 Record authentication key = `cb8c3aa3f8dbaeb4b28a3e86ff6625f8` 2221 Record encryption key = `02426ce1aa3ab31313b0848469a1b5fc` 2222 `6c9af9602600b195b04ad407026bc06d` 2223 POLYVAL input = `734320ccc9d9bbbb19cb81b2af4ecbc3` 2224 `e72834321f7aa0f70b7282b4f33df23f` 2225 `16754100000000000000000000000000` 2226 `ced532ce4159b035277d4dfbb7db6296` 2227 `8b13cd4eec0000000000000000000000` 2228 `1801000000000000a800000000000000` 2229 POLYVAL result = `ffd503c7dd712eb3791b7114b17bb0cf` 2230 POLYVAL result XOR nonce = `97558a228831f5ab0b4b3f08b17bb0cf` 2231 ... and masked = `97558a228831f5ab0b4b3f08b17bb04f` 2232 Tag = `9d6c7029675b89eaf4ba1ded1a286594` 2233 Initial counter = `9d6c7029675b89eaf4ba1ded1a286594` 2234 Result (37 bytes) = `626660c26ea6612fb17ad91e8e767639` 2235 `edd6c9faee9d6c7029675b89eaf4ba1d` 2236 `ed1a286594` 2237 2238 2239 2240 2241 2242 Gueron, et al. Informational [Page 40] 2243 2244 RFC 8452 AES-GCM-SIV April 2019 2245 2246 2247 C.3. Counter Wrap Tests 2248 2249 The tests in this section use AEAD_AES_256_GCM_SIV and are crafted to 2250 test correct wrapping of the block counter. 2251 2252 Plaintext (32 bytes) = `00000000000000000000000000000000` 2253 `4db923dc793ee6497c76dcc03a98e108` 2254 AAD (0 bytes) = 2255 Key = `00000000000000000000000000000000` 2256 `00000000000000000000000000000000` 2257 Nonce = `000000000000000000000000` 2258 Record authentication key = `dc95c078a24089895275f3d86b4fb868` 2259 Record encryption key = `779b38d15bffb63d39d6e9ae76a9b2f3` 2260 `75d11b0e3a68c422845c7d4690fa594f` 2261 POLYVAL input = `00000000000000000000000000000000` 2262 `4db923dc793ee6497c76dcc03a98e108` 2263 `00000000000000000001000000000000` 2264 POLYVAL result = `7367cdb411b730128dd56e8edc0eff56` 2265 POLYVAL result XOR nonce = `7367cdb411b730128dd56e8edc0eff56` 2266 ... and masked = `7367cdb411b730128dd56e8edc0eff56` 2267 Tag = `ffffffff000000000000000000000000` 2268 Initial counter = `ffffffff000000000000000000000080` 2269 Result (48 bytes) = `f3f80f2cf0cb2dd9c5984fcda908456c` 2270 `c537703b5ba70324a6793a7bf218d3ea` 2271 `ffffffff000000000000000000000000` 2272 2273 2274 Plaintext (24 bytes) = `eb3640277c7ffd1303c7a542d02d3e4c` 2275 `0000000000000000` 2276 AAD (0 bytes) = 2277 Key = `00000000000000000000000000000000` 2278 `00000000000000000000000000000000` 2279 Nonce = `000000000000000000000000` 2280 Record authentication key = `dc95c078a24089895275f3d86b4fb868` 2281 Record encryption key = `779b38d15bffb63d39d6e9ae76a9b2f3` 2282 `75d11b0e3a68c422845c7d4690fa594f` 2283 POLYVAL input = `eb3640277c7ffd1303c7a542d02d3e4c` 2284 `00000000000000000000000000000000` 2285 `0000000000000000c000000000000000` 2286 POLYVAL result = `7367cdb411b730128dd56e8edc0eff56` 2287 POLYVAL result XOR nonce = `7367cdb411b730128dd56e8edc0eff56` 2288 ... and masked = `7367cdb411b730128dd56e8edc0eff56` 2289 Tag = `ffffffff000000000000000000000000` 2290 Initial counter = `ffffffff000000000000000000000080` 2291 Result (40 bytes) = `18ce4f0b8cb4d0cac65fea8f79257b20` 2292 `888e53e72299e56dffffffff00000000` 2293 `0000000000000000` 2294 2295 2296 2297 2298 Gueron, et al. Informational [Page 41] 2299 2300 RFC 8452 AES-GCM-SIV April 2019 2301 2302 2303 Acknowledgements 2304 2305 The authors would like to thank Daniel Bleichenbacher, Uri 2306 Blumenthal, Deb Cooley's team at NSA Information Assurance, Scott 2307 Fluhrer, Tetsu Iwata, Tibor Jager, John Mattsson, Ondrej Mosnacek, 2308 Kenny Paterson, Bart Preneel, Yannick Seurin, and Bjoern Tackmann for 2309 their helpful suggestions and review. 2310 2311 Authors' Addresses 2312 2313 Shay Gueron 2314 University of Haifa and Amazon 2315 Abba Khoushy Ave 199 2316 Haifa `3498838` 2317 Israel 2318 2319 Email: shay@math.haifa.ac.il 2320 2321 2322 Adam Langley 2323 Google LLC 2324 345 Spear St 2325 San Francisco, CA 94105 2326 United States of America 2327 2328 Email: agl@google.com 2329 2330 2331 Yehuda Lindell 2332 Bar-Ilan University and Unbound Tech 2333 Ramat Gan 2334 `5290002` 2335 Israel 2336 2337 Email: Yehuda.Lindell@biu.ac.il 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 Gueron, et al. Informational [Page 42] 2355