Created
November 16, 2017 13:21
-
-
Save mimoo/a47ac8ea01b1f8c53d9b7c3d090948fb to your computer and use it in GitHub Desktop.
Curve25519 with sage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can I have complete code