diff options
author | David Reid <dreid@dreid.org> | 2014-01-27 11:07:02 -0800 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2014-01-27 11:07:02 -0800 |
commit | 904cd21bb5bff75b358d0fd7605acd374a2ad341 (patch) | |
tree | 43a719e4fd31ad54a7fa4ef37da3cdfbc42765a9 /tests/hazmat/primitives/utils.py | |
parent | 6b4f32311e038a60ed496e2f44558b8803f9e033 (diff) | |
parent | 36e651c00aaa8f9016aed73bf30061fbd1bdf6e7 (diff) | |
download | cryptography-904cd21bb5bff75b358d0fd7605acd374a2ad341.tar.gz cryptography-904cd21bb5bff75b358d0fd7605acd374a2ad341.tar.bz2 cryptography-904cd21bb5bff75b358d0fd7605acd374a2ad341.zip |
Merge pull request #512 from alex/hash-cleanup
Represent the hash vectors more cleanly
Diffstat (limited to 'tests/hazmat/primitives/utils.py')
-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")) |