Home GnuPG

ecc: Support reading EC point in compressed format for good curves.

Description

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: T4951
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on Jul 14 2020, 8:43 AM
Parents
rC1f3a92e103d4: mpi: Consider +0 and -0 the same in mpi_cmp.
Branches
Unknown
Tags
Unknown
Tasks
T4951: Support point compression in Libgcrypt