Write out the initial test cases, they don't even fail properly because the 3DES cases look different from the AES ones
diff --git a/tests/primitives/test_nist.py b/tests/primitives/test_nist.py
index 65d130a..50aee31 100644
--- a/tests/primitives/test_nist.py
+++ b/tests/primitives/test_nist.py
@@ -78,3 +78,43 @@
actual_ciphertext = cipher.encrypt(binascii.unhexlify(plaintext))
actual_ciphertext += cipher.finalize()
assert binascii.hexlify(actual_ciphertext) == ciphertext
+
+
+class TestTripleDES_CBC(object):
+ @parameterize_encrypt_test("3DES", "KAT", [
+ "TCBCIinvperm.rsp",
+ "TCBCIpermop.rsp",
+ "TCBCIsubtab.rsp",
+ "TCBCIvarkey.rsp",
+ "TCBCIvartext.rsp",
+ "TCBCinvperm.rsp",
+ "TCBCpermop.rsp",
+ "TCBCsubtab.rsp",
+ "TCBCvarkey.rsp",
+ "TCBCvartext.rsp",
+ ])
+ def test_KAT(self, key, iv, plaintext, ciphertext):
+ cipher = BlockCipher(
+ ciphers.TripleDES(binascii.unhexlify(key)),
+ modes.CBC(binascii.unhexlify(iv))
+ )
+ actual_ciphertext = cipher.encrypt(binascii.unhexlify(plaintext))
+ actual_ciphertext += cipher.finalize()
+ assert binascii.hexlify(actual_ciphertext) == ciphertext
+
+ @parameterize_encrypt_test("3DES", "MMT", [
+ "TCBCIMMT1.rsp",
+ "TCBCIMMT2.rsp",
+ "TCBCIMMT3.rsp",
+ "TCBCMMT1.rsp",
+ "TCBCMMT2.rsp",
+ "TCBCMMT3.rsp",
+ ])
+ def test_MMT(self, key, iv, plaintext, ciphertext):
+ cipher = BlockCipher(
+ ciphers.TripleDES(binascii.unhexlify(key)),
+ modes.CBC(binascii.unhexlify(iv))
+ )
+ actual_ciphertext = cipher.encrypt(binascii.unhexlify(plaintext))
+ actual_ciphertext += cipher.finalize()
+ assert binascii.hexlify(actual_ciphertext) == ciphertext