diff options
author | Jack Lloyd <[email protected]> | 2016-07-11 12:35:24 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-07-11 12:35:24 -0400 |
commit | 9fc9e763f77ba57dc4458b863edd93b928b92887 (patch) | |
tree | 2c971a2c53f113452709bfe3c373cbde12a027b9 | |
parent | 7dc0ab8da3d4aed04156aac27b84f4c4fc57ba56 (diff) | |
parent | 0d503ef93d34571039115f05a24a849a05226b5c (diff) |
Merge GH #531 Add AES/CBC/CTS tests from RFC 3962
-rw-r--r-- | src/tests/data/modes/cbc.vec | 32 | ||||
-rw-r--r-- | src/tests/test_modes.cpp | 5 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/tests/data/modes/cbc.vec b/src/tests/data/modes/cbc.vec index bad6ae0c1..6839a396b 100644 --- a/src/tests/data/modes/cbc.vec +++ b/src/tests/data/modes/cbc.vec @@ -1227,3 +1227,35 @@ Key = 603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4 Nonce = 000102030405060708090A0B0C0D0E0F In = 6BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710 Out = F58C4C04D6E5F1BA779EABFB5F7BFBD69CFC4E967EDB808D679F777BC6702C7D39F23369A9D9BACFA530E26304231461B2EB05E2C39BE9FCDA6C19078C6A9D1B + +# RFC 3962: Advanced Encryption Standard (AES) Encryption for Kerberos 5 +[AES-128/CBC/CTS] +Key = 636869636b656e207465726979616b69 +Nonce = 00000000000000000000000000000000 +In = 4920776f756c64206c696b652074686520 +Out = c6353568f2bf8cb4d8a580362da7ff7f97 + +Key = 636869636b656e207465726979616b69 +Nonce = 00000000000000000000000000000000 +In = 4920776f756c64206c696b65207468652047656e6572616c20476175277320 +Out = fc00783e0efdb2c1d445d4c8eff7ed2297687268d6ecccc0c07b25e25ecfe5 + +Key = 636869636b656e207465726979616b69 +Nonce = 00000000000000000000000000000000 +In = 4920776f756c64206c696b65207468652047656e6572616c2047617527732043 +Out = 39312523a78662d5be7fcbcc98ebf5a897687268d6ecccc0c07b25e25ecfe584 + +Key = 636869636b656e207465726979616b69 +Nonce = 00000000000000000000000000000000 +In = 4920776f756c64206c696b65207468652047656e6572616c20476175277320436869636b656e2c20706c656173652c +Out = 97687268d6ecccc0c07b25e25ecfe584b3fffd940c16a18c1b5549d2f838029e39312523a78662d5be7fcbcc98ebf5 + +Key = 636869636b656e207465726979616b69 +Nonce = 00000000000000000000000000000000 +In = 4920776f756c64206c696b65207468652047656e6572616c20476175277320436869636b656e2c20706c656173652c20 +Out = 97687268d6ecccc0c07b25e25ecfe5849dad8bbb96c4cdc03bc103e1a194bbd839312523a78662d5be7fcbcc98ebf5a8 + +Key = 636869636b656e207465726979616b69 +Nonce = 00000000000000000000000000000000 +In = 4920776f756c64206c696b65207468652047656e6572616c20476175277320436869636b656e2c20706c656173652c20616e6420776f6e746f6e20736f75702e +Out = 97687268d6ecccc0c07b25e25ecfe58439312523a78662d5be7fcbcc98ebf5a84807efe836ee89a526730dbc2f7bc8409dad8bbb96c4cdc03bc103e1a194bbd8
\ No newline at end of file diff --git a/src/tests/test_modes.cpp b/src/tests/test_modes.cpp index 7b6344975..66f537346 100644 --- a/src/tests/test_modes.cpp +++ b/src/tests/test_modes.cpp @@ -39,6 +39,8 @@ class Cipher_Mode_Tests : public Text_Based_Test return result; } + result.test_eq("name", enc->name(), algo); + result.test_eq("mode not authenticated", enc->authenticated(), false); enc->set_key(key); @@ -57,6 +59,9 @@ class Cipher_Mode_Tests : public Text_Based_Test dec->finish(buf); result.test_eq("decrypt", buf, input); + enc->clear(); + dec->clear(); + return result; } }; |