From ce746936b6c210e602d106cfbf45cf60b408d871 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Mon, 10 Aug 2015 19:09:16 +0900 Subject: ecc: fix Montgomery curve bugs. * cipher/ecc.c (check_secret_key): Y1 should not be NULL when check. (ecc_check_secret_key): Support Montgomery curve. * mpi/ec.c (_gcry_mpi_ec_curve_point): Fix condition. --- mpi/ec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mpi/ec.c') diff --git a/mpi/ec.c b/mpi/ec.c index 0b7c7a71..7266f2a6 100644 --- a/mpi/ec.c +++ b/mpi/ec.c @@ -1470,7 +1470,7 @@ _gcry_mpi_ec_curve_point (gcry_mpi_point_t point, mpi_ec_t ctx) mpi_rshift (p_minus1, p_minus1, 1); ec_powm (w, w, p_minus1, ctx); - res = mpi_cmp_ui (w, 1); + res = !mpi_cmp_ui (w, 1); #undef p_minus1 } break; -- cgit v1.2.1