Example of addition of Twisted Edwards Curve on Sage, Python,..

1.1k Views Asked by At

Can somebody tell me how can I make a example of addition in Twisted Edwards Curve on sage? For example:

$ax^2 + y^2 = 1 + dx^2y^2$

Given the following twisted Edwards curve with $a=3$ and $d=2$:

$3x^2 + y^2 = 1 + 2x^2y^2$

it is possible to add the points $P_1 = (1 , \sqrt{2})$ and$ P_2 = (1 , −\sqrt{2})$ using the formula given above. The result is a point $P_3$ that has coordinates:

x3 = (x1*y2 + y1*x2)/(1 + d*x1*x2*y1*y2) = 0

y3 = (y1*y2 − a*x1*x2)/(1 − d*x1*x2*y1*y2) = −1

1

There are 1 best solutions below

0
On

It seems that long ago someone worked on this.

R.<y1,y2,c,d,x1,x2> = QQ[]
e = 1-d*c^4
S = R.quotient([x1^2+y1^2-c^2*(1+d*x1^2*y1^2), x2^2+y2^2-c^2*(1+d*x2^2*y2^2)])

# the Edwards addition law:
x3 = (x1*y2+y1*x2)/(c*(1+d*x1*x2*y1*y2))
y3 = (y1*y2-x1*x2)/(c*(1-d*x1*x2*y1*y2))

This preprint also seems to indicate it's possible.

  R.<a,d,x,y>=QQ[]
  A=2*(a+d)/(a-d)
  B=4/(a-d)
  S=R.quotient(a*x^2+y^2-(1+d*x^2*y^2))
  u=(1+y)/(1-y)
  v=(1+y)/((1-y)*x)
  0==S((B*v^2-u^3-A*u^2-u).numerator())

But I'm not an expert on this, so I can't verify whether this is what you are looking for. Good luck.