From 9f530d8c55e71f024a490850a8083d6c479fa448 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 16 Jan 2019 06:22:49 +0000 Subject: [PATCH] Add another standard AES test vector. The 128-bit example from Appendix A/B is a more useful first test case for a new implementation than the Appendix C tests, because the standard shows even more of the working (in particular the full set of intermediate results from key setup). --- test/cryptsuite.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/cryptsuite.py b/test/cryptsuite.py index 3b9136c7..4753edd3 100755 --- a/test/cryptsuite.py +++ b/test/cryptsuite.py @@ -957,6 +957,14 @@ class standard_test_vectors(MyTestBase): self.assertEqualBin( ssh2_cipher_decrypt(c, ciphertext), plaintext) + # The test vector from FIPS 197 appendix B. (This is also the + # same key whose key setup phase is shown in detail in + # appendix A.) + vector('aes128', + unhex('2b7e151628aed2a6abf7158809cf4f3c'), + unhex('3243f6a8885a308d313198a2e0370734'), + unhex('3925841d02dc09fbdc118597196a0b32')) + # The test vectors from FIPS 197 appendix C: the key bytes go # 00 01 02 03 ... for as long as needed, and the plaintext # bytes go 00 11 22 33 ... FF.