aboutsummaryrefslogtreecommitdiffstats
path: root/tests/primitives/test_nist.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-10-21 17:10:12 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2013-10-21 17:10:12 -0700
commitd4728627e1a56d69c4f0df7692ea5abcf8e01d36 (patch)
treee61a0fa03b7606431ca087604db8e31159052582 /tests/primitives/test_nist.py
parent804e98193659ec33e6433e8f4587c99d91a0ea09 (diff)
downloadcryptography-d4728627e1a56d69c4f0df7692ea5abcf8e01d36.tar.gz
cryptography-d4728627e1a56d69c4f0df7692ea5abcf8e01d36.tar.bz2
cryptography-d4728627e1a56d69c4f0df7692ea5abcf8e01d36.zip
fixes
Diffstat (limited to 'tests/primitives/test_nist.py')
-rw-r--r--tests/primitives/test_nist.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/tests/primitives/test_nist.py b/tests/primitives/test_nist.py
index eb0091b6..a460a3f4 100644
--- a/tests/primitives/test_nist.py
+++ b/tests/primitives/test_nist.py
@@ -247,24 +247,28 @@ class TestTripleDES_OFB(object):
lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
os.path.join("3DES", "KAT"),
[
- "tests/primitives/vectors/NIST/3DES/KAT/TOFBpermop.rsp",
- "tests/primitives/vectors/NIST/3DES/KAT/TOFBsubtab.rsp",
- "tests/primitives/vectors/NIST/3DES/KAT/TOFBvarkey.rsp",
- "tests/primitives/vectors/NIST/3DES/KAT/TOFBvartext.rsp",
- "tests/primitives/vectors/NIST/3DES/KAT/TOFBinvperm.rsp",
+ "TOFBpermop.rsp",
+ "TOFBsubtab.rsp",
+ "TOFBvarkey.rsp",
+ "TOFBvartext.rsp",
+ "TOFBinvperm.rsp",
],
+ lambda keys, iv: ciphers.TripleDES(binascii.unhexlify(keys)),
+ lambda keys, iv: modes.CBC(binascii.unhexlify(iv)),
)
test_KAT2 = generate_encrypt_test(
lambda path: load_nist_vectors_from_file(path, "ENCRYPT"),
os.path.join("3DES", "KAT"),
[
- "tests/primitives/vectors/NIST/3DES/KAT/TOFBIinvperm.rsp",
- "tests/primitives/vectors/NIST/3DES/KAT/TOFBIpermop.rsp",
- "tests/primitives/vectors/NIST/3DES/KAT/TOFBIsubtab.rsp",
- "tests/primitives/vectors/NIST/3DES/KAT/TOFBIvarkey.rsp",
- "tests/primitives/vectors/NIST/3DES/KAT/TOFBIvartext.rsp",
+ "TOFBIinvperm.rsp",
+ "TOFBIpermop.rsp",
+ "TOFBIsubtab.rsp",
+ "TOFBIvarkey.rsp",
+ "TOFBIvartext.rsp",
],
+ lambda key, iv: ciphers.TripleDES(binascii.unhexlify(key)),
+ lambda key, iv: modes.CBC(binascii.unhexlify(iv)),
)
test_MMT1 = generate_encrypt_test(