summaryrefslogtreecommitdiff
path: root/cipher/ecc.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2020-07-14 15:43:08 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2020-07-14 15:43:08 +0900
commite0dabf74bf276500257f15b85ded9cf24ccc8334 (patch)
tree152cab55b4a6093d63c84a85e28bdc7807071032 /cipher/ecc.c
parent1f3a92e103d4a8e019d8d022647a2b9fb2681327 (diff)
downloadlibgcrypt-e0dabf74bf276500257f15b85ded9cf24ccc8334.tar.gz
ecc: Support reading EC point in compressed format for good curves.
* cipher/ecc-curves.c (gcry_ecc_get_curve): Handle G, differently. * cipher/ecc-misc.c (_gcry_ecc_sec_decodepoint): Support compressed representation of EC point. Rename from _gcry_ecc_os2ec. * cipher/ecc-sm2.c (_gcry_ecc_sm2_decrypt) Follow the change. * cipher/ecc.c (ecc_decrypt_raw): Likewise. * mpi/ec.c (_gcry_mpi_ec_set_point): Likewise. * src/ec-context.h: API change _gcry_ecc_sec_decodepoint from _gcry_ecc_os2ec. * tests/basic.c (check_pubkey): Use compressed representation for two public keys of NIST P192 and NIST P256. GnuPG-bug-id: 4951 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'cipher/ecc.c')
-rw-r--r--cipher/ecc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cipher/ecc.c b/cipher/ecc.c
index 24b6febb..b4672d3d 100644
--- a/cipher/ecc.c
+++ b/cipher/ecc.c
@@ -1147,7 +1147,7 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (ec->model == MPI_EC_MONTGOMERY)
rc = _gcry_ecc_mont_decodepoint (data_e, ec, &kG);
else
- rc = _gcry_ecc_os2ec (&kG, data_e);
+ rc = _gcry_ecc_sec_decodepoint (data_e, ec, &kG);
if (rc)
goto leave;