diff options
author | David Reid <dreid@dreid.org> | 2013-10-29 10:05:47 -0700 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2013-10-29 10:05:47 -0700 |
commit | a9d9922f82d4e7b940679c4b548a4b14d0958ed9 (patch) | |
tree | fe842ec8a06805dd12092721982afdc213072772 /tests/test_utils.py | |
parent | c402f359864f91132a31631c97713fb8293a3bd8 (diff) | |
parent | 50a881572bc7617d4d49c4ae7b200c3bcb7398d9 (diff) | |
download | cryptography-a9d9922f82d4e7b940679c4b548a4b14d0958ed9.tar.gz cryptography-a9d9922f82d4e7b940679c4b548a4b14d0958ed9.tar.bz2 cryptography-a9d9922f82d4e7b940679c4b548a4b14d0958ed9.zip |
Merge pull request #157 from reaperhulk/hmac
HMAC support
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r-- | tests/test_utils.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py index f96cf004..db9ac085 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -411,6 +411,22 @@ def test_load_hash_vectors(): ] +def test_load_hmac_vectors(): + vector_data = textwrap.dedent(""" +Len = 224 +# "Jefe" +Key = 4a656665 +# "what do ya want for nothing?" +Msg = 7768617420646f2079612077616e7420666f72206e6f7468696e673f +MD = 750c783e6ab0b503eaa86e310a5db738 + """).splitlines() + assert load_hash_vectors(vector_data) == [ + (b"7768617420646f2079612077616e7420666f72206e6f7468696e673f", + "750c783e6ab0b503eaa86e310a5db738", + b"4a656665"), + ] + + def test_load_hash_vectors_bad_data(): vector_data = textwrap.dedent(""" # http://tools.ietf.org/html/rfc1321 |