diff options
5 files changed, 133 insertions, 0 deletions
diff --git a/docs/development/test-vectors.rst b/docs/development/test-vectors.rst index a1692c19..5f31e304 100644 --- a/docs/development/test-vectors.rst +++ b/docs/development/test-vectors.rst @@ -89,6 +89,11 @@ Two factor authentication * TOTP from :rfc:`6238` (Note that an `errata`_ for the test vectors in RFC 6238 exists) +CMAC +~~~~ + +* AES-128, AES-192, AES-256, 3DES from `NIST SP-800-38B`_ + Creating test vectors --------------------- @@ -138,3 +143,4 @@ header format (substituting the correct information): .. _`NESSIE IDEA vectors`: https://www.cosic.esat.kuleuven.be/nessie/testvectors/bc/idea/Idea-128-64.verified.test-vectors .. _`NESSIE`: https://en.wikipedia.org/wiki/NESSIE .. _`Ed25519 website`: http://ed25519.cr.yp.to/software.html +.. _`NIST SP-800-38B`: http://csrc.nist.gov/publications/nistpubs/800-38B/Updated_CMAC_Examples.pdf diff --git a/vectors/cryptography_vectors/CMAC/nist-800-38b-3des.txt b/vectors/cryptography_vectors/CMAC/nist-800-38b-3des.txt new file mode 100644 index 00000000..60561e05 --- /dev/null +++ b/vectors/cryptography_vectors/CMAC/nist-800-38b-3des.txt @@ -0,0 +1,60 @@ +# 3DES-CMAC Test Vectors +# NIST SP_800-38B + +# Three Key +COUNT = 0 +KEY1 = 8aa83bf8cbda1062 +KEY2 = 0bc1bf19fbb6cd58 +KEY3 = bc313d4a371ca8b5 +MESSAGE = +OUTPUT = b7a688e122ffaf95 + +COUNT = 1 +KEY1 = 8aa83bf8cbda1062 +KEY2 = 0bc1bf19fbb6cd58 +KEY3 = bc313d4a371ca8b5 +MESSAGE = 6bc1bee22e409f96 +OUTPUT = 8e8f293136283797 + +COUNT = 2 +KEY1 = 8aa83bf8cbda1062 +KEY2 = 0bc1bf19fbb6cd58 +KEY3 = bc313d4a371ca8b5 +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a57 +OUTPUT = 743ddbe0ce2dc2ed + +COUNT = 3 +KEY1 = 8aa83bf8cbda1062 +KEY2 = 0bc1bf19fbb6cd58 +KEY3 = bc313d4a371ca8b5 +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +OUTPUT = 33e6b1092400eae5 + +# Two Key +COUNT = 4 +KEY1 = 4cf15134a2850dd5 +KEY2 = 8a3d10ba80570d38 +KEY3 = 4cf15134a2850dd5 +MESSAGE = +OUTPUT = bd2ebf9a3ba00361 + +COUNT = 5 +KEY1 = 4cf15134a2850dd5 +KEY2 = 8a3d10ba80570d38 +KEY3 = 4cf15134a2850dd5 +MESSAGE = 6bc1bee22e409f96 +OUTPUT = 4ff2ab813c53ce83 + +COUNT = 6 +KEY1 = 4cf15134a2850dd5 +KEY2 = 8a3d10ba80570d38 +KEY3 = 4cf15134a2850dd5 +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a57 +OUTPUT = 62dd1b471902bd4e + +COUNT = 7 +KEY1 = 4cf15134a2850dd5 +KEY2 = 8a3d10ba80570d38 +KEY3 = 4cf15134a2850dd5 +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +OUTPUT = 31b1e431dabc4eb8 diff --git a/vectors/cryptography_vectors/CMAC/nist-800-38b-aes128.txt b/vectors/cryptography_vectors/CMAC/nist-800-38b-aes128.txt new file mode 100644 index 00000000..7219d39d --- /dev/null +++ b/vectors/cryptography_vectors/CMAC/nist-800-38b-aes128.txt @@ -0,0 +1,22 @@ +# AES-128-CMAC Test Vectors +# NIST SP_800-38B + +COUNT = 0 +KEY = 2b7e151628aed2a6abf7158809cf4f3c +MESSAGE = +OUTPUT = bb1d6929e95937287fa37d129b756746 + +COUNT = 1 +KEY = 2b7e151628aed2a6abf7158809cf4f3c +MESSAGE = 6bc1bee22e409f96e93d7e117393172a +OUTPUT = 070a16b46b4d4144f79bdd9dd04a287c + +COUNT = 2 +KEY = 2b7e151628aed2a6abf7158809cf4f3c +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411 +OUTPUT = dfa66747de9ae63030ca32611497c827 + +COUNT = 3 +KEY = 2b7e151628aed2a6abf7158809cf4f3c +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 +OUTPUT = 51f0bebf7e3b9d92fc49741779363cfe diff --git a/vectors/cryptography_vectors/CMAC/nist-800-38b-aes192.txt b/vectors/cryptography_vectors/CMAC/nist-800-38b-aes192.txt new file mode 100644 index 00000000..7c819ea3 --- /dev/null +++ b/vectors/cryptography_vectors/CMAC/nist-800-38b-aes192.txt @@ -0,0 +1,23 @@ +# AES-192-CMAC Test Vectors +# NIST SP_800-38B + +COUNT = 0 +KEY = 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +MESSAGE = +OUTPUT = d17ddf46adaacde531cac483de7a9367 + +COUNT = 1 +KEY = 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +MESSAGE = 6bc1bee22e409f96e93d7e117393172a +OUTPUT = 9e99a7bf31e710900662f65e617c5184 + + +COUNT = 2 +KEY = 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411 +OUTPUT = 8a1de5be2eb31aad089a82e6ee908b0e + +COUNT = 3 +KEY = 8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 +OUTPUT = a1d5df0eed790f794d77589659f39a11 diff --git a/vectors/cryptography_vectors/CMAC/nist-800-38b-aes256.txt b/vectors/cryptography_vectors/CMAC/nist-800-38b-aes256.txt new file mode 100644 index 00000000..477151bc --- /dev/null +++ b/vectors/cryptography_vectors/CMAC/nist-800-38b-aes256.txt @@ -0,0 +1,22 @@ +# AES-256-CMAC Test Vectors +# NIST SP_800-38B + +COUNT = 0 +KEY = 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +MESSAGE = +OUTPUT = 028962f61b7bf89efc6b551f4667d983 + +COUNT = 1 +KEY = 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +MESSAGE = 6bc1bee22e409f96e93d7e117393172a +OUTPUT = 28a7023f452e8f82bd4bf28d8c37c35c + +COUNT = 2 +KEY = 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411 +OUTPUT = aaf3d8f1de5640c232f5b169b9c911e6 + +COUNT = 3 +KEY = 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 +OUTPUT = e1992190549f6ed5696a2c056c315410 |