From 7e914c90611a2fc6c62d4697d40d0215dc33ce57 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 9 Apr 2014 09:12:29 -0500 Subject: add SEED docs, tests, small fixes --- tests/hazmat/primitives/test_ciphers.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests/hazmat/primitives/test_ciphers.py') diff --git a/tests/hazmat/primitives/test_ciphers.py b/tests/hazmat/primitives/test_ciphers.py index 9f8123eb..99ef043a 100644 --- a/tests/hazmat/primitives/test_ciphers.py +++ b/tests/hazmat/primitives/test_ciphers.py @@ -20,7 +20,7 @@ import pytest from cryptography.exceptions import _Reasons from cryptography.hazmat.primitives import ciphers from cryptography.hazmat.primitives.ciphers.algorithms import ( - AES, ARC4, Blowfish, CAST5, Camellia, IDEA, TripleDES + AES, ARC4, Blowfish, CAST5, Camellia, IDEA, SEED, TripleDES ) from cryptography.hazmat.primitives.ciphers.modes import ECB @@ -127,6 +127,16 @@ class TestIDEA(object): IDEA(b"\x00" * 17) +class TestSEED(object): + def test_key_size(self): + cipher = SEED(b"\x00" * 16) + assert cipher.key_size == 128 + + def test_invalid_key_size(self): + with pytest.raises(ValueError): + SEED(b"\x00" * 17) + + def test_invalid_backend(): pretend_backend = object() -- cgit v1.2.3