From e6130034506013d6153465a2bedb6fb08a43f74d Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 19 Nov 2014 15:48:12 +0900 Subject: ecc: Improve Montgomery curve implementation. * cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Support MPI_EC_MONTGOMERY. * cipher/ecc.c (test_ecdh_only_keys): New. (nist_generate_key): Call test_ecdh_only_keys for MPI_EC_MONTGOMERY. (check_secret_key): Handle Montgomery curve of x-coordinate only. * mpi/ec.c (_gcry_mpi_ec_mul_point): Resize points before the loop. Simplify, using pointers of Q1, Q2, PRD, and SUM. -- --- cipher/ecc-curves.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cipher/ecc-curves.c') diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c index fd47c1dc..9975bb42 100644 --- a/cipher/ecc-curves.c +++ b/cipher/ecc-curves.c @@ -530,9 +530,8 @@ _gcry_ecc_fill_in_curve (unsigned int nbits, const char *name, { case MPI_EC_WEIERSTRASS: case MPI_EC_EDWARDS: - break; case MPI_EC_MONTGOMERY: - return GPG_ERR_NOT_SUPPORTED; + break; default: return GPG_ERR_BUG; } -- cgit v1.2.1