1
0
Fork 0
mirror of https://github.com/bitcoin/bips.git synced 2025-03-13 19:16:49 +01:00

BIP 341: add missing conversion from bytes to int

This commit is contained in:
Jonas Nick 2022-08-16 15:09:14 +00:00
parent 64aba767e2
commit 2119931f01

View file

@ -182,7 +182,7 @@ def taproot_tweak_pubkey(pubkey, h):
t = int_from_bytes(tagged_hash("TapTweak", pubkey + h)) t = int_from_bytes(tagged_hash("TapTweak", pubkey + h))
if t >= SECP256K1_ORDER: if t >= SECP256K1_ORDER:
raise ValueError raise ValueError
Q = point_add(lift_x(pubkey), point_mul(G, t)) Q = point_add(lift_x(int(pubkey)), point_mul(G, t))
return 0 if has_even_y(Q) else 1, bytes_from_int(x(Q)) return 0 if has_even_y(Q) else 1, bytes_from_int(x(Q))
def taproot_tweak_seckey(seckey0, h): def taproot_tweak_seckey(seckey0, h):