ecc: Improve gcry_mpi_ec_curve_point
authorWerner Koch <wk@gnupg.org>
Tue, 5 Jun 2018 12:33:01 +0000 (14:33 +0200)
committerWerner Koch <wk@gnupg.org>
Wed, 6 Jun 2018 16:59:21 +0000 (18:59 +0200)
commit7b6c2afd699e889f5f054cc3d202a61bd0ee1dcf
treebb5f150fe11d50a24c4aa951352189af7ae575d9
parent6606ae44e0de1069b29dd4215ee9748280940e1b
ecc: Improve gcry_mpi_ec_curve_point

* mpi/ec.c (_gcry_mpi_ec_curve_point): Check range of coordinates.
* tests/t-mpi-point.c (point_on_curve): New.
--

Due to the conversion to affine coordinates we didn't detected points
with values >= P.  The solution here might not be the best according
to the NIST standard (it is done there at an earlier opportunity) but
it reliably detects points we do not expect to receive.

The new test vectors have been compared against gnutls/nettle.

Reported-by: Stephan Müller
Signed-off-by: Werner Koch <wk@gnupg.org>
mpi/ec.c
tests/t-mpi-point.c