diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-06-27 10:33:56 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-06-27 10:33:56 -0400 |
commit | 1c453c25e35ba564746e599f64a389bb77263799 (patch) | |
tree | 1a39c75a462dc93b60ee9ab078a3f02ca04a62b6 /tests/hazmat/primitives | |
parent | e4f01bedb4369e4b83c8b77bb128f0c94b0881fb (diff) | |
download | cryptography-1c453c25e35ba564746e599f64a389bb77263799.tar.gz cryptography-1c453c25e35ba564746e599f64a389bb77263799.tar.bz2 cryptography-1c453c25e35ba564746e599f64a389bb77263799.zip |
More branch coverage improvements. By virtue of reorganization and a new test
Diffstat (limited to 'tests/hazmat/primitives')
-rw-r--r-- | tests/hazmat/primitives/test_concatkdf.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_concatkdf.py b/tests/hazmat/primitives/test_concatkdf.py index 27e5460e..aa568c1f 100644 --- a/tests/hazmat/primitives/test_concatkdf.py +++ b/tests/hazmat/primitives/test_concatkdf.py @@ -158,6 +158,27 @@ class TestConcatKDFHMAC(object): assert ckdf.derive(prk) == okm + def test_derive_explicit_salt(self, backend): + prk = binascii.unhexlify( + b"013951627c1dea63ea2d7702dd24e963eef5faac6b4af7e4" + b"b831cde499dff1ce45f6179f741c728aa733583b02409208" + b"8f0af7fce1d045edbc5790931e8d5ca79c73" + ) + + okm = binascii.unhexlify(b"64ce901db10d558661f10b6836a122a7" + b"605323ce2f39bf27eaaac8b34cf89f2f") + + oinfo = binascii.unhexlify( + b"a1b2c3d4e55e600be5f367e0e8a465f4bf2704db00c9325c" + b"9fbd216d12b49160b2ae5157650f43415653696421e68e" + ) + + ckdf = ConcatKDFHMAC( + hashes.SHA512(), 32, b"\x00" * 128, oinfo, backend + ) + + assert ckdf.derive(prk) == okm + def test_verify(self, backend): prk = binascii.unhexlify( b"013951627c1dea63ea2d7702dd24e963eef5faac6b4af7e4" |