aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2015-12-20 13:08:09 +0100
committerSimon Warta <[email protected]>2015-12-20 13:08:09 +0100
commit71d2b324f693c856346a50bed51952ff2797f787 (patch)
tree52f9a7351476a8aed6eb8dddd4d0b767de4f6f04
parent1752f0d522eef9a4a703fccf702b4b026c1c1d01 (diff)
Add all 18 Nist GCM tests
This adds tests for key length 192 and 256. Test vector source: http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm /gcm-spec.pdf Closes: #344
-rw-r--r--src/tests/data/aead/gcm.vec163
1 files changed, 122 insertions, 41 deletions
diff --git a/src/tests/data/aead/gcm.vec b/src/tests/data/aead/gcm.vec
index 572fa917f..21bc3a53e 100644
--- a/src/tests/data/aead/gcm.vec
+++ b/src/tests/data/aead/gcm.vec
@@ -1,44 +1,125 @@
[AES-128/GCM]
-Key = 00000000000000000000000000000000
-Nonce = 000000000000000000000000
-In =
-Out = 58E2FCCEFA7E3061367F1D57A4E7455A
-
-Key = 00000000000000000000000000000000
-Nonce = 000000000000000000000000
-In = 00000000000000000000000000000000
-Out = 0388DACE60B6A392F328C2B971B2FE78AB6E47D42CEC13BDF53A67B21257BDDF
-
-Key = FEFFE9928665731C6D6A8F9467308308
-Nonce = 9313225DF88406E555909C5AFF5269AA6A7A9538534F7DA1E4C303D2A318A728C3C0C95156809539FCF0E2429A6B525416AEDBF5A0DE6A57A637B39B
-In = D9313225F88406E5A55909C5AFF5269A86A7A9531534F7DA2E4C303D8A318A721C3C0C95956809532FCF0E2449A6B525B16AEDF5AA0DE657BA637B39
-AD = FEEDFACEDEADBEEFFEEDFACEDEADBEEFABADDAD2
-Out = 8CE24998625615B603A033ACA13FB894BE9112A5C3A211A8BA262A3CCA7E2CA701E4A9A4FBA43C90CCDCB281D48C7C6FD62875D2ACA417034C34AEE5619CC5AEFFFE0BFA462AF43C1699D050
-
-Key = FEFFE9928665731C6D6A8F9467308308
-Nonce = CAFEBABEFACEDBADDECAF888
-In = D9313225F88406E5A55909C5AFF5269A86A7A9531534F7DA2E4C303D8A318A721C3C0C95956809532FCF0E2449A6B525B16AEDF5AA0DE657BA637B391AAFD255
-Out = 42831EC2217774244B7221B784D0D49CE3AA212F2C02A4E035C17E2329ACA12E21D514B25466931C7D8F6A5AAC84AA051BA30B396A0AAC973D58E091473F59854D5C2AF327CD64A62CF35ABD2BA6FAB4
-
-Key = FEFFE9928665731C6D6A8F9467308308
-Nonce = CAFEBABEFACEDBADDECAF888
-In = D9313225F88406E5A55909C5AFF5269A86A7A9531534F7DA2E4C303D8A318A721C3C0C95956809532FCF0E2449A6B525B16AEDF5AA0DE657BA637B39
-AD = FEEDFACEDEADBEEFFEEDFACEDEADBEEFABADDAD2
-Out = 42831EC2217774244B7221B784D0D49CE3AA212F2C02A4E035C17E2329ACA12E21D514B25466931C7D8F6A5AAC84AA051BA30B396A0AAC973D58E0915BC94FBC3221A5DB94FAE95AE7121A47
-
-Key = FEFFE9928665731C6D6A8F9467308308
-Nonce = CAFEBABEFACEDBAD
-In = D9313225F88406E5A55909C5AFF5269A86A7A9531534F7DA2E4C303D8A318A721C3C0C95956809532FCF0E2449A6B525B16AEDF5AA0DE657BA637B39
-AD = FEEDFACEDEADBEEFFEEDFACEDEADBEEFABADDAD2
-Out = 61353B4C2806934A777FF51FA22A4755699B2A714FCDC6F83766E5F97B6C742373806900E49F24B22B097544D4896B424989B5E1EBAC0F07C23F45983612D2E79E3B0785561BE14AACA2FCCB
-
-Key = 2B7E151628AED2A6ABF7158809CF4F3C
-Nonce = F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
-In = 006BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710006BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710006BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710006BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710006BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710006BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710006BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710006BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710006BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710006BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710006BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710
-Out = BD70C168B0D4371B0A85B4B5D65D92569B17F9A3D0A25B9F608E2C34621CF4D37357845431E04E585CDAAD7527BF8A2426DEEF451320C78D5EF09F5B11A8B8C700CD329A3D4CDED92C20F6BF28CB3627681C5B0AF2B5692CC7EC9049008ACBBD127A9CD8DEF00425697E0BCF67E05AEE70EA1A5D7EE95E3B88FBAF3C196AAAECB73E09BDF057AF701A0242394BCC104FF4F75F15D287325FCFFDB7E7FF3A939A80A6A3A9D7570E6EF6AD0BBE6E291338938D2FEBBC7D5EE95CD73E752ACD48915DCAE0A0807E6F4B2ADADBD945667318264EF7D8C2ECC0B8FB67A43614C5F5EA51CADD4AEE91DC371A7FC5A3B4581D1D9DD99608CD2BB0338F82933C19F5B8EBAD6BBA583835FBD29136302BAC163F86CA9E3E6F3B5BFDEFAB3E4B019190AE2EBC0B71034EA9BF882879139FFE76DD997F6729425F3D5C5392762C245769D18CC963C92211B71F564203AFBF68626C0833031D449B02DFA5C0F09FAFCE951FE35F4AD8122AB682A4AF28931113F75615E12DB05DD9247973F1C6057666848C13EDE41192F38948366D468D84CAF896EFF724082D2BAB2376E2813B41A014999B0EE7377758715D9554926AB3514EEB96A0ABD501D94A05692D858190D5AD307CEB6E6C8A63841A8257BEC2527C4B937840AA51292E15834AB801F0275A6A4B1B6E969B7A7FCE217D6F823CDE1760F847E8F46CBDE152A24F2319EC2A7089D2954259D30332089FF928034391D1B0B8AFD7C8A5D4F8E0DAB5883CA7D581F78E4848DC3B01E5F2A5C01BA8910D0F144BC494E29450271174B866868EE8DC6B0DD396ED9D72F83DE3BB6DE6FEBC64178961E011D0D746C2CE3A0FBD05CDF8FA79AC03E94C88368BD903E1427FCFC30C9D100E220B4CB9B7BA242DA49D334E930B6C4EB877D1DF2C0F8CF4AF7813E2F29592970719846FC52A47FCE6E71DC5E58FC5F49C91BDE56B7A2A68CFA994D6BFA5357A8403A2B37C69A6A0A435E4AB4C9E450473AF0CDFDBCC238A2DD74FEA89D75727E82B3A9F9EEB5E217A3E
+# Nist | Test Case 1
+Key = 00000000000000000000000000000000
+Nonce = 000000000000000000000000
+In =
+Out = 58E2FCCEFA7E3061367F1D57A4E7455A
+
+# Nist | Test Case 2
+Key = 00000000000000000000000000000000
+Nonce = 000000000000000000000000
+In = 00000000000000000000000000000000
+Out = 0388DACE60B6A392F328C2B971B2FE78AB6E47D42CEC13BDF53A67B21257BDDF
+
+# Nist | Test Case 3
+Key = FEFFE9928665731C6D6A8F9467308308
+Nonce = CAFEBABEFACEDBADDECAF888
+In = D9313225F88406E5A55909C5AFF5269A86A7A9531534F7DA2E4C303D8A318A721C3C0C95956809532FCF0E2449A6B525B16AEDF5AA0DE657BA637B391AAFD255
+Out = 42831EC2217774244B7221B784D0D49CE3AA212F2C02A4E035C17E2329ACA12E21D514B25466931C7D8F6A5AAC84AA051BA30B396A0AAC973D58E091473F59854D5C2AF327CD64A62CF35ABD2BA6FAB4
+
+# Nist | Test Case 4
+Key = FEFFE9928665731C6D6A8F9467308308
+Nonce = CAFEBABEFACEDBADDECAF888
+In = D9313225F88406E5A55909C5AFF5269A86A7A9531534F7DA2E4C303D8A318A721C3C0C95956809532FCF0E2449A6B525B16AEDF5AA0DE657BA637B39
+AD = FEEDFACEDEADBEEFFEEDFACEDEADBEEFABADDAD2
+Out = 42831EC2217774244B7221B784D0D49CE3AA212F2C02A4E035C17E2329ACA12E21D514B25466931C7D8F6A5AAC84AA051BA30B396A0AAC973D58E0915BC94FBC3221A5DB94FAE95AE7121A47
+
+# Nist | Test Case 5
+Key = FEFFE9928665731C6D6A8F9467308308
+Nonce = CAFEBABEFACEDBAD
+In = D9313225F88406E5A55909C5AFF5269A86A7A9531534F7DA2E4C303D8A318A721C3C0C95956809532FCF0E2449A6B525B16AEDF5AA0DE657BA637B39
+AD = FEEDFACEDEADBEEFFEEDFACEDEADBEEFABADDAD2
+Out = 61353B4C2806934A777FF51FA22A4755699B2A714FCDC6F83766E5F97B6C742373806900E49F24B22B097544D4896B424989B5E1EBAC0F07C23F45983612D2E79E3B0785561BE14AACA2FCCB
+
+# Nist | Test Case 6
+Key = FEFFE9928665731C6D6A8F9467308308
+Nonce = 9313225DF88406E555909C5AFF5269AA6A7A9538534F7DA1E4C303D2A318A728C3C0C95156809539FCF0E2429A6B525416AEDBF5A0DE6A57A637B39B
+In = D9313225F88406E5A55909C5AFF5269A86A7A9531534F7DA2E4C303D8A318A721C3C0C95956809532FCF0E2449A6B525B16AEDF5AA0DE657BA637B39
+AD = FEEDFACEDEADBEEFFEEDFACEDEADBEEFABADDAD2
+Out = 8CE24998625615B603A033ACA13FB894BE9112A5C3A211A8BA262A3CCA7E2CA701E4A9A4FBA43C90CCDCB281D48C7C6FD62875D2ACA417034C34AEE5619CC5AEFFFE0BFA462AF43C1699D050
+
+[AES-192/GCM]
+# Nist | Test Case 7
+Key = 000000000000000000000000000000000000000000000000
+Nonce = 000000000000000000000000
+In =
+Out = cd33b28ac773f74ba00ed1f312572435
+
+# Nist | Test Case 8
+Key = 000000000000000000000000000000000000000000000000
+Nonce = 000000000000000000000000
+In = 00000000000000000000000000000000
+Out = 98e7247c07f0fe411c267e4384b0f6002ff58d80033927ab8ef4d4587514f0fb
+
+# Nist | Test Case 9
+Key = feffe9928665731c6d6a8f9467308308feffe9928665731c
+Nonce = cafebabefacedbaddecaf888
+In = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255
+Out = 3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710acade2569924a7c8587336bfb118024db8674a14
+
+# Nist | Test Case 10
+Key = feffe9928665731c6d6a8f9467308308feffe9928665731c
+Nonce = cafebabefacedbaddecaf888
+In = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
+AD = feedfacedeadbeeffeedfacedeadbeefabaddad2
+Out = 3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda27102519498e80f1478f37ba55bd6d27618c
+
+# Nist | Test Case 11
+Key = feffe9928665731c6d6a8f9467308308feffe9928665731c
+Nonce = cafebabefacedbad
+In = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
+AD = feedfacedeadbeeffeedfacedeadbeefabaddad2
+Out = 0f10f599ae14a154ed24b36e25324db8c566632ef2bbb34f8347280fc4507057fddc29df9a471f75c66541d4d4dad1c9e93a19a58e8b473fa0f062f765dcc57fcf623a24094fcca40d3533f8
+
+# Nist | Test Case 12
+Key = feffe9928665731c6d6a8f9467308308feffe9928665731c
+Nonce = 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b
+In = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
+AD = feedfacedeadbeeffeedfacedeadbeefabaddad2
+Out = d27e88681ce3243c4830165a8fdcf9ff1de9a1d8e6b447ef6ef7b79828666e4581e79012af34ddd9e2f037589b292db3e67c036745fa22e7e9b7373bdcf566ff291c25bbb8568fc3d376a6d9
+
+[AES-256/GCM]
+# Nist | Test Case 13
+Key = 0000000000000000000000000000000000000000000000000000000000000000
+Nonce = 000000000000000000000000
+In =
+Out = 530f8afbc74536b9a963b4f1c4cb738b
+
+# Nist | Test Case 14
+Key = 0000000000000000000000000000000000000000000000000000000000000000
+Nonce = 000000000000000000000000
+In = 00000000000000000000000000000000
+Out = cea7403d4d606b6e074ec5d3baf39d18d0d1c8a799996bf0265b98b5d48ab919
+
+# Nist | Test Case 15
+Key = feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
+Nonce = cafebabefacedbaddecaf888
+In = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255
+Out = 522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662898015adb094dac5d93471bdec1a502270e3cc6c
+
+# Nist | Test Case 16
+Key = feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
+Nonce = cafebabefacedbaddecaf888
+In = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
+AD = feedfacedeadbeeffeedfacedeadbeefabaddad2
+Out = 522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f66276fc6ece0f4e1768cddf8853bb2d551b
+
+# Nist | Test Case 17
+Key = feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
+Nonce = cafebabefacedbad
+In = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
+AD = feedfacedeadbeeffeedfacedeadbeefabaddad2
+Out = c3762df1ca787d32ae47c13bf19844cbaf1ae14d0b976afac52ff7d79bba9de0feb582d33934a4f0954cc2363bc73f7862ac430e64abe499f47c9b1f3a337dbf46a792c45e454913fe2ea8f2
+
+# Nist | Test Case 18
+Key = feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
+Nonce = 9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b
+In = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
+AD = feedfacedeadbeeffeedfacedeadbeefabaddad2
+Out = 5a8def2f0c9e53f1f75d7853659e2a20eeb2b22aafde6419a058ab4f6f746bf40fc0c3b780f244452da3ebf1c5d82cdea2418997200ef82e44ae7e3fa44a8266ee1c8eb0c8b5d4cf5ae9f19a
[AES-128/GCM(8)]
-Key = 00000000000000000000000000000000
-Nonce = 000000000000000000000000
-In =
-Out = 58E2FCCEFA7E3061
+Key = 00000000000000000000000000000000
+Nonce = 000000000000000000000000
+In =
+Out = 58E2FCCEFA7E3061