aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_x963kdf.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2019-01-17 15:56:23 -0600
committerAlex Gaynor <alex.gaynor@gmail.com>2019-01-17 16:56:23 -0500
commita77994408da328e6b0fba331211be9ad2db5c5b6 (patch)
tree240940ee473a526d3438514799665dc4463dc0d8 /tests/hazmat/primitives/test_x963kdf.py
parent2b40f493bf6f9eb131b46d7ab582b89033bcda64 (diff)
downloadcryptography-a77994408da328e6b0fba331211be9ad2db5c5b6.tar.gz
cryptography-a77994408da328e6b0fba331211be9ad2db5c5b6.tar.bz2
cryptography-a77994408da328e6b0fba331211be9ad2db5c5b6.zip
support byteslike in ConcatKDF{HMAC,Hash}, Scrypt, and X963KDF (#4709)
* byteslike concatkdf * byteslike scrypt * byteslike x963kdf
Diffstat (limited to 'tests/hazmat/primitives/test_x963kdf.py')
-rw-r--r--tests/hazmat/primitives/test_x963kdf.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_x963kdf.py b/tests/hazmat/primitives/test_x963kdf.py
index d87a46b8..c4dd8925 100644
--- a/tests/hazmat/primitives/test_x963kdf.py
+++ b/tests/hazmat/primitives/test_x963kdf.py
@@ -45,6 +45,17 @@ class TestX963KDF(object):
assert xkdf.derive(key) == derivedkey
+ def test_buffer_protocol(self, backend):
+ key = bytearray(binascii.unhexlify(
+ b"96c05619d56c328ab95fe84b18264b08725b85e33fd34f08"
+ ))
+
+ derivedkey = binascii.unhexlify(b"443024c3dae66b95e6f5670601558f71")
+
+ xkdf = X963KDF(hashes.SHA256(), 16, None, backend)
+
+ assert xkdf.derive(key) == derivedkey
+
def test_verify(self, backend):
key = binascii.unhexlify(
b"22518b10e70f2a3f243810ae3254139efbee04aa57c7af7d"