diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-16 04:25:41 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-16 04:25:41 -0700 |
commit | aefd08be25c43576f8a0672cdf857390e044d7ea (patch) | |
tree | 98103fa523afdbc5a9cead9e23245d8a7e6122dc /tests/primitives/test_ciphers.py | |
parent | 3be7983bba08821b10b4846f5efa4995020da613 (diff) | |
parent | f54277876b76c867af3ad121bae7581b765fcb7c (diff) | |
download | cryptography-aefd08be25c43576f8a0672cdf857390e044d7ea.tar.gz cryptography-aefd08be25c43576f8a0672cdf857390e044d7ea.tar.bz2 cryptography-aefd08be25c43576f8a0672cdf857390e044d7ea.zip |
Merge pull request #72 from reaperhulk/camellia-support
Camellia support
Diffstat (limited to 'tests/primitives/test_ciphers.py')
-rw-r--r-- | tests/primitives/test_ciphers.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/primitives/test_ciphers.py b/tests/primitives/test_ciphers.py index 5ee9f223..27d35850 100644 --- a/tests/primitives/test_ciphers.py +++ b/tests/primitives/test_ciphers.py @@ -17,7 +17,7 @@ import binascii import pytest -from cryptography.primitives.block.ciphers import AES +from cryptography.primitives.block.ciphers import AES, Camellia class TestAES(object): @@ -33,3 +33,18 @@ class TestAES(object): def test_invalid_key_size(self): with pytest.raises(ValueError): AES(binascii.unhexlify(b"0" * 12)) + + +class TestCamellia(object): + @pytest.mark.parametrize(("key", "keysize"), [ + (b"0" * 32, 128), + (b"0" * 48, 192), + (b"0" * 64, 256), + ]) + def test_key_size(self, key, keysize): + cipher = Camellia(binascii.unhexlify(key)) + assert cipher.key_size == keysize + + def test_invalid_key_size(self): + with pytest.raises(ValueError): + Camellia(binascii.unhexlify(b"0" * 12)) |