Bug 992343: Add two AES CBC test vectors for each key size from NIST.
authorWan-Teh Chang <wtc@google.com>
Fri, 04 Apr 2014 17:06:56 -0700
changeset 11106 3c110288ae8a8360679451675c433f53ed253f7c
parent 11105 84ec42d1a6bc68611596bc9808a1aaf70ed03888
child 11107 742307da0792066e4b4ca46aa7b28399868507ae
push id355
push userwtc@google.com
push dateSat, 05 Apr 2014 00:07:02 +0000
bugs992343
Bug 992343: Add two AES CBC test vectors for each key size from NIST. They are the first two test vectors in CBCGFSbox128.rsp, CBCGFSbox192.rsp, and CBCGFSbox256.rsp. r=rrelyea.
cmd/bltest/tests/aes_cbc/ciphertext1
cmd/bltest/tests/aes_cbc/ciphertext2
cmd/bltest/tests/aes_cbc/ciphertext3
cmd/bltest/tests/aes_cbc/ciphertext4
cmd/bltest/tests/aes_cbc/ciphertext5
cmd/bltest/tests/aes_cbc/ciphertext6
cmd/bltest/tests/aes_cbc/iv1
cmd/bltest/tests/aes_cbc/iv2
cmd/bltest/tests/aes_cbc/iv3
cmd/bltest/tests/aes_cbc/iv4
cmd/bltest/tests/aes_cbc/iv5
cmd/bltest/tests/aes_cbc/iv6
cmd/bltest/tests/aes_cbc/key1
cmd/bltest/tests/aes_cbc/key2
cmd/bltest/tests/aes_cbc/key3
cmd/bltest/tests/aes_cbc/key4
cmd/bltest/tests/aes_cbc/key5
cmd/bltest/tests/aes_cbc/key6
cmd/bltest/tests/aes_cbc/mktst.sh
cmd/bltest/tests/aes_cbc/numtests
cmd/bltest/tests/aes_cbc/plaintext1
cmd/bltest/tests/aes_cbc/plaintext2
cmd/bltest/tests/aes_cbc/plaintext3
cmd/bltest/tests/aes_cbc/plaintext4
cmd/bltest/tests/aes_cbc/plaintext5
cmd/bltest/tests/aes_cbc/plaintext6
cmd/bltest/tests/aes_cbc/test1.txt
cmd/bltest/tests/aes_cbc/test2.txt
cmd/bltest/tests/aes_cbc/test3.txt
cmd/bltest/tests/aes_cbc/test4.txt
cmd/bltest/tests/aes_cbc/test5.txt
cmd/bltest/tests/aes_cbc/test6.txt
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/ciphertext1
@@ -0,0 +1,1 @@
+AzZ2PpZtkllaVnzJzlN/Xg==
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/ciphertext2
@@ -0,0 +1,1 @@
+qaFjG/SZaVTrwJOVeyNFiQ==
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/ciphertext3
@@ -0,0 +1,1 @@
+J1z8BBPYzLcFE8OFmx0Pcg==
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/ciphertext4
@@ -0,0 +1,1 @@
+ybgTX/G1rcQT39BTshvZbQ==
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/ciphertext5
@@ -0,0 +1,1 @@
+XJ2ETtRvmIUIXl1qT5TH1w==
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/ciphertext6
@@ -0,0 +1,1 @@
+qf91vXz2YT03Mcd8O20MBA==
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..01d633b27e8ea9b17084fc911d0c8cc43a4170a9
GIT binary patch
literal 16
Kc${NkKm`B*5C8!H
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..01d633b27e8ea9b17084fc911d0c8cc43a4170a9
GIT binary patch
literal 16
Kc${NkKm`B*5C8!H
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..01d633b27e8ea9b17084fc911d0c8cc43a4170a9
GIT binary patch
literal 16
Kc${NkKm`B*5C8!H
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..01d633b27e8ea9b17084fc911d0c8cc43a4170a9
GIT binary patch
literal 16
Kc${NkKm`B*5C8!H
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..01d633b27e8ea9b17084fc911d0c8cc43a4170a9
GIT binary patch
literal 16
Kc${NkKm`B*5C8!H
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..01d633b27e8ea9b17084fc911d0c8cc43a4170a9
GIT binary patch
literal 16
Kc${NkKm`B*5C8!H
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..01d633b27e8ea9b17084fc911d0c8cc43a4170a9
GIT binary patch
literal 16
Kc${NkKm`B*5C8!H
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..01d633b27e8ea9b17084fc911d0c8cc43a4170a9
GIT binary patch
literal 16
Kc${NkKm`B*5C8!H
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4ac5fc6cf890b46738523c4d4d9d964e312f368f
GIT binary patch
literal 24
Kc${NkzzzTa7ytnP
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4ac5fc6cf890b46738523c4d4d9d964e312f368f
GIT binary patch
literal 24
Kc${NkzzzTa7ytnP
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4e4e4935707a596987ec1cc32e3d0d587dbe4f04
GIT binary patch
literal 32
Kc${Nkzz+ZbAOHaX
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4e4e4935707a596987ec1cc32e3d0d587dbe4f04
GIT binary patch
literal 32
Kc${Nkzz+ZbAOHaX
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/mktst.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+for i in 1 2 3 4 5 6
+do
+    file="test$i.txt"
+    grep "KEY = " $file | sed -e 's;KEY = ;;' | hex > key$i
+    grep "IV = "  $file | sed -e 's;IV = ;;' | hex > iv$i
+    grep "PLAINTEXT = "  $file | sed -e 's;PLAINTEXT = ;;' | hex  > plaintext$i
+    grep "CIPHERTEXT = "  $file | sed -e 's;CIPHERTEXT = ;;' | hex > ciphertext$i.bin
+    btoa < ciphertext$i.bin > ciphertext$i
+    rm ciphertext$i.bin
+done
--- a/cmd/bltest/tests/aes_cbc/numtests
+++ b/cmd/bltest/tests/aes_cbc/numtests
@@ -1,1 +1,1 @@
-1
+7
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/plaintext1
@@ -0,0 +1,1 @@
+D<']s
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/plaintext2
@@ -0,0 +1,1 @@
+du"}Nr
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/plaintext3
@@ -0,0 +1,1 @@
+zj)xmu9
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/plaintext4
@@ -0,0 +1,1 @@
+-BWdӚ#
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/plaintext5
@@ -0,0 +1,2 @@
+G0
+%&T}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/plaintext6
@@ -0,0 +1,1 @@
+$6<f_(%״t
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/test1.txt
@@ -0,0 +1,5 @@
+COUNT = 0
+KEY = 00000000000000000000000000000000
+IV = 00000000000000000000000000000000
+PLAINTEXT = f34481ec3cc627bacd5dc3fb08f273e6
+CIPHERTEXT = 0336763e966d92595a567cc9ce537f5e
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/test2.txt
@@ -0,0 +1,5 @@
+COUNT = 1
+KEY = 00000000000000000000000000000000
+IV = 00000000000000000000000000000000
+PLAINTEXT = 9798c4640bad75c7c3227db910174e72
+CIPHERTEXT = a9a1631bf4996954ebc093957b234589
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/test3.txt
@@ -0,0 +1,5 @@
+COUNT = 0
+KEY = 000000000000000000000000000000000000000000000000
+IV = 00000000000000000000000000000000
+PLAINTEXT = 1b077a6af4b7f98229de786d7516b639
+CIPHERTEXT = 275cfc0413d8ccb70513c3859b1d0f72
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/test4.txt
@@ -0,0 +1,5 @@
+COUNT = 1
+KEY = 000000000000000000000000000000000000000000000000
+IV = 00000000000000000000000000000000
+PLAINTEXT = 9c2d8842e5f48f57648205d39a239af1
+CIPHERTEXT = c9b8135ff1b5adc413dfd053b21bd96d
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/test5.txt
@@ -0,0 +1,5 @@
+COUNT = 0
+KEY = 0000000000000000000000000000000000000000000000000000000000000000
+IV = 00000000000000000000000000000000
+PLAINTEXT = 014730f80ac625fe84f026c60bfd547d
+CIPHERTEXT = 5c9d844ed46f9885085e5d6a4f94c7d7
new file mode 100644
--- /dev/null
+++ b/cmd/bltest/tests/aes_cbc/test6.txt
@@ -0,0 +1,5 @@
+COUNT = 1
+KEY = 0000000000000000000000000000000000000000000000000000000000000000
+IV = 00000000000000000000000000000000
+PLAINTEXT = 0b24af36193ce4665f2825d7b4749c98
+CIPHERTEXT = a9ff75bd7cf6613d3731c77c3b6d0c04