diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-21 19:25:54 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-21 19:25:54 -0700 |
commit | 8e251e710964d154c55bfb7a48bb02ea80b318ad (patch) | |
tree | 7e72b2c906ebd7dc1c81be89cd769bf3a0b6dd16 /tests/primitives/test_nist.py | |
parent | 1db93193f43db23090edca9af5bc0da172f30382 (diff) | |
download | cryptography-8e251e710964d154c55bfb7a48bb02ea80b318ad.tar.gz cryptography-8e251e710964d154c55bfb7a48bb02ea80b318ad.tar.bz2 cryptography-8e251e710964d154c55bfb7a48bb02ea80b318ad.zip |
cfb tests
Diffstat (limited to 'tests/primitives/test_nist.py')
-rw-r--r-- | tests/primitives/test_nist.py | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/primitives/test_nist.py b/tests/primitives/test_nist.py index 86ab232c..38f4d0db 100644 --- a/tests/primitives/test_nist.py +++ b/tests/primitives/test_nist.py @@ -271,4 +271,30 @@ class TestTripleDES_OFB(object): class TestTripleDES_CFB(object): - pass + test_KAT = generate_encrypt_test( + lambda path: load_nist_vectors_from_file(path, "ENCRYPT"), + os.path.join("3DES", "KAT"), + [ + "TCFB64invperm.rsp", + "TCFB64permop.rsp", + "TCFB64subtab.rsp", + "TCFB64varkey.rsp", + "TCFB64vartext.rsp", + ], + lambda keys, iv: ciphers.TripleDES(binascii.unhexlify(keys)), + lambda keys, iv: modes.CFB(binascii.unhexlify(iv)), + ) + + test_MMT = generate_encrypt_test( + lambda path: load_nist_vectors_from_file(path, "ENCRYPT"), + os.path.join("3DES", "MMT"), + [ + "TCFB64MMT1.rsp", + "TCFB64MMT2.rsp", + "TCFB64MMT3.rsp", + ], + lambda key1, key2, key3, iv: ( + ciphers.TripleDES(binascii.unhexlify(key1 + key2 + key3)) + ), + lambda key1, key2, key3, iv: modes.CFB(binascii.unhexlify(iv)), + ) |