diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /security/nss/cmd/bltest/tests/aes_ctr | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'security/nss/cmd/bltest/tests/aes_ctr')
18 files changed, 311 insertions, 0 deletions
diff --git a/security/nss/cmd/bltest/tests/aes_ctr/aes_ctr_0.txt b/security/nss/cmd/bltest/tests/aes_ctr/aes_ctr_0.txt new file mode 100644 index 0000000000..1e2a367d46 --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/aes_ctr_0.txt @@ -0,0 +1,28 @@ +Test="F.5.1 CTR-AES128.Encrypt" +Type=Encrypt +Key=2b7e151628aed2a6abf7158809cf4f3c +Init. Counter=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Block #1={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Output Block=ec8cdf7398607cb0f2d21675ea9ea1e4 +Plaintext=6bc1bee22e409f96e93d7e117393172a +Ciphertext=874d6191b620e3261bef6864990db6ce +} +Block #2={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff00 +Output Block=362b7c3c6773516318a077d7fc5073ae +Plaintext=ae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext=9806f66b7970fdff8617187bb9fffdff +} +Block #3={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff01 +Output Block=6a2cc3787889374fbeb4c81b17ba6c44 +Plaintext=30c81c46a35ce411e5fbc1191a0a52ef +Ciphertext=5ae4df3edbd5d35e5b4f09020db03eab +} +Block #4={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff02 +Output Block=e89c399ff0f198c6d40a31db156cabfe +Plaintext=f69f2445df4f9b17ad2b417be66c3710 +Ciphertext=1e031dda2fbe03d1792170a0f3009cee +} diff --git a/security/nss/cmd/bltest/tests/aes_ctr/aes_ctr_1.txt b/security/nss/cmd/bltest/tests/aes_ctr/aes_ctr_1.txt new file mode 100644 index 0000000000..d42fc1955c --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/aes_ctr_1.txt @@ -0,0 +1,28 @@ +Test="F.5.3 CTR-AES192.Encrypt" +Type=Encrypt +Key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +Init. Counter=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Block #1={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Output Block=717d2dc639128334a6167a488ded7921 +Plaintext=6bc1bee22e409f96e93d7e117393172a +Ciphertext=1abc932417521ca24f2b0459fe7e6e0b +} +Block #2={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff00 +Output Block=a72eb3bb14a556734b7bad6ab16100c5 +Plaintext=ae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext=090339ec0aa6faefd5ccc2c6f4ce8e94 +} +Block #3={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff01 +Output Block=2efeae2d72b722613446dc7f4c2af918 +Plaintext=30c81c46a35ce411e5fbc1191a0a52ef +Ciphertext=1e36b26bd1ebc670d1bd1d665620abf7 +} +Block #4={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff02 +Output Block=b9e783b30dd7924ff7bc9b97beaa8740 +Plaintext=f69f2445df4f9b17ad2b417be66c3710 +Ciphertext=4f78a7f6d29809585a97daec58c6b050 +} diff --git a/security/nss/cmd/bltest/tests/aes_ctr/aes_ctr_2.txt b/security/nss/cmd/bltest/tests/aes_ctr/aes_ctr_2.txt new file mode 100644 index 0000000000..7db8009099 --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/aes_ctr_2.txt @@ -0,0 +1,28 @@ +Test="F.5.5 CTR-AES256.Encrypt" +Type=Encrypt +Key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +Init. Counter=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Block #1={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Output Block=0bdf7df1591716335e9a8b15c860c502 +Plaintext=6bc1bee22e409f96e93d7e117393172a +Ciphertext=601ec313775789a5b7a7f504bbf3d228 +} +Block #2={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff00 +Output Block=5a6e699d536119065433863c8f657b94 +Plaintext=ae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext=f443e3ca4d62b59aca84e990cacaf5c5 +} +Block #3={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff01 +Output Block=1bc12c9c01610d5d0d8bd6a3378eca62 +Plaintext=30c81c46a35ce411e5fbc1191a0a52ef +Ciphertext=2b0930daa23de94ce87017ba2d84988d +} +Block #4={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff02 +Output Block=2956e1c8693536b1bee99c73a31576b6 +Plaintext=f69f2445df4f9b17ad2b417be66c3710 +Ciphertext=dfc9c58db67aada613c2dd08457941a6 +} diff --git a/security/nss/cmd/bltest/tests/aes_ctr/aes_ctr_tests_source.txt b/security/nss/cmd/bltest/tests/aes_ctr/aes_ctr_tests_source.txt new file mode 100644 index 0000000000..bef853b6ed --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/aes_ctr_tests_source.txt @@ -0,0 +1,199 @@ +# +# From NIST Special Publication 800-38A; 2001 Edition ; +# "Recommendation for Block Cipher Modes of Operation: Methods and Techniques" +# Morris Dworkin +# Appendix F Example Vectors for Modes of Operation of the AES +# +# In this appendix, three examples are provided for each of the modes in this recommendation with +# the AES algorithm [2] as the underlying block cipher: one example is given for each of the +# allowed key sizes (128, 192, and 256 bits). Some intermediate results are presented. For the five +# confidentiality modes, examples are provided for both encryption and decryption. Examples are +# provided for 1-bit, 8-bit, and 128 bit CFB. The plaintext for all but two of these examples is +# equivalent to the following string of hexadecimal characters, formatted into four 128 bit blocks: +# +# 6bc1bee22e409f96e93d7e117393172a +# ae2d8a571e03ac9c9eb76fac45af8e51 +# 30c81c46a35ce411e5fbc1191a0a52ef +# f69f2445df4f9b17ad2b417be66c3710. +# +# For the example of 1-bit CFB, the plaintext is the first 16 bits in the above string; for the example +# of 8-bit CFB, the plaintext is the first 18 octets in the above string. All strings are presented in +# hexadecimal notation, except in the example of 1-bit CFB, where the plaintext and ciphertext +# segments are single bits. +# +# +# F.5 CTR Example Vectors + +Test="F.5.1 CTR-AES128.Encrypt" +Type=Encrypt +Key=2b7e151628aed2a6abf7158809cf4f3c +Init. Counter=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Block #1={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Output Block=ec8cdf7398607cb0f2d21675ea9ea1e4 +Plaintext=6bc1bee22e409f96e93d7e117393172a +Ciphertext=874d6191b620e3261bef6864990db6ce +} +Block #2={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff00 +Output Block=362b7c3c6773516318a077d7fc5073ae +Plaintext=ae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext=9806f66b7970fdff8617187bb9fffdff +} +Block #3={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff01 +Output Block=6a2cc3787889374fbeb4c81b17ba6c44 +Plaintext=30c81c46a35ce411e5fbc1191a0a52ef +Ciphertext=5ae4df3edbd5d35e5b4f09020db03eab +} +Block #4={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff02 +Output Block=e89c399ff0f198c6d40a31db156cabfe +Plaintext=f69f2445df4f9b17ad2b417be66c3710 +Ciphertext=1e031dda2fbe03d1792170a0f3009cee +} + +Test="F.5.2 CTR-AES128.Decrypt" +Type=Decrypt +Key=2b7e151628aed2a6abf7158809cf4f3c +Init. Counter=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Block #1={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Output Block=ec8cdf7398607cb0f2d21675ea9ea1e4 +Ciphertext=874d6191b620e3261bef6864990db6ce +Plaintext=6bc1bee22e409f96e93d7e117393172a +Block #2={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff00 +Output Block=362b7c3c6773516318a077d7fc5073ae +Ciphertext=9806f66b7970fdff8617187bb9fffdff +Plaintext=ae2d8a571e03ac9c9eb76fac45af8e51 +} +Block #3={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff01 +Output Block=6a2cc3787889374fbeb4c81b17ba6c44 +Ciphertext=5ae4df3edbd5d35e5b4f09020db03eab +Plaintext=30c81c46a35ce411e5fbc1191a0a52ef +} +Block #4={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff02 +Output Block=e89c399ff0f198c6d40a31db156cabfe +Ciphertext=1e031dda2fbe03d1792170a0f3009cee +Plaintext=f69f2445df4f9b17ad2b417be66c3710 +} + +Test="F.5.3 CTR-AES192.Encrypt" +Type=Encrypt +Key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +Init. Counter=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Block #1={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Output Block=717d2dc639128334a6167a488ded7921 +Plaintext=6bc1bee22e409f96e93d7e117393172a +Ciphertext=1abc932417521ca24f2b0459fe7e6e0b +} +Block #2={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff00 +Output Block=a72eb3bb14a556734b7bad6ab16100c5 +Plaintext=ae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext=090339ec0aa6faefd5ccc2c6f4ce8e94 +} +Block #3={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff01 +Output Block=2efeae2d72b722613446dc7f4c2af918 +Plaintext=30c81c46a35ce411e5fbc1191a0a52ef +Ciphertext=1e36b26bd1ebc670d1bd1d665620abf7 +} +Block #4={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff02 +Output Block=b9e783b30dd7924ff7bc9b97beaa8740 +Plaintext=f69f2445df4f9b17ad2b417be66c3710 +Ciphertext=4f78a7f6d29809585a97daec58c6b050 +} + +Test="F.5.4 CTR-AES192.Decrypt" +Type="Decrypt" +Key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b +Init. Counter=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Block #1={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Output Block=717d2dc639128334a6167a488ded7921 +Ciphertext=1abc932417521ca24f2b0459fe7e6e0b +Plaintext=6bc1bee22e409f96e93d7e117393172a +} +Block #2={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff00 +Output Block=a72eb3bb14a556734b7bad6ab16100c5 +Ciphertext=090339ec0aa6faefd5ccc2c6f4ce8e94 +Plaintext=ae2d8a571e03ac9c9eb76fac45af8e51 +} +Block #3 +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff01 +Output Block=2efeae2d72b722613446dc7f4c2af918 +Ciphertext=1e36b26bd1ebc670d1bd1d665620abf7 +Plaintext=30c81c46a35ce411e5fbc1191a0a52ef +} +Block #4 +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff02 +Output Block=b9e783b30dd7924ff7bc9b97beaa8740 +Ciphertext=4f78a7f6d29809585a97daec58c6b050 +Plaintext=f69f2445df4f9b17ad2b417be66c3710 +} + +Test="F.5.5 CTR-AES256.Encrypt" +Type=Encrypt +Key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +Init. Counter=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Block #1={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Output Block=0bdf7df1591716335e9a8b15c860c502 +Plaintext=6bc1bee22e409f96e93d7e117393172a +Ciphertext=601ec313775789a5b7a7f504bbf3d228 +} +Block #2={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff00 +Output Block=5a6e699d536119065433863c8f657b94 +Plaintext=ae2d8a571e03ac9c9eb76fac45af8e51 +Ciphertext=f443e3ca4d62b59aca84e990cacaf5c5 +} +Block #3={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff01 +Output Block=1bc12c9c01610d5d0d8bd6a3378eca62 +Plaintext=30c81c46a35ce411e5fbc1191a0a52ef +Ciphertext=2b0930daa23de94ce87017ba2d84988d +} +Block #4={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff02 +Output Block=2956e1c8693536b1bee99c73a31576b6 +Plaintext=f69f2445df4f9b17ad2b417be66c3710 +Ciphertext=dfc9c58db67aada613c2dd08457941a6 +} + +Test="F.5.6 CTR-AES256.Decrypt" +Type=Decrypt +Key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4 +Init. Counter=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +Block #1={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff +OutputBlock=0bdf7df1591716335e9a8b15c860c502 +Ciphertext=601ec313775789a5b7a7f504bbf3d228 +Plaintext=6bc1bee22e409f96e93d7e117393172a +} +Block #2={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff00 +OutputBlock=5a6e699d536119065433863c8f657b94 +Ciphertext=f443e3ca4d62b59aca84e990cacaf5c5 +Plaintext=ae2d8a571e03ac9c9eb76fac45af8e51 +} +Block #3={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff01 +OutputBlock=1bc12c9c01610d5d0d8bd6a3378eca62 +Ciphertext=2b0930daa23de94ce87017ba2d84988d +Plaintext=30c81c46a35ce411e5fbc1191a0a52ef +} +Block #4={ +Input Block=f0f1f2f3f4f5f6f7f8f9fafbfcfdff02 +OutputBlock=2956e1c8693536b1bee99c73a31576b6 +Ciphertext=dfc9c58db67aada613c2dd08457941a6 +Plaintext=f69f2445df4f9b17ad2b417be66c3710 +} + diff --git a/security/nss/cmd/bltest/tests/aes_ctr/ciphertext0 b/security/nss/cmd/bltest/tests/aes_ctr/ciphertext0 new file mode 100644 index 0000000000..a3a4ab21d3 --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/ciphertext0 @@ -0,0 +1,2 @@ +h01hkbYg4yYb72hkmQ22zpgG9mt5cP3/hhcYe7n//f9a5N8+29XTXltPCQINsD6r
+HgMd2i++A9F5IXCg8wCc7g==
diff --git a/security/nss/cmd/bltest/tests/aes_ctr/ciphertext1 b/security/nss/cmd/bltest/tests/aes_ctr/ciphertext1 new file mode 100644 index 0000000000..60ed7007a1 --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/ciphertext1 @@ -0,0 +1,2 @@ +GryTJBdSHKJPKwRZ/n5uCwkDOewKpvrv1czCxvTOjpQeNrJr0evGcNG9HWZWIKv3
+T3in9tKYCVhal9rsWMawUA==
diff --git a/security/nss/cmd/bltest/tests/aes_ctr/ciphertext2 b/security/nss/cmd/bltest/tests/aes_ctr/ciphertext2 new file mode 100644 index 0000000000..4c6462f6f1 --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/ciphertext2 @@ -0,0 +1,2 @@ +YB7DE3dXiaW3p/UEu/PSKPRD48pNYrWayoTpkMrK9cUrCTDaoj3pTOhwF7othJiN
+38nFjbZ6raYTwt0IRXlBpg==
diff --git a/security/nss/cmd/bltest/tests/aes_ctr/iv0 b/security/nss/cmd/bltest/tests/aes_ctr/iv0 new file mode 100644 index 0000000000..10ae5e187e --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/iv0 @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/security/nss/cmd/bltest/tests/aes_ctr/iv1 b/security/nss/cmd/bltest/tests/aes_ctr/iv1 new file mode 100644 index 0000000000..10ae5e187e --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/iv1 @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/security/nss/cmd/bltest/tests/aes_ctr/iv2 b/security/nss/cmd/bltest/tests/aes_ctr/iv2 new file mode 100644 index 0000000000..10ae5e187e --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/iv2 @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/security/nss/cmd/bltest/tests/aes_ctr/key0 b/security/nss/cmd/bltest/tests/aes_ctr/key0 new file mode 100644 index 0000000000..efb781943e --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/key0 @@ -0,0 +1 @@ ++~(Ҧ O<
\ No newline at end of file diff --git a/security/nss/cmd/bltest/tests/aes_ctr/key1 b/security/nss/cmd/bltest/tests/aes_ctr/key1 new file mode 100644 index 0000000000..06b40e45dc --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/key1 @@ -0,0 +1 @@ +sdR+ybR,k{
\ No newline at end of file diff --git a/security/nss/cmd/bltest/tests/aes_ctr/key2 b/security/nss/cmd/bltest/tests/aes_ctr/key2 new file mode 100644 index 0000000000..cf22d1a2d3 --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/key2 @@ -0,0 +1 @@ +`=q+s}w5,;a-
\ No newline at end of file diff --git a/security/nss/cmd/bltest/tests/aes_ctr/mktst.sh b/security/nss/cmd/bltest/tests/aes_ctr/mktst.sh new file mode 100644 index 0000000000..b6f2f6f3d0 --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/mktst.sh @@ -0,0 +1,9 @@ +#!/bin/sh +for i in 0 1 2 +do + file="aes_ctr_$i.txt" + grep Key $file | sed -e 's;Key=;;' | hex > key$i + grep "Init. Counter" $file | sed -e 's;Init. Counter=;;' | hex > iv$i + grep "Ciphertext" $file | sed -e 's;Ciphertext=;;' | hex | btoa > ciphertext$i + grep "Plaintext" $file | sed -e 's;Plaintext=;;' | hex > plaintext$i +done diff --git a/security/nss/cmd/bltest/tests/aes_ctr/numtests b/security/nss/cmd/bltest/tests/aes_ctr/numtests new file mode 100644 index 0000000000..00750edc07 --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/numtests @@ -0,0 +1 @@ +3 diff --git a/security/nss/cmd/bltest/tests/aes_ctr/plaintext0 b/security/nss/cmd/bltest/tests/aes_ctr/plaintext0 new file mode 100644 index 0000000000..8ad770497e --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/plaintext0 @@ -0,0 +1,2 @@ +k.@=~s*-WoEQ0F\ +R$EO+A{l7
\ No newline at end of file diff --git a/security/nss/cmd/bltest/tests/aes_ctr/plaintext1 b/security/nss/cmd/bltest/tests/aes_ctr/plaintext1 new file mode 100644 index 0000000000..8ad770497e --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/plaintext1 @@ -0,0 +1,2 @@ +k.@=~s*-WoEQ0F\ +R$EO+A{l7
\ No newline at end of file diff --git a/security/nss/cmd/bltest/tests/aes_ctr/plaintext2 b/security/nss/cmd/bltest/tests/aes_ctr/plaintext2 new file mode 100644 index 0000000000..8ad770497e --- /dev/null +++ b/security/nss/cmd/bltest/tests/aes_ctr/plaintext2 @@ -0,0 +1,2 @@ +k.@=~s*-WoEQ0F\ +R$EO+A{l7
\ No newline at end of file |