diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-04-09 09:12:29 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-04-09 11:15:15 -0500 |
commit | 7e914c90611a2fc6c62d4697d40d0215dc33ce57 (patch) | |
tree | f310c9e42f64a177595d9add0f5409513af4982f /tests/hazmat/primitives/test_ciphers.py | |
parent | 65a890d0f66bc611cb1ff1be979345c4933160d8 (diff) | |
download | cryptography-7e914c90611a2fc6c62d4697d40d0215dc33ce57.tar.gz cryptography-7e914c90611a2fc6c62d4697d40d0215dc33ce57.tar.bz2 cryptography-7e914c90611a2fc6c62d4697d40d0215dc33ce57.zip |
add SEED docs, tests, small fixes
Diffstat (limited to 'tests/hazmat/primitives/test_ciphers.py')
-rw-r--r-- | tests/hazmat/primitives/test_ciphers.py | 12 |
1 files changed, 11 insertions, 1 deletions
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() |