mirror of
https://github.com/bitcoin/bips.git
synced 2026-09-21 19:04:28 +00:00
BIP-374: treat challenge hash result e as scalar, bump to version 0.3.0
Note that the purpose of this change is primarily to improve clarity for implementers and consistency with existing BIPs like BIP-340 and BIP-327. Under the assumption that reaching a challenge hash with `e >= n` is negligible, the newly introduced test vectors in the next commit would also fail without the new rejection branch.
This commit is contained in:
@@ -36,7 +36,7 @@ def dleq_challenge(
|
||||
+ m,
|
||||
),
|
||||
"big",
|
||||
)
|
||||
) % GE.ORDER
|
||||
|
||||
|
||||
def dleq_generate_proof(
|
||||
@@ -76,6 +76,8 @@ def dleq_verify_proof(
|
||||
return False
|
||||
assert len(proof) == 64
|
||||
e = int.from_bytes(proof[:32], "big")
|
||||
if e >= GE.ORDER:
|
||||
return False
|
||||
s = int.from_bytes(proof[32:], "big")
|
||||
if s >= GE.ORDER:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user