mirror of
https://github.com/bitcoin/bips.git
synced 2026-10-19 19:29:18 +00:00
Merge pull request #2304 from Bruce039/bip375-sync-dleq
bip375: sync vendored DLEQ code with BIP-374
This commit is contained in:
@@ -32,7 +32,7 @@ def dleq_challenge(
|
|||||||
+ m,
|
+ m,
|
||||||
),
|
),
|
||||||
"big",
|
"big",
|
||||||
)
|
) % GE.ORDER
|
||||||
|
|
||||||
|
|
||||||
def dleq_generate_proof(
|
def dleq_generate_proof(
|
||||||
@@ -72,6 +72,8 @@ def dleq_verify_proof(
|
|||||||
return False
|
return False
|
||||||
assert len(proof) == 64
|
assert len(proof) == 64
|
||||||
e = int.from_bytes(proof[:32], "big")
|
e = int.from_bytes(proof[:32], "big")
|
||||||
|
if e >= GE.ORDER:
|
||||||
|
return False
|
||||||
s = int.from_bytes(proof[32:], "big")
|
s = int.from_bytes(proof[32:], "big")
|
||||||
if s >= GE.ORDER:
|
if s >= GE.ORDER:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user