I'm working on elliptic curves with SageMath.
I know :
The equation of the curve E defined by y^2 = x^3 + ... :
E = EllipticCurve( GF(K), [m, n] )
the addition of points A and B (A+B) :
(x3;y3)
the substraction of points A and B (A-B) :
(x4;y4)
Here my goal is to find both A (x1;y1)
and B (x2;y2)
.
I obviously understand how to find (A+B) but don't find how to reverse it and get A and B from the addition of A and B and the substraction too.
I know too I can use these kind of function to generate (A+B) coordinates from A and B coordinates. Here I use the slope of the native elliptic curve given by : -x1 -x2 + (y1-y2)^2/(x1-x2)^2
.
E = EllipticCurve( GF(K), [m, n] )
# We know A and B coords
def x3(A, B):
x1, y1 = A.xy()
x2, y2 = B.xy()
return -x1 -x2 + (y1-y2)^2/(x1-x2)^2
x3(A, B)
I guess there should be something to do with it but I really don't see how to begin.
Any help would be very appreciated, thanks !
EDIT :
Having C=A+B and D=A-B, I made a try with C+D :
C = E(x3, y3)
D = E(x4, y4)
Z = C + D
# Z gives : Z(x5, y5)
I get new coordinates Z(x5, y5)
but I could not find both A and B coordinates, which does not fit to what I'd like to do.