I'm working on a crypto library, and I need to perform some tests for the implementation of:
- Point Addition.
- Point Subtraction.
- Point Doubling.
- Scalar Mul Point.
The operations are performed on Twisted Edwards Extended Coordinates so (X, Y, Z, T).
The problem is that apart of the Identity point which is: (0,1,1,0)
, It's being hard for me to get other points to test the operations.
So being the Eq of the curve: -x²+y²=1-$
\frac{86649}{86650}$x²y²
over the Finite Field modulo P = 2^252 + 27742317777372353535851937790883648493
.
(So
a = -1
andd = 86649/86650 (mod P)
.
My idea was to pick random X
values and get it's corresponding Y
values. Then find T
is trivial. But the problem is that I end up with things like:
For whatever X,
Y = +- (sqrt(-x^2 -1)) / (sqrt(d*x^2 -1))
My question is if this approach of getting random points over the curve is correct. And in that case: Since I cannot get decimal values over a Finite Field, how should I treat the sqrts?
With division we know that
a/b
= a * inverse_mod(b, P).
But what about the SQRT operator? How can I deal with it?