aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_cast5.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat/primitives/test_cast5.py')
-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..21119286 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_CTR = 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))
+ )