aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2019-01-17 18:13:11 -0600
committerAlex Gaynor <alex.gaynor@gmail.com>2019-01-17 19:13:11 -0500
commit7f8d9c06ef386a9187aed3eaa4d29a88f11f8c7c (patch)
tree3f92cc92fd9cb681ec004e20a51b1390d73d6016 /tests/hazmat
parenta77994408da328e6b0fba331211be9ad2db5c5b6 (diff)
downloadcryptography-7f8d9c06ef386a9187aed3eaa4d29a88f11f8c7c.tar.gz
cryptography-7f8d9c06ef386a9187aed3eaa4d29a88f11f8c7c.tar.bz2
cryptography-7f8d9c06ef386a9187aed3eaa4d29a88f11f8c7c.zip
support byteslike in KBKDFHMAC (#4711)
Diffstat (limited to 'tests/hazmat')
-rw-r--r--tests/hazmat/primitives/test_kbkdf.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_kbkdf.py b/tests/hazmat/primitives/test_kbkdf.py
index 875cd692..a16f1768 100644
--- a/tests/hazmat/primitives/test_kbkdf.py
+++ b/tests/hazmat/primitives/test_kbkdf.py
@@ -148,3 +148,11 @@ class TestKBKDFHMAC(object):
CounterLocation.BeforeFixed, b'label',
b'context', None, backend=backend)
kdf.derive(u'material')
+
+ def test_buffer_protocol(self, backend):
+ kdf = KBKDFHMAC(hashes.SHA256(), Mode.CounterMode, 10, 4, 4,
+ CounterLocation.BeforeFixed, b'label', b'context',
+ None, backend=backend)
+
+ key = kdf.derive(bytearray(b"material"))
+ assert key == b'\xb7\x01\x05\x98\xf5\x1a\x12L\xc7.'