From 7f8d9c06ef386a9187aed3eaa4d29a88f11f8c7c Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 17 Jan 2019 18:13:11 -0600 Subject: support byteslike in KBKDFHMAC (#4711) --- tests/hazmat/primitives/test_kbkdf.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') 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.' -- cgit v1.2.3