1
0
mirror of https://github.com/bitcoin/bips.git synced 2026-02-23 15:38:22 +00:00

bip-0327: 1.0.1 -> 1.0.2

(cherry picked from commit 4f2e6e7ffbd2fdc095ab8d59827be9da18b790be)
This commit is contained in:
Jonas Nick
2024-07-22 14:14:33 +00:00
committed by siv2r
parent 0d79b5eeb5
commit 26bb1d8ea3
2 changed files with 5 additions and 3 deletions

View File

@@ -367,7 +367,7 @@ def sign(secnonce: bytearray, sk: bytes, session_ctx: SessionContext) -> bytes:
raise ValueError('secret key value is out of range.')
P = point_mul(G, d_)
assert P is not None
pk = PlainPk(cbytes(P))
pk = cbytes(P)
if not pk == secnonce[64:97]:
raise ValueError('Public key does not match nonce_gen argument')
a = get_session_key_agg_coeff(session_ctx, P)
@@ -430,7 +430,7 @@ def partial_sig_verify(psig: bytes, pubnonces: List[bytes], pubkeys: List[PlainP
session_ctx = SessionContext(aggnonce, pubkeys, tweaks, is_xonly, msg)
return partial_sig_verify_internal(psig, pubnonces[i], pubkeys[i], session_ctx)
def partial_sig_verify_internal(psig: bytes, pubnonce: bytes, pk: PlainPk, session_ctx: SessionContext) -> bool:
def partial_sig_verify_internal(psig: bytes, pubnonce: bytes, pk: bytes, session_ctx: SessionContext) -> bool:
(Q, gacc, _, b, R, e) = get_session_values(session_ctx)
s = int_from_bytes(psig)
if s >= n: