summaryrefslogtreecommitdiff
path: root/cipher/ecc.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2019-10-08 15:24:58 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2019-10-08 15:24:58 +0900
commit254c5279058f0aea2d3568d6e756002242e82f8f (patch)
tree07a85d1a0384b6770a215647651eef66e62ef6be /cipher/ecc.c
parent6e57242c61bca38b3cc8fdf424b5667ab953e4cd (diff)
downloadlibgcrypt-254c5279058f0aea2d3568d6e756002242e82f8f.tar.gz
ecc: Clean up for decoding point.
* cipher/ecc-curves.c (point_from_keyparam): Possibly supporting Montgomery curve, use _gcry_mpi_ec_decode_point. (_gcry_ecc_set_mpi): Likewise. * cipher/ecc.c (ecc_check_secret_key): Likewise. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'cipher/ecc.c')
-rw-r--r--cipher/ecc.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/cipher/ecc.c b/cipher/ecc.c
index 06010ef2..52e379a4 100644
--- a/cipher/ecc.c
+++ b/cipher/ecc.c
@@ -839,12 +839,7 @@ ecc_check_secret_key (gcry_sexp_t keyparms)
if (mpi_q)
{
point_init (&sk.Q);
- if (ec->dialect == ECC_DIALECT_ED25519)
- rc = _gcry_ecc_eddsa_decodepoint (mpi_q, ec, &sk.Q, NULL, NULL);
- else if (ec->model == MPI_EC_MONTGOMERY)
- rc = _gcry_ecc_mont_decodepoint (mpi_q, ec, &sk.Q);
- else
- rc = _gcry_ecc_os2ec (&sk.Q, mpi_q);
+ rc = _gcry_mpi_ec_decode_point (&sk.Q, mpi_q, ec);
if (rc)
goto leave;
}