Fix G.y parity in sage code

This commit is contained in:
Pieter Wuille 2021-10-20 10:14:13 -04:00
parent 9526874d14
commit 044d956305
1 changed files with 3 additions and 0 deletions

View File

@ -9,6 +9,9 @@ C = EllipticCurve([F(0), F(7)])
"""Base point of secp256k1""" """Base point of secp256k1"""
G = C.lift_x(0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798) G = C.lift_x(0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798)
if int(G[1]) & 1:
# G.y is even
G = -G
"""Prime order of secp256k1""" """Prime order of secp256k1"""
N = C.order() N = C.order()