diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-03-15 10:11:41 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-03-15 10:11:41 -0700 |
commit | c914372fa0a5eb946d843558eb182012555f0d89 (patch) | |
tree | 59b862a520c1d94c4fc74adf523d5d8dccab650f | |
parent | 66197c4e26176c3c6c87441617800f5988804699 (diff) | |
parent | afc760d4e243a13b581434b38daa5417bcbe2273 (diff) | |
download | cryptography-c914372fa0a5eb946d843558eb182012555f0d89.tar.gz cryptography-c914372fa0a5eb946d843558eb182012555f0d89.tar.bz2 cryptography-c914372fa0a5eb946d843558eb182012555f0d89.zip |
Merge pull request #801 from reaperhulk/fix-idea-coverage
test IDEA key_size properly
-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 50cadf64..d9f83535 100644 --- a/tests/hazmat/primitives/test_ciphers.py +++ b/tests/hazmat/primitives/test_ciphers.py @@ -18,7 +18,7 @@ import binascii import pytest from cryptography.hazmat.primitives.ciphers.algorithms import ( - AES, Camellia, TripleDES, Blowfish, ARC4, CAST5 + AES, Camellia, TripleDES, Blowfish, ARC4, CAST5, IDEA ) @@ -110,3 +110,13 @@ class TestARC4(object): def test_invalid_key_size(self): with pytest.raises(ValueError): ARC4(binascii.unhexlify(b"0" * 34)) + + +class TestIDEA(object): + def test_key_size(self): + cipher = IDEA(b"\x00" * 16) + assert cipher.key_size == 128 + + def test_invalid_key_size(self): + with pytest.raises(ValueError): + IDEA(b"\x00" * 17) |