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)

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

Details

Provenance
wernerAuthored on Jun 5 2018, 2:33 PM
Parents
rC54620a27f450: mpi: New internal function _gcry_mpi_cmpabs.
Branches
Unknown
Tags
Unknown