diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-08-09 10:42:44 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-08-09 10:42:44 -0700 |
commit | de9a3ee2d2bea4b862d783c7dbf12cf15aa763a5 (patch) | |
tree | ad7472aa129efa0c8d33c98d8f48a0a31f09c55e /tests/primitives/test_block.py | |
parent | b1895f6f786b8be3bbaedf0b17ef1337b71bcfa1 (diff) | |
download | cryptography-de9a3ee2d2bea4b862d783c7dbf12cf15aa763a5.tar.gz cryptography-de9a3ee2d2bea4b862d783c7dbf12cf15aa763a5.tar.bz2 cryptography-de9a3ee2d2bea4b862d783c7dbf12cf15aa763a5.zip |
Get stuff working on py3k for real
Diffstat (limited to 'tests/primitives/test_block.py')
-rw-r--r-- | tests/primitives/test_block.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/primitives/test_block.py b/tests/primitives/test_block.py index 8c311d5c..5e342d2f 100644 --- a/tests/primitives/test_block.py +++ b/tests/primitives/test_block.py @@ -9,13 +9,17 @@ from ..utils import load_nist_vectors_from_file class TestBlockCipher(object): @pytest.mark.parametrize(("key", "iv", "plaintext", "ciphertext"), - load_nist_vectors_from_file("AES/KAT/CBCGFSbox256.rsp", "ENCRYPT", ["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.encode("ascii"))), - modes.CBC(binascii.unhexlify(iv.encode("ascii")), padding.NoPadding()) + ciphers.AES(binascii.unhexlify(key)), + modes.CBC(binascii.unhexlify(iv), padding.NoPadding()) ) actual_ciphertext = cipher.encrypt(binascii.unhexlify(plaintext)) actual_ciphertext += cipher.finalize() - assert binascii.hexlify(actual_ciphertext) == ciphertext + assert binascii.hexlify(actual_ciphertext) |