Fix syntax

This commit is contained in:
arthurfranca 2024-02-05 14:52:18 -03:00
parent d5d5e1d199
commit 163e09bfeb

2
44.md
View File

@ -223,7 +223,7 @@ def hmac_aad(key, message, aad):
# Calculates long-term key between users A and B: `get_key(Apriv, Bpub) == get_key(Bpriv, Apub)`
def get_conversation_key(private_key_a, public_key_b, salt):
if (!salt) salt = utf8_encode('nip44-v2')
if not salt: salt = utf8_encode('nip44-v2')
if len(salt) > 32: raise Exception('invalid salt length')
shared_x = secp256k1_ecdh(private_key_a, public_key_b)
return hkdf_extract(IKM=shared_x, salt)