Got stuck with Ed25519
wk at gnupg.org
Tue Sep 10 09:43:19 CEST 2013
I am trying to implement the ED25519 signature scheme (as a step to
Curve25519 world domination ;-). The plan is to have a generic
implementation for Twisted Edwards curves and then later optimize it.
Thus the PD code by DJB et al. is not yet usable. However, I get stuck
with the implementation and would appreciate some help.
I have attached a patch against current master (90fdf25) which implements
the math. However, something is badly wrong. Output of the test
$ ./t-mpi-point --verbose
t-mpi-point: checking point setting functions
t-mpi-point: checking context functions
t-mpi-point: checking standard curves
t-mpi-point: checking sample public key
t-mpi-point: checking basic math functions for EC
t-mpi-point: checking basic math functions for EC (variant)
t-mpi-point: checking basic Twisted Edwards math
t-mpi-point: twistededwards_math: failed assertion: nG == (0,1)
The expected output is .x=0,.y=1. I really don't understand what's
going on wrong here. If I would use
gcry_mpi_div (x, NULL, point->x, point->z, -1);
gcry_mpi_div (y, NULL, point->y, point->z, -1);
in mpi/ec.c:_gcry_mpi_ec_get_affine this works but that is of course
wrong, because modular arithmetic is needed. It works only in this
special case. The addition on Twisted Edwards curve does not need any
special treatment for the neutral element, thus in theory the code
should be correct.
If someone could point me to another generic implementation for Edwards
curves this might also be helpful.
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 18597 bytes
Desc: not available
More information about the Gcrypt-devel