Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Curve25519 with sage
# create curve
ec = EllipticCurve(GF(2**255-19), [0,486662,0,1,0])
base_point = ec.lift_x(9)
point_at_infinity = ec(0)
# all elements of order 4
G4s = ec.lift_x(1, True)
G4 = ec.lift_x(1) # just the first element
# the element of order 2
G2 = G4 + G4
Copy link

PVS-VENKAT commented Feb 11, 2019

Can I have complete code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment