ecc: Support Montgomery curve for gcry_mpi_ec_mul_point.
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 12 Aug 2014 01:03:39 +0000 (10:03 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 12 Aug 2014 01:03:39 +0000 (10:03 +0900)
commit34bb55ee36df3aca3ebca88f8b61c786cd0c0701
tree03969ce1907ece9b6a4ee461f4b5738fe9d107b0
parente6d354865bf8f3d4c1bb5e8157a76fdd442cff41
ecc: Support Montgomery curve for gcry_mpi_ec_mul_point.

* mpi/ec.c (_gcry_mpi_ec_get_affine): Support Montgomery curve.
(montgomery_ladder): New.
(_gcry_mpi_ec_mul_point): Implemention using montgomery_ladder.
(_gcry_mpi_ec_curve_point): Check x-coordinate is valid.
--

Given Montgomery curve: b * y^2 == x^3 + a * x^2 + x
CTX->A has (a-2)/4 and CTX->B has b^-1

Note that _gcry_mpi_ec_add_points is not supported for this curve.
mpi/ec.c