Skip to content

Commit

Permalink
Fix G.y parity in sage code
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa committed Oct 20, 2021
1 parent 9526874 commit 044d956
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sage/secp256k1_params.sage
Expand Up @@ -9,6 +9,9 @@ C = EllipticCurve([F(0), F(7)])

"""Base point of secp256k1"""
G = C.lift_x(0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798)
if int(G[1]) & 1:
# G.y is even
G = -G

"""Prime order of secp256k1"""
N = C.order()
Expand Down

0 comments on commit 044d956

Please sign in to comment.