From dbfbaccca93b5c62cd02cb26f82f4ad4b9a1a113 Mon Sep 17 00:00:00 2001 From: Carl Beekhuizen Date: Mon, 29 Jun 2020 16:22:09 +0200 Subject: [PATCH] Test key_info != b'' --- .../test_key_derivation/test_tree.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_key_handling/test_key_derivation/test_tree.py b/tests/test_key_handling/test_key_derivation/test_tree.py index d0bb5d3..8bd6491 100644 --- a/tests/test_key_handling/test_key_derivation/test_tree.py +++ b/tests/test_key_handling/test_key_derivation/test_tree.py @@ -26,6 +26,18 @@ def test_hkdf_mod_r(test) -> None: assert bls.KeyGen(seed) == _HKDF_mod_r(IKM=seed) +@pytest.mark.parametrize( + 'seed', + [b'\x00'*32] +) +@pytest.mark.parametrize( + 'key_info', + [b'\x00'*32, b'\x01\x23\x45\x67\x89\xAB\xBC\xDE\xFF', b'\xFF'*16] +) +def test_hkdf_mod_r_key_info(seed: bytes, key_info:bytes) -> None: + assert bls.KeyGen(seed, key_info) == _HKDF_mod_r(IKM=seed, key_info=key_info) + + @pytest.mark.parametrize( 'test', test_vectors