From ef2f91e6fe694be91ce3a0a37ebaf58d89bb5985 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Wed, 16 Oct 2013 17:15:04 -0700 Subject: Get the tests running --- tests/primitives/test_nist.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/primitives/test_nist.py b/tests/primitives/test_nist.py index 1c23fca0..8c8a3818 100644 --- a/tests/primitives/test_nist.py +++ b/tests/primitives/test_nist.py @@ -26,6 +26,16 @@ from .utils import generate_encrypt_test from ..utils import load_nist_vectors_from_file +def load_3des_nist_vectors_from_file(path, op): + vectors = load_nist_vectors_from_file(path, op) + for vector in vectors: + vector["ciphertext"] = vector["ciphertext3"] + del vector["ciphertext1"] + del vector["ciphertext2"] + del vector["ciphertext3"] + return vectors + + class TestAES_CBC(object): test_KAT = generate_encrypt_test( lambda path: load_nist_vectors_from_file(path, "ENCRYPT"), @@ -182,7 +192,7 @@ class TestTripleDES_CBC(object): ) test_KAT2 = generate_encrypt_test( - lambda path: load_nist_vectors_from_file(path, "ENCRYPT"), + lambda path: load_3des_nist_vectors_from_file(path, "ENCRYPT"), os.path.join("3DES", "KAT"), [ "TCBCIpermop.rsp", -- cgit v1.2.3