1
0
Fork 0
mirror of https://github.com/bitcoin/bips.git synced 2025-02-26 08:59:43 +01:00

Fix point_from_bytes in bip-schnorr reference implementation

This commit is contained in:
Jonas Nick 2019-07-06 14:11:52 +00:00
parent 084dee847d
commit 1faf705388

View file

@ -34,7 +34,7 @@ def bytes_from_point(P):
return (b'\x03' if P[1] & 1 else b'\x02') + bytes_from_int(P[0]) return (b'\x03' if P[1] & 1 else b'\x02') + bytes_from_int(P[0])
def point_from_bytes(b): def point_from_bytes(b):
if b[0] in [b'\x02', b'\x03']: if b[0:1] in [b'\x02', b'\x03']:
odd = b[0] - 0x02 odd = b[0] - 0x02
else: else:
return None return None