summaryrefslogtreecommitdiff
path: root/cipher/ecc-common.h
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2019-10-21 10:47:03 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2019-10-21 10:47:03 +0900
commita258ae728de62607b3ef4eca940cfbcf9965fa5f (patch)
treeb9ebab09d4f6323325f2a98da2f7733b617d2b3d /cipher/ecc-common.h
parent579d5d6017d63b5eabec588b24d1a22566455bac (diff)
downloadlibgcrypt-a258ae728de62607b3ef4eca940cfbcf9965fa5f.tar.gz
ecc: Simply use unsigned int for cofactor, not MPI.
* cipher/ecc-common.h (elliptic_curve_t): Use unsigned int for H. * src/ec-context.h (struct mpi_ec_ctx_s): Ditto. * cipher/ecc-curves.c (ecc_domain_parms_t): Ditto. (domain_parms): Update for the cofactors. (_gcry_ecc_fill_in_curve): H is no longer MPI, but unsigned int. (_gcry_ecc_get_curve): Remove handling for H. (_gcry_mpi_ec_new): In KEYPARM, cofactor is still MPI. (_gcry_ecc_get_param_sexp): H is no longer MPI, but unsigned int. (_gcry_ecc_get_mpi): Keep the API, returning MPI for "h". (_gcry_ecc_set_mpi): Likewise. * cipher/ecc-ecdh.c (_gcry_ecc_mul_point): Fix for unsigned int. * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Likewise. * cipher/ecc-misc.c (_gcry_ecc_curve_free): Likewise. * cipher/ecc.c (nist_generate_key, test_ecdh_only_keys): Likewise. (test_ecdh_only_keys, ecc_generate, ecc_check_secret_key): Likewise. (ecc_sign, ecc_verify, ecc_encrypt_raw, ecc_decrypt_raw): Likewise. (_gcry_pk_ecc_get_sexp): Likewise. * mpi/ec.c (ec_deinit): Likewise. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'cipher/ecc-common.h')
-rw-r--r--cipher/ecc-common.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/cipher/ecc-common.h b/cipher/ecc-common.h
index 8d74ce15..59c6d351 100644
--- a/cipher/ecc-common.h
+++ b/cipher/ecc-common.h
@@ -32,7 +32,7 @@ typedef struct
or d as used by Twisted Edwards curves. */
mpi_point_struct G; /* Base point (generator). */
gcry_mpi_t n; /* Order of G. */
- gcry_mpi_t h; /* Cofactor. */
+ unsigned int h; /* Cofactor. */
const char *name; /* Name of the curve or NULL. */
} elliptic_curve_t;