aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r--tests/test_utils.py59
1 files changed, 4 insertions, 55 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 0692c8d1..435690b7 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -24,7 +24,7 @@ from .utils import (
)
-def test_load_nist_vectors_encrypt():
+def test_load_nist_vectors():
vector_data = textwrap.dedent("""
# CAVS 11.1
# Config info for aes_values
@@ -62,7 +62,7 @@ def test_load_nist_vectors_encrypt():
PLAINTEXT = 9798c4640bad75c7c3227db910174e72
""").splitlines()
- assert load_nist_vectors(vector_data, "ENCRYPT") == [
+ assert load_nist_vectors(vector_data) == [
{
"key": b"00000000000000000000000000000000",
"iv": b"00000000000000000000000000000000",
@@ -75,48 +75,6 @@ def test_load_nist_vectors_encrypt():
"plaintext": b"9798c4640bad75c7c3227db910174e72",
"ciphertext": b"a9a1631bf4996954ebc093957b234589",
},
- ]
-
-
-def test_load_nist_vectors_decrypt():
- vector_data = textwrap.dedent("""
- # CAVS 11.1
- # Config info for aes_values
- # AESVS GFSbox test data for CBC
- # State : Encrypt and Decrypt
- # Key Length : 128
- # Generated on Fri Apr 22 15:11:33 2011
-
- [ENCRYPT]
-
- COUNT = 0
- KEY = 00000000000000000000000000000000
- IV = 00000000000000000000000000000000
- PLAINTEXT = f34481ec3cc627bacd5dc3fb08f273e6
- CIPHERTEXT = 0336763e966d92595a567cc9ce537f5e
-
- COUNT = 1
- KEY = 00000000000000000000000000000000
- IV = 00000000000000000000000000000000
- PLAINTEXT = 9798c4640bad75c7c3227db910174e72
- CIPHERTEXT = a9a1631bf4996954ebc093957b234589
-
- [DECRYPT]
-
- COUNT = 0
- KEY = 00000000000000000000000000000000
- IV = 00000000000000000000000000000000
- CIPHERTEXT = 0336763e966d92595a567cc9ce537f5e
- PLAINTEXT = f34481ec3cc627bacd5dc3fb08f273e6
-
- COUNT = 1
- KEY = 00000000000000000000000000000000
- IV = 00000000000000000000000000000000
- CIPHERTEXT = a9a1631bf4996954ebc093957b234589
- PLAINTEXT = 9798c4640bad75c7c3227db910174e72
- """).splitlines()
-
- assert load_nist_vectors(vector_data, "DECRYPT") == [
{
"key": b"00000000000000000000000000000000",
"iv": b"00000000000000000000000000000000",
@@ -132,10 +90,9 @@ def test_load_nist_vectors_decrypt():
]
-def test_load_nist_vectors_from_file_encrypt():
+def test_load_nist_vectors_from_file():
assert load_nist_vectors_from_file(
- os.path.join("ciphers", "AES", "CBC", "CBCGFSbox128.rsp"),
- "ENCRYPT"
+ os.path.join("ciphers", "AES", "CBC", "CBCGFSbox128.rsp")
) == [
{
"key": b"00000000000000000000000000000000",
@@ -179,14 +136,6 @@ def test_load_nist_vectors_from_file_encrypt():
"plaintext": b"58c8e00b2631686d54eab84b91f0aca1",
"ciphertext": b"08a4e2efec8a8e3312ca7460b9040bbf",
},
- ]
-
-
-def test_load_nist_vectors_from_file_decrypt():
- assert load_nist_vectors_from_file(
- os.path.join("ciphers", "AES", "CBC", "CBCGFSbox128.rsp"),
- "DECRYPT",
- ) == [
{
"key": b"00000000000000000000000000000000",
"iv": b"00000000000000000000000000000000",