mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-01-28 04:54:21 +01:00
test dhke
This commit is contained in:
@@ -44,9 +44,12 @@ def hash_to_curve(message: bytes):
|
||||
return point
|
||||
|
||||
|
||||
def step1_alice(secret_msg: str):
|
||||
def step1_alice(secret_msg: str, blinding_factor: bytes = None):
|
||||
Y = hash_to_curve(secret_msg.encode("utf-8"))
|
||||
r = PrivateKey()
|
||||
if blinding_factor:
|
||||
r = PrivateKey(privkey=blinding_factor, raw=True)
|
||||
else:
|
||||
r = PrivateKey()
|
||||
B_ = Y + r.pubkey
|
||||
return B_, r
|
||||
|
||||
|
||||
Reference in New Issue
Block a user