aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-02-16 21:56:31 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-02-16 22:21:38 -0600
commitcf4f633c08f0b02119926b6d5abd624b18c7cf6e (patch)
tree7bcbe67ed78072f0b8170fdfdd04aac8abcb2182 /tests/hazmat/primitives
parent3c93e511eed890d397b21fdb6040d252061268ea (diff)
downloadcryptography-cf4f633c08f0b02119926b6d5abd624b18c7cf6e.tar.gz
cryptography-cf4f633c08f0b02119926b6d5abd624b18c7cf6e.tar.bz2
cryptography-cf4f633c08f0b02119926b6d5abd624b18c7cf6e.zip
add CAST5 CTR support to commoncrypto + tests
Diffstat (limited to 'tests/hazmat/primitives')
-rw-r--r--tests/hazmat/primitives/test_cast5.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_cast5.py b/tests/hazmat/primitives/test_cast5.py
index 682b4496..c617b817 100644
--- a/tests/hazmat/primitives/test_cast5.py
+++ b/tests/hazmat/primitives/test_cast5.py
@@ -90,3 +90,20 @@ class TestCAST5_CFB(object):
lambda key, **kwargs: algorithms.CAST5(binascii.unhexlify((key))),
lambda iv, **kwargs: modes.CFB(binascii.unhexlify(iv))
)
+
+
+@pytest.mark.supported(
+ only_if=lambda backend: backend.cipher_supported(
+ algorithms.CAST5("\x00" * 16), modes.CTR("\x00" * 8)
+ ),
+ skip_message="Does not support CAST5 CTR",
+)
+@pytest.mark.cipher
+class TestCAST5_CTR(object):
+ test_CFB = generate_encrypt_test(
+ load_nist_vectors,
+ os.path.join("ciphers", "CAST5"),
+ ["cast5-ctr.txt"],
+ lambda key, **kwargs: algorithms.CAST5(binascii.unhexlify((key))),
+ lambda iv, **kwargs: modes.CTR(binascii.unhexlify(iv))
+ )