aboutsummaryrefslogtreecommitdiffstats
path: root/tests/primitives/test_block.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/primitives/test_block.py')
-rw-r--r--tests/primitives/test_block.py12
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)