Add tests from cipher_test.txt to the AEAD test suite.

Change-Id: I819b5473e35e1f71192d3a336252ae4506c4230b
Reviewed-on: https://boringssl-review.googlesource.com/6055
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
Brian Smith 2015-09-24 22:54:42 -10:00 committed by Adam Langley
parent 0dd93002dd
commit bc41cdf327
2 changed files with 151 additions and 0 deletions

View File

@ -1,3 +1,6 @@
# The AES-128-GCM test cases from cipher_test.txt have been merged into this
# file.
KEY: d480429666d48b400633921c5407d1d1
NONCE: 3388c676dc754acfa66e172a
IN:
@ -424,3 +427,105 @@ IN: 48656c6c6f2c20576f726c64
AD:
CT: cec189d0e8419b90fb16d555
TAG: 32893832a8d609224d77c2e56a922282
# AES GCM test vectors from http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-spec.pdf
KEY: 00000000000000000000000000000000
NONCE: 000000000000000000000000
IN: ""
CT: ""
AD: ""
TAG: 58e2fccefa7e3061367f1d57a4e7455a
KEY: 00000000000000000000000000000000
NONCE: 000000000000000000000000
IN: 00000000000000000000000000000000
CT: 0388dace60b6a392f328c2b971b2fe78
AD: ""
TAG: ab6e47d42cec13bdf53a67b21257bddf
KEY: feffe9928665731c6d6a8f9467308308
NONCE: cafebabefacedbaddecaf888
IN: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255
CT: 42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091473f5985
AD: ""
TAG: 4d5c2af327cd64a62cf35abd2ba6fab4
KEY: feffe9928665731c6d6a8f9467308308
NONCE: cafebabefacedbaddecaf888
IN: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
CT: 42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091
AD: feedfacedeadbeeffeedfacedeadbeefabaddad2
TAG: 5bc94fbc3221a5db94fae95ae7121a47
KEY: feffe9928665731c6d6a8f9467308308
NONCE: cafebabefacedbad
IN: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
CT: 61353b4c2806934a777ff51fa22a4755699b2a714fcdc6f83766e5f97b6c742373806900e49f24b22b097544d4896b424989b5e1ebac0f07c23f4598
AD: feedfacedeadbeeffeedfacedeadbeefabaddad2
TAG: 3612d2e79e3b0785561be14aaca2fccb
KEY: feffe9928665731c6d6a8f9467308308
NONCE: 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b
IN: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
CT: 8ce24998625615b603a033aca13fb894be9112a5c3a211a8ba262a3cca7e2ca701e4a9a4fba43c90ccdcb281d48c7c6fd62875d2aca417034c34aee5
AD: feedfacedeadbeeffeedfacedeadbeefabaddad2
TAG: 619cc5aefffe0bfa462af43c1699d050
# local add-ons, primarily streaming ghash tests
# 128 bytes AD
KEY: 00000000000000000000000000000000
NONCE: 000000000000000000000000
IN: ""
CT: ""
AD: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662898015ad
TAG: 5fea793a2d6f974d37e68e0cb8ff9492
# 48 bytes plaintext
KEY: 00000000000000000000000000000000
NONCE: 000000000000000000000000
IN: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
CT: 0388dace60b6a392f328c2b971b2fe78f795aaab494b5923f7fd89ff948bc1e0200211214e7394da2089b6acd093abe0
AD: ""
TAG: 9dd0a376b08e40eb00c35f29f9ea61a4
# 80 bytes plaintext
KEY: 00000000000000000000000000000000
NONCE: 000000000000000000000000
IN: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
CT: 0388dace60b6a392f328c2b971b2fe78f795aaab494b5923f7fd89ff948bc1e0200211214e7394da2089b6acd093abe0c94da219118e297d7b7ebcbcc9c388f28ade7d85a8ee35616f7124a9d5270291
AD: ""
TAG: 98885a3a22bd4742fe7b72172193b163
# 128 bytes plaintext
KEY: 00000000000000000000000000000000
NONCE: 000000000000000000000000
IN: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
CT: 0388dace60b6a392f328c2b971b2fe78f795aaab494b5923f7fd89ff948bc1e0200211214e7394da2089b6acd093abe0c94da219118e297d7b7ebcbcc9c388f28ade7d85a8ee35616f7124a9d527029195b84d1b96c690ff2f2de30bf2ec89e00253786e126504f0dab90c48a30321de3345e6b0461e7c9e6c6b7afedde83f40
AD: ""
TAG: cac45f60e31efd3b5a43b98a22ce1aa1
# 192 bytes plaintext, iv is chosen so that initial counter LSB is 0xFF
KEY: 00000000000000000000000000000000
NONCE: ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
IN: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
CT: 56b3373ca9ef6e4a2b64fe1e9a17b61425f10d47a75a5fce13efc6bc784af24f4141bdd48cf7c770887afd573cca5418a9aeffcd7c5ceddfc6a78397b9a85b499da558257267caab2ad0b23ca476a53cb17fb41c4b8b475cb4f3f7165094c229c9e8c4dc0a2a5ff1903e501511221376a1cdb8364c5061a20cae74bc4acd76ceb0abc9fd3217ef9f8c90be402ddf6d8697f4f880dff15bfb7a6b28241ec8fe183c2d59e3f9dfff653c7126f0acb9e64211f42bae12af462b1070bef1ab5e3606
AD: ""
TAG: 566f8ef683078bfdeeffa869d751a017
# 288 bytes plaintext, iv is chosen so that initial counter LSB is 0xFF
KEY: 00000000000000000000000000000000
NONCE: ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
IN: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
CT: 56b3373ca9ef6e4a2b64fe1e9a17b61425f10d47a75a5fce13efc6bc784af24f4141bdd48cf7c770887afd573cca5418a9aeffcd7c5ceddfc6a78397b9a85b499da558257267caab2ad0b23ca476a53cb17fb41c4b8b475cb4f3f7165094c229c9e8c4dc0a2a5ff1903e501511221376a1cdb8364c5061a20cae74bc4acd76ceb0abc9fd3217ef9f8c90be402ddf6d8697f4f880dff15bfb7a6b28241ec8fe183c2d59e3f9dfff653c7126f0acb9e64211f42bae12af462b1070bef1ab5e3606872ca10dee15b3249b1a1b958f23134c4bccb7d03200bce420a2f8eb66dcf3644d1423c1b5699003c13ecef4bf38a3b60eedc34033bac1902783dc6d89e2e774188a439c7ebcc0672dbda4ddcfb2794613b0be41315ef778708a70ee7d75165c
AD: ""
TAG: 8b307f6b33286d0ab026a9ed3fe1e85f
# 80 bytes plaintext, submitted by Intel
KEY: 843ffcf5d2b72694d19ed01d01249412
NONCE: dbcca32ebf9b804617c3aa9e
IN: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f
AD: 00000000000000000000000000000000101112131415161718191a1b1c1d1e1f
CT: 6268c6fa2a80b2d137467f092f657ac04d89be2beaa623d61b5a868c8f03ff95d3dcee23ad2f1ab3a6c80eaf4b140eb05de3457f0fbc111a6b43d0763aa422a3013cf1dc37fe417d1fbfc449b75d4cc5
TAG: 3b629ccfbc1119b7319e1dce2cd6fd6d

View File

@ -1,3 +1,6 @@
# The AES-256-GCM test cases from cipher_test.txt have been merged into this
# file.
KEY: e5ac4a32c67e425ac4b143c83c6f161312a97d88d634afdf9f4da5bd35223f01
NONCE: 5bf11a0951f0bfc7ea5c9e58
IN:
@ -418,3 +421,46 @@ AD: 2134f74e882a44e457c38b6580cd58ce20e81267baeb4a9d50c41ababc2a91ddf300c3996364
CT: 0fe35823610ea698aeb5b571f3ebbaf0ac3586ecb3b24fcc7c56943d4426f7fdf4e4a53fb430751456d41551f8e5502faa0e1ac5f452b27b13c1dc63e9231c6b192f8dd2978300293298acb6293459d3204429e374881085d49ed6ad76f1d85e3f6dd5455a7a5a9d7127386a30f80658395dc8eb158e5ca052a7137feef28aa247e176cceb9c031f73fb8d48139e3bdb30e2e19627f7fc3501a6d6287e2fb89ad184cefa1774585aa663586f289c778462eee3cd88071140274770e4ed98b9b83cd4fa659fcdd2d1fde7e58333c6cf7f83fe285b97ad8f276a375fafa15f88e6167f5f2bfb95af1aefee80b0620a9bc09402ab79036e716f0c8d518ae2fa15094f6ea4c5e8b283f97cc27f2f1d0b6367b4b508c7bad16f1539325751bd785e9e08cd508bdb3b84
TAG: 1976d7e121704ce463a8d4fe1b93d90f
# AES GCM test vectors from http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-spec.pdf
KEY: 0000000000000000000000000000000000000000000000000000000000000000
NONCE: 000000000000000000000000
IN: ""
CT: ""
AD: ""
TAG: 530f8afbc74536b9a963b4f1c4cb738b
KEY: 0000000000000000000000000000000000000000000000000000000000000000
NONCE: 000000000000000000000000
IN: 00000000000000000000000000000000
CT: cea7403d4d606b6e074ec5d3baf39d18
AD: ""
TAG: d0d1c8a799996bf0265b98b5d48ab919
KEY: feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
NONCE: cafebabefacedbaddecaf888
IN: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255
CT: 522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662898015ad
AD: ""
TAG: b094dac5d93471bdec1a502270e3cc6c
KEY: feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
NONCE: cafebabefacedbaddecaf888
IN: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
CT: 522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662
AD: feedfacedeadbeeffeedfacedeadbeefabaddad2
TAG: 76fc6ece0f4e1768cddf8853bb2d551b
KEY: feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
NONCE: cafebabefacedbad
IN: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
CT: c3762df1ca787d32ae47c13bf19844cbaf1ae14d0b976afac52ff7d79bba9de0feb582d33934a4f0954cc2363bc73f7862ac430e64abe499f47c9b1f
AD: feedfacedeadbeeffeedfacedeadbeefabaddad2
TAG: 3a337dbf46a792c45e454913fe2ea8f2
KEY: feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
NONCE: 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b
IN: d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
CT: 5a8def2f0c9e53f1f75d7853659e2a20eeb2b22aafde6419a058ab4f6f746bf40fc0c3b780f244452da3ebf1c5d82cdea2418997200ef82e44ae7e3f
AD: feedfacedeadbeeffeedfacedeadbeefabaddad2
TAG: a44a8266ee1c8eb0c8b5d4cf5ae9f19a