From de9a3ee2d2bea4b862d783c7dbf12cf15aa763a5 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 9 Aug 2013 10:42:44 -0700 Subject: Get stuff working on py3k for real --- tests/primitives/test_block.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/primitives') 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) -- cgit v1.2.3