diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-01-27 10:08:35 -0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-01-27 10:08:35 -0800 |
commit | 36e651c00aaa8f9016aed73bf30061fbd1bdf6e7 (patch) | |
tree | 43a719e4fd31ad54a7fa4ef37da3cdfbc42765a9 /tests/hazmat | |
parent | 6b4f32311e038a60ed496e2f44558b8803f9e033 (diff) | |
download | cryptography-36e651c00aaa8f9016aed73bf30061fbd1bdf6e7.tar.gz cryptography-36e651c00aaa8f9016aed73bf30061fbd1bdf6e7.tar.bz2 cryptography-36e651c00aaa8f9016aed73bf30061fbd1bdf6e7.zip |
Represent the hash vectors more cleanly
Diffstat (limited to 'tests/hazmat')
-rw-r--r-- | tests/hazmat/primitives/utils.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py index 6ecc70ff..f27afe41 100644 --- a/tests/hazmat/primitives/utils.py +++ b/tests/hazmat/primitives/utils.py @@ -141,8 +141,7 @@ def generate_hash_test(param_loader, path, file_names, hash_cls): def hash_test(backend, algorithm, params): - msg = params[0] - md = params[1] + msg, md = params m = hashes.Hash(algorithm, backend=backend) m.update(binascii.unhexlify(msg)) expected_md = md.replace(" ", "").lower().encode("ascii") @@ -206,9 +205,7 @@ def generate_hmac_test(param_loader, path, file_names, algorithm): def hmac_test(backend, algorithm, params): - msg = params[0] - md = params[1] - key = params[2] + msg, md, key = params h = hmac.HMAC(binascii.unhexlify(key), algorithm, backend=backend) h.update(binascii.unhexlify(msg)) assert h.finalize() == binascii.unhexlify(md.encode("ascii")) |