From 5af6f1b825075f3738eaa9c971800bd2bb69ff37 Mon Sep 17 00:00:00 2001 From: Ayrx Date: Thu, 10 Apr 2014 20:42:05 +0800 Subject: Added test vectors for AES-CMAC --- vectors/cryptography_vectors/CMAC/rfc4493.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 vectors/cryptography_vectors/CMAC/rfc4493.txt diff --git a/vectors/cryptography_vectors/CMAC/rfc4493.txt b/vectors/cryptography_vectors/CMAC/rfc4493.txt new file mode 100644 index 00000000..7e5fb781 --- /dev/null +++ b/vectors/cryptography_vectors/CMAC/rfc4493.txt @@ -0,0 +1,18 @@ +# AES-CMAC Test Vectors +# RFC 4493 + +COUNT = 0 +MESSAGE = +OUTPUT = bb1d6929e95937287fa37d129b756746 + +COUNT = 1 +MESSAGE = 6bc1bee22e409f96e93d7e117393172a +OUTPUT = 070a16b46b4d4144f79bdd9dd04a287c + +COUNT = 2 +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411 +OUTPUT = dfa66747de9ae63030ca32611497c827 + +COUNT = 3 +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 +OUTPUT = 51f0bebf7e3b9d92fc49741779363cfe -- cgit v1.2.3 From 1d6b77beb61c9daebbe84d27fb5d48958dbc8f89 Mon Sep 17 00:00:00 2001 From: Ayrx Date: Thu, 10 Apr 2014 23:11:03 +0800 Subject: More vectors --- docs/development/test-vectors.rst | 10 ++++ .../CMAC/nist-800-38b-3des.txt | 60 ++++++++++++++++++++++ .../CMAC/nist-800-38b-aes192.txt | 23 +++++++++ .../CMAC/nist-800-38b-aes256.txt | 22 ++++++++ .../cryptography_vectors/CMAC/rfc4493-aes128.txt | 22 ++++++++ vectors/cryptography_vectors/CMAC/rfc4493.txt | 18 ------- 6 files changed, 137 insertions(+), 18 deletions(-) create mode 100644 vectors/cryptography_vectors/CMAC/nist-800-38b-3des.txt create mode 100644 vectors/cryptography_vectors/CMAC/nist-800-38b-aes192.txt create mode 100644 vectors/cryptography_vectors/CMAC/nist-800-38b-aes256.txt create mode 100644 vectors/cryptography_vectors/CMAC/rfc4493-aes128.txt delete mode 100644 vectors/cryptography_vectors/CMAC/rfc4493.txt diff --git a/docs/development/test-vectors.rst b/docs/development/test-vectors.rst index a1692c19..59b3fe90 100644 --- a/docs/development/test-vectors.rst +++ b/docs/development/test-vectors.rst @@ -89,6 +89,15 @@ Two factor authentication * TOTP from :rfc:`6238` (Note that an `errata`_ for the test vectors in RFC 6238 exists) +CMAC +~~~~ + +* AES-128 from :rfc:`4493` +* AES-192 from `NIST SP-800-38B`_ +* AES-256 from `NIST SP-800-38B`_ +* Three Key 3DES from `NIST SP-800-38B`_ +* Two Key 3DES `NIST SP-800-38B`_ + Creating test vectors --------------------- @@ -138,3 +147,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/SP_800-38B.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..7c3ff5ce --- /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 = b7a688e122ffaf95 + +COUNT = 2 +KEY1 = 8aa83bf8cbda1062 +KEY2 = 0bc1bf19fbb6cd58 +KEY3 = bc313d4a371ca8b5 +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a57 +OUTPUT = d32bcebe43d23d80 + +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 = bd2ebf9a3ba00361 + +COUNT = 6 +KEY1 = 4cf15134a2850dd5 +KEY2 = 8a3d10ba80570d38 +KEY3 = 4cf15134a2850dd5 +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a57 +OUTPUT = 8ea92435b52660e0 + +COUNT = 7 +KEY1 = 4cf15134a2850dd5 +KEY2 = 8a3d10ba80570d38 +KEY3 = 4cf15134a2850dd5 +MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e51 +OUTPUT = 31b1e431dabc4eb8 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 diff --git a/vectors/cryptography_vectors/CMAC/rfc4493-aes128.txt b/vectors/cryptography_vectors/CMAC/rfc4493-aes128.txt new file mode 100644 index 00000000..76857a86 --- /dev/null +++ b/vectors/cryptography_vectors/CMAC/rfc4493-aes128.txt @@ -0,0 +1,22 @@ +# AES-128-CMAC Test Vectors +# RFC 4493 + +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/rfc4493.txt b/vectors/cryptography_vectors/CMAC/rfc4493.txt deleted file mode 100644 index 7e5fb781..00000000 --- a/vectors/cryptography_vectors/CMAC/rfc4493.txt +++ /dev/null @@ -1,18 +0,0 @@ -# AES-CMAC Test Vectors -# RFC 4493 - -COUNT = 0 -MESSAGE = -OUTPUT = bb1d6929e95937287fa37d129b756746 - -COUNT = 1 -MESSAGE = 6bc1bee22e409f96e93d7e117393172a -OUTPUT = 070a16b46b4d4144f79bdd9dd04a287c - -COUNT = 2 -MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411 -OUTPUT = dfa66747de9ae63030ca32611497c827 - -COUNT = 3 -MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 -OUTPUT = 51f0bebf7e3b9d92fc49741779363cfe -- cgit v1.2.3 From 40afce08a073d64363dc12bf1bdd520337c875c2 Mon Sep 17 00:00:00 2001 From: Ayrx Date: Sun, 13 Apr 2014 19:17:52 +0800 Subject: Fixed wrong vectors --- docs/development/test-vectors.rst | 6 +++--- .../CMAC/nist-800-38b-3des.txt | 8 ++++---- .../CMAC/nist-800-38b-aes128.txt | 22 ++++++++++++++++++++++ .../cryptography_vectors/CMAC/rfc4493-aes128.txt | 22 ---------------------- 4 files changed, 29 insertions(+), 29 deletions(-) create mode 100644 vectors/cryptography_vectors/CMAC/nist-800-38b-aes128.txt delete mode 100644 vectors/cryptography_vectors/CMAC/rfc4493-aes128.txt diff --git a/docs/development/test-vectors.rst b/docs/development/test-vectors.rst index 59b3fe90..b5bac556 100644 --- a/docs/development/test-vectors.rst +++ b/docs/development/test-vectors.rst @@ -92,11 +92,11 @@ Two factor authentication CMAC ~~~~ -* AES-128 from :rfc:`4493` +* AES-128 from `NIST SP-800-38B`_ * AES-192 from `NIST SP-800-38B`_ * AES-256 from `NIST SP-800-38B`_ * Three Key 3DES from `NIST SP-800-38B`_ -* Two Key 3DES `NIST SP-800-38B`_ +* Two Key 3DES from `NIST SP-800-38B`_ Creating test vectors --------------------- @@ -147,4 +147,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/SP_800-38B.pdf +.. _`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 index 7c3ff5ce..60561e05 100644 --- a/vectors/cryptography_vectors/CMAC/nist-800-38b-3des.txt +++ b/vectors/cryptography_vectors/CMAC/nist-800-38b-3des.txt @@ -14,14 +14,14 @@ KEY1 = 8aa83bf8cbda1062 KEY2 = 0bc1bf19fbb6cd58 KEY3 = bc313d4a371ca8b5 MESSAGE = 6bc1bee22e409f96 -OUTPUT = b7a688e122ffaf95 +OUTPUT = 8e8f293136283797 COUNT = 2 KEY1 = 8aa83bf8cbda1062 KEY2 = 0bc1bf19fbb6cd58 KEY3 = bc313d4a371ca8b5 MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a57 -OUTPUT = d32bcebe43d23d80 +OUTPUT = 743ddbe0ce2dc2ed COUNT = 3 KEY1 = 8aa83bf8cbda1062 @@ -43,14 +43,14 @@ KEY1 = 4cf15134a2850dd5 KEY2 = 8a3d10ba80570d38 KEY3 = 4cf15134a2850dd5 MESSAGE = 6bc1bee22e409f96 -OUTPUT = bd2ebf9a3ba00361 +OUTPUT = 4ff2ab813c53ce83 COUNT = 6 KEY1 = 4cf15134a2850dd5 KEY2 = 8a3d10ba80570d38 KEY3 = 4cf15134a2850dd5 MESSAGE = 6bc1bee22e409f96e93d7e117393172aae2d8a57 -OUTPUT = 8ea92435b52660e0 +OUTPUT = 62dd1b471902bd4e COUNT = 7 KEY1 = 4cf15134a2850dd5 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/rfc4493-aes128.txt b/vectors/cryptography_vectors/CMAC/rfc4493-aes128.txt deleted file mode 100644 index 76857a86..00000000 --- a/vectors/cryptography_vectors/CMAC/rfc4493-aes128.txt +++ /dev/null @@ -1,22 +0,0 @@ -# AES-128-CMAC Test Vectors -# RFC 4493 - -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 -- cgit v1.2.3 From fa52e6a9e2301d2f2a824d42aa2379a7b0dea12b Mon Sep 17 00:00:00 2001 From: Ayrx Date: Mon, 14 Apr 2014 22:26:21 +0800 Subject: Updated vectors documentation --- docs/development/test-vectors.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/development/test-vectors.rst b/docs/development/test-vectors.rst index b5bac556..5f31e304 100644 --- a/docs/development/test-vectors.rst +++ b/docs/development/test-vectors.rst @@ -92,11 +92,7 @@ Two factor authentication CMAC ~~~~ -* AES-128 from `NIST SP-800-38B`_ -* AES-192 from `NIST SP-800-38B`_ -* AES-256 from `NIST SP-800-38B`_ -* Three Key 3DES from `NIST SP-800-38B`_ -* Two Key 3DES from `NIST SP-800-38B`_ +* AES-128, AES-192, AES-256, 3DES from `NIST SP-800-38B`_ Creating test vectors --------------------- -- cgit v1.2.3