hkdf: Remove duplicate check if the salt is None

The second if isn't needed since we initialize the salt with zeroes
earlier. If instead we meant to pass an empty bytes class to the HMAC
implementation, the end result would be the same, since it's gonna get
padded with zeroes in the HMAC code.
This commit is contained in:
Dionysis Grigoropoulos 2023-03-01 16:22:51 +02:00
parent b381a61be8
commit ddb7a92c15
1 changed files with 0 additions and 3 deletions

View File

@ -39,9 +39,6 @@ def hkdf(length=None, derive_from=None, salt=None, context=None):
if salt == None or len(salt) == 0:
salt = bytes([0] * hash_len)
if salt == None:
salt = b""
if context == None:
context = b""