Home GnuPG

ecc: Improve gcry_mpi_ec_curve_point

Description

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.

(cherry picked from commit 7b6c2afd699e889f5f054cc3d202a61bd0ee1dcf)
(cherry picked from commit 846f8fe8b3be6d235592db184361df1bc2b07a8a)

Solved two minor merge conflicts in t-mpi-point

  • Reported-by: Stephan Müller
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Jun 13 2018, 10:14 AM
Parents
rC3600e1224f6c: mpi: New internal function _gcry_mpi_cmpabs.
Branches
Unknown
Tags
Unknown