diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-21 19:27:11 -0700 | 
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-21 19:27:11 -0700 | 
| commit | a4ce161dee13466e0e1ff2c100ccbe74c2b271f2 (patch) | |
| tree | e1be75d67e2a4a5a785051a78fa48230275b03fb /tests | |
| parent | 8e251e710964d154c55bfb7a48bb02ea80b318ad (diff) | |
| download | cryptography-a4ce161dee13466e0e1ff2c100ccbe74c2b271f2.tar.gz cryptography-a4ce161dee13466e0e1ff2c100ccbe74c2b271f2.tar.bz2 cryptography-a4ce161dee13466e0e1ff2c100ccbe74c2b271f2.zip  | |
Removed the interleaved ones
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/primitives/test_nist.py | 52 | 
1 files changed, 4 insertions, 48 deletions
diff --git a/tests/primitives/test_nist.py b/tests/primitives/test_nist.py index 38f4d0db..2a32d1bc 100644 --- a/tests/primitives/test_nist.py +++ b/tests/primitives/test_nist.py @@ -26,22 +26,6 @@ from .utils import generate_encrypt_test  from ..utils import load_nist_vectors_from_file -def load_3des_nist_vectors_from_file(path, op): -    vectors = [] -    for vector in load_nist_vectors_from_file(path, op): -        for i in range(1, 4): -            plaintext = vector.get("plaintext{0}".format(i)) -            if plaintext is None: -                plaintext = vector["plaintext"] -            vectors.append({ -                "key": vector["keys"], -                "iv": vector["iv{0}".format(i)], -                "ciphertext": vector["ciphertext{0}".format(i)], -                "plaintext": plaintext, -            }) -    return vectors - -  class TestAES_CBC(object):      test_KAT = generate_encrypt_test(          lambda path: load_nist_vectors_from_file(path, "ENCRYPT"), @@ -183,7 +167,7 @@ class TestAES_CFB(object):  class TestTripleDES_CBC(object): -    test_KAT1 = generate_encrypt_test( +    test_KAT = generate_encrypt_test(          lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),          os.path.join("3DES", "KAT"),          [ @@ -197,21 +181,7 @@ class TestTripleDES_CBC(object):          lambda keys, iv: modes.CBC(binascii.unhexlify(iv)),      ) -    test_KAT2 = generate_encrypt_test( -        lambda path: load_3des_nist_vectors_from_file(path, "ENCRYPT"), -        os.path.join("3DES", "KAT"), -        [ -            "TCBCIpermop.rsp", -            "TCBCIsubtab.rsp", -            "TCBCIvarkey.rsp", -            "TCBCIvartext.rsp", -            "TCBCIinvperm.rsp", -        ], -        lambda key, iv: ciphers.TripleDES(binascii.unhexlify(key)), -        lambda key, iv: modes.CBC(binascii.unhexlify(iv)), -    ) - -    test_MMT1 = generate_encrypt_test( +    test_MMT = generate_encrypt_test(          lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),          os.path.join("3DES", "MMT"),          [ @@ -227,7 +197,7 @@ class TestTripleDES_CBC(object):  class TestTripleDES_OFB(object): -    test_KAT1 = generate_encrypt_test( +    test_KAT = generate_encrypt_test(          lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),          os.path.join("3DES", "KAT"),          [ @@ -241,21 +211,7 @@ class TestTripleDES_OFB(object):          lambda keys, iv: modes.OFB(binascii.unhexlify(iv)),      ) -    test_KAT2 = generate_encrypt_test( -        lambda path: load_3des_nist_vectors_from_file(path, "ENCRYPT"), -        os.path.join("3DES", "KAT"), -        [ -            "TOFBIinvperm.rsp", -            "TOFBIpermop.rsp", -            "TOFBIsubtab.rsp", -            "TOFBIvarkey.rsp", -            "TOFBIvartext.rsp", -        ], -        lambda key, iv: ciphers.TripleDES(binascii.unhexlify(key)), -        lambda key, iv: modes.OFB(binascii.unhexlify(iv)), -    ) - -    test_MMT1 = generate_encrypt_test( +    test_MMT = generate_encrypt_test(          lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),          os.path.join("3DES", "MMT"),          [  | 
