diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2019-10-10 13:27:55 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2019-10-10 13:27:55 +0900 |
commit | 80cf289905ace9f174eb06d7f55f38980f7e4dbd (patch) | |
tree | 7f81eaa790852d1907ba2473ecc8835bb131e5c2 /cipher/ecc-common.h | |
parent | ba0b31f2636632b1b39ebd2202de3ba5d60588b8 (diff) | |
download | libgcrypt-80cf289905ace9f174eb06d7f55f38980f7e4dbd.tar.gz |
ecc: Consolidate encoding a point for Montgomery curve.
* cipher/ecc-common.h (_gcry_ecc_mont_encodepoint): New.
* cipher/ecc-misc.c (_gcry_ecc_mont_encodepoint): New.
* cipher/ecc.c (ecc_generate): Use _gcry_ecc_mont_encodepoint.
(ecc_encrypt_raw, ecc_decrypt_raw, _gcry_pk_ecc_get_sexp): Likewise.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'cipher/ecc-common.h')
-rw-r--r-- | cipher/ecc-common.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cipher/ecc-common.h b/cipher/ecc-common.h index de60e2b8..5140663c 100644 --- a/cipher/ecc-common.h +++ b/cipher/ecc-common.h @@ -92,6 +92,10 @@ gcry_mpi_t _gcry_ecc_ec2os (gcry_mpi_t x, gcry_mpi_t y, gcry_mpi_t p); mpi_point_t _gcry_ecc_compute_public (mpi_point_t Q, mpi_ec_t ec, mpi_point_t G, gcry_mpi_t d); +gpg_err_code_t _gcry_ecc_mont_encodepoint (gcry_mpi_t x, unsigned int nbits, + int with_prefix, + unsigned char **r_buffer, + unsigned int *r_buflen); /*-- ecc.c --*/ |