aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_ciphers.py
diff options
context:
space:
mode:
authorDavid Reid <dreid@dreid.org>2014-04-12 09:01:21 -0400
committerDavid Reid <dreid@dreid.org>2014-04-12 09:01:21 -0400
commit762f660a93921abfbc82faa3a02a385810dde9dd (patch)
treefc47c36b0ab7ea46f9adfa6fcf6208c6d566e126 /tests/hazmat/primitives/test_ciphers.py
parentec53c7158e6b879f0706ef0360556c6a0e768fa4 (diff)
parent7e914c90611a2fc6c62d4697d40d0215dc33ce57 (diff)
downloadcryptography-762f660a93921abfbc82faa3a02a385810dde9dd.tar.gz
cryptography-762f660a93921abfbc82faa3a02a385810dde9dd.tar.bz2
cryptography-762f660a93921abfbc82faa3a02a385810dde9dd.zip
Merge pull request #908 from reaperhulk/seed-support
SEED support
Diffstat (limited to 'tests/hazmat/primitives/test_ciphers.py')
-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 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()