aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-03-15 12:39:34 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-03-15 12:39:34 -0400
commitafc760d4e243a13b581434b38daa5417bcbe2273 (patch)
tree33dd9a90b435b65a5ff87c47bf452b86e38515c6 /tests/hazmat/primitives
parentb8a9c9e6243716b353b0786dae1e6e7d94f474a8 (diff)
downloadcryptography-afc760d4e243a13b581434b38daa5417bcbe2273.tar.gz
cryptography-afc760d4e243a13b581434b38daa5417bcbe2273.tar.bz2
cryptography-afc760d4e243a13b581434b38daa5417bcbe2273.zip
test IDEA key_size properly
Diffstat (limited to 'tests/hazmat/primitives')
-rw-r--r--tests/hazmat/primitives/test_ciphers.py12
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)