diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2020-07-14 15:43:08 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2020-07-14 15:43:08 +0900 |
commit | e0dabf74bf276500257f15b85ded9cf24ccc8334 (patch) | |
tree | 152cab55b4a6093d63c84a85e28bdc7807071032 /src/ec-context.h | |
parent | 1f3a92e103d4a8e019d8d022647a2b9fb2681327 (diff) | |
download | libgcrypt-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 'src/ec-context.h')
-rw-r--r-- | src/ec-context.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ec-context.h b/src/ec-context.h index 959d1eb2..d1c64804 100644 --- a/src/ec-context.h +++ b/src/ec-context.h @@ -90,7 +90,8 @@ gpg_err_code_t _gcry_ecc_set_point (const char *name, gcry_mpi_point_t newvalue, mpi_ec_t ec); /*-- cipher/ecc-misc.c --*/ -gcry_err_code_t _gcry_ecc_os2ec (mpi_point_t result, gcry_mpi_t value); +gpg_err_code_t _gcry_ecc_sec_decodepoint (gcry_mpi_t value, mpi_ec_t ec, + mpi_point_t result); gpg_err_code_t _gcry_ecc_mont_decodepoint (gcry_mpi_t pk, mpi_ec_t ctx, mpi_point_t result); |