Ask Your Question
1

ed25519 elliptic curve

asked 2018-02-19 21:48:55 +0100

Frans Lundberg gravatar image

updated 2018-12-16 18:41:32 +0100

FrédéricC gravatar image

Is is possible to represent the elliptic curve used by the ed25519 signature scheme in Sage? How?

EllipticCurve takes parameters for the long Weierstrass form of an Elliptic curve. But I don't know how to convert the ed25519 curve to that form, if it even is possible.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2018-02-20 05:37:28 +0100

Travis gravatar image

Did you mean Curve25519? It looks like the standard way to write Curve 25519 is already in long Weirstrass form (see the wiki site: wikipedia.org/wiki/Curve25519). In Sage we can build this as:

E = EllipticCurve(GF(2^255-19),[0,486662,0,1,0])

I verified that the trace matched that listed on the safecurves site. Namely,

E.trace_of_frobenius() == -221938542218978828286815502327069187962

The curve used in the signature scheme Ed25519 (as explained on wikipedia.org/wiki/EdDSA#Ed25519 ), is birationaly equivalent to Curve25519, which is what we constructed above. A change of variables is given in the wikipedia entry.

I hope this helps,

Travis

edit flag offensive delete link more

Comments

Did you mean Curve25519?

No. I mean the curve used by ed25519 signature scheme. It is birationally equivalent to E = EllipticCurve(GF(2^255-19),[0,486662,0,1,0]), but I wish to define a Sage EllipticCurve for the ed25519 curve:

  -x^2 + y^2 = 1 - (121665/121666) x^2 y^2

I wish I could express, for example, Diffie-Hellman, with simple Sage code like:

  E = EllipticCurve(???)
  P = ... base point...
  a, b = random field elements
  A = a*P
  B = b*P
  a*B == b*A  # Returns True

I would like to experiment with ed25519 signatures, including distributed signing. I need Sage to generate the correct test data.

I suppose I could convert coordinates in x15519 to ed25519 coordinates as Travis says. However, I don't want to loose nice Sage syntax.

Frans Lundberg gravatar imageFrans Lundberg ( 2018-02-20 12:56:14 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-02-19 21:48:55 +0100

Seen: 1,648 times

Last updated: Feb 19 '18