diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-08-08 22:08:26 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-08-08 22:08:26 -0700 |
commit | cd95f3c0355d684082fdc8ad38a00850259c517d (patch) | |
tree | 90be76af4ecfdcdcf6fcd9fcf1709a58f1b21ab6 | |
parent | 3c6da26a73d02f74e731badbd878fbbfb62c4289 (diff) | |
download | cryptography-cd95f3c0355d684082fdc8ad38a00850259c517d.tar.gz cryptography-cd95f3c0355d684082fdc8ad38a00850259c517d.tar.bz2 cryptography-cd95f3c0355d684082fdc8ad38a00850259c517d.zip |
Tests now running against the NIST vectors
-rw-r--r-- | tests/primitives/__init__.py | 0 | ||||
-rw-r--r-- | tests/primitives/test_block.py | 13 |
2 files changed, 5 insertions, 8 deletions
diff --git a/tests/primitives/__init__.py b/tests/primitives/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/primitives/__init__.py diff --git a/tests/primitives/test_block.py b/tests/primitives/test_block.py index e22d05ef..b976e217 100644 --- a/tests/primitives/test_block.py +++ b/tests/primitives/test_block.py @@ -4,16 +4,13 @@ import pytest from cryptography.primitives.block import BlockCipher, ciphers, modes, padding +from ..utils import load_nist_vectors_from_file + class TestBlockCipher(object): - @pytest.mark.parametrize(("key", "iv", "plaintext", "ciphertext"), [ - ( - b"9dc2c84a37850c11699818605f47958c", - b"256953b2feab2a04ae0180d8335bbed6", - b"2e586692e647f5028ec6fa47a55a2aab", - b"1b1ebd1fc45ec43037fd4844241a437f" - ), - ]) + @pytest.mark.parametrize(("key", "iv", "plaintext", "ciphertext"), + load_nist_vectors_from_file("AES/KAT/CBCGFSbox256.rsp", "ENCRYPT", ["key", "iv", "plaintext", "ciphertext"]) + ) def test_aes_cbc_nopadding(self, key, iv, plaintext, ciphertext): cipher = BlockCipher( ciphers.AES(binascii.unhexlify(key)), |