Skip to content

Instantly share code, notes, and snippets.

@mimoo
Created November 16, 2017 13:21
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mimoo/a47ac8ea01b1f8c53d9b7c3d090948fb to your computer and use it in GitHub Desktop.
Save mimoo/a47ac8ea01b1f8c53d9b7c3d090948fb to your computer and use it in GitHub Desktop.
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
@PVS-VENKAT
Copy link

Can I have complete code

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