ecc: Improve Montgomery curve implementation.
authorNIIBE Yutaka <gniibe@fsij.org>
Wed, 19 Nov 2014 06:48:12 +0000 (15:48 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 19 Nov 2014 07:03:51 +0000 (16:03 +0900)
commite6130034506013d6153465a2bedb6fb08a43f74d
treebd1a881ffac12ab5c413c84406d7aa4a9fc07acb
parent95eef21583d8e998efc48f22898c1ae31b77cb48
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
cipher/ecc.c
mpi/ec.c