aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-11-11 15:39:52 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2013-11-11 15:39:52 -0800
commitcf5fb332af542a6a38da8b8f481a358f32e5e154 (patch)
treec27ba5a354d7016e87cebd3e5eeba387a9e7f0a5
parentd3ce70317016791079212d7256c3b7f195b4a375 (diff)
downloadcryptography-cf5fb332af542a6a38da8b8f481a358f32e5e154.tar.gz
cryptography-cf5fb332af542a6a38da8b8f481a358f32e5e154.tar.bz2
cryptography-cf5fb332af542a6a38da8b8f481a358f32e5e154.zip
Removed some tests that are now duplicates
-rw-r--r--tests/test_utils.py161
1 files changed, 2 insertions, 159 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 457cd869..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
@@ -90,73 +90,7 @@ def test_load_nist_vectors_encrypt():
]
-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) == [
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"f34481ec3cc627bacd5dc3fb08f273e6",
- "ciphertext": b"0336763e966d92595a567cc9ce537f5e",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"9798c4640bad75c7c3227db910174e72",
- "ciphertext": b"a9a1631bf4996954ebc093957b234589",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"f34481ec3cc627bacd5dc3fb08f273e6",
- "ciphertext": b"0336763e966d92595a567cc9ce537f5e",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"9798c4640bad75c7c3227db910174e72",
- "ciphertext": b"a9a1631bf4996954ebc093957b234589",
- },
- ]
-
-
-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")
) == [
@@ -247,97 +181,6 @@ def test_load_nist_vectors_from_file_encrypt():
]
-def test_load_nist_vectors_from_file_decrypt():
- assert load_nist_vectors_from_file(
- os.path.join("ciphers", "AES", "CBC", "CBCGFSbox128.rsp"),
- ) == [
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"f34481ec3cc627bacd5dc3fb08f273e6",
- "ciphertext": b"0336763e966d92595a567cc9ce537f5e",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"9798c4640bad75c7c3227db910174e72",
- "ciphertext": b"a9a1631bf4996954ebc093957b234589",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"96ab5c2ff612d9dfaae8c31f30c42168",
- "ciphertext": b"ff4f8391a6a40ca5b25d23bedd44a597",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"6a118a874519e64e9963798a503f1d35",
- "ciphertext": b"dc43be40be0e53712f7e2bf5ca707209",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"cb9fceec81286ca3e989bd979b0cb284",
- "ciphertext": b"92beedab1895a94faa69b632e5cc47ce",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"b26aeb1874e47ca8358ff22378f09144",
- "ciphertext": b"459264f4798f6a78bacb89c15ed3d601",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"58c8e00b2631686d54eab84b91f0aca1",
- "ciphertext": b"08a4e2efec8a8e3312ca7460b9040bbf",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"f34481ec3cc627bacd5dc3fb08f273e6",
- "ciphertext": b"0336763e966d92595a567cc9ce537f5e",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"9798c4640bad75c7c3227db910174e72",
- "ciphertext": b"a9a1631bf4996954ebc093957b234589",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"96ab5c2ff612d9dfaae8c31f30c42168",
- "ciphertext": b"ff4f8391a6a40ca5b25d23bedd44a597",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"6a118a874519e64e9963798a503f1d35",
- "ciphertext": b"dc43be40be0e53712f7e2bf5ca707209",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"cb9fceec81286ca3e989bd979b0cb284",
- "ciphertext": b"92beedab1895a94faa69b632e5cc47ce",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"b26aeb1874e47ca8358ff22378f09144",
- "ciphertext": b"459264f4798f6a78bacb89c15ed3d601",
- },
- {
- "key": b"00000000000000000000000000000000",
- "iv": b"00000000000000000000000000000000",
- "plaintext": b"58c8e00b2631686d54eab84b91f0aca1",
- "ciphertext": b"08a4e2efec8a8e3312ca7460b9040bbf",
- },
- ]
-
-
def test_load_cryptrec_vectors():
vector_data = textwrap.dedent("""
# Vectors taken from http://info.isl.ntt.co.jp/crypt/eng/camellia/