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:
parent
b381a61be8
commit
ddb7a92c15
@ -39,9 +39,6 @@ def hkdf(length=None, derive_from=None, salt=None, context=None):
|
|||||||
if salt == None or len(salt) == 0:
|
if salt == None or len(salt) == 0:
|
||||||
salt = bytes([0] * hash_len)
|
salt = bytes([0] * hash_len)
|
||||||
|
|
||||||
if salt == None:
|
|
||||||
salt = b""
|
|
||||||
|
|
||||||
if context == None:
|
if context == None:
|
||||||
context = b""
|
context = b""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user