summaryrefslogtreecommitdiff
path: root/src/ec-context.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 /src/ec-context.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 'src/ec-context.h')
-rw-r--r--src/ec-context.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ec-context.h b/src/ec-context.h
index e48ef6f1..d4a73dfe 100644
--- a/src/ec-context.h
+++ b/src/ec-context.h
@@ -38,7 +38,7 @@ struct mpi_ec_ctx_s
gcry_mpi_t b; /* Second coefficient of the Weierstrass equation. */
gcry_mpi_point_t G; /* Base point (generator). */
gcry_mpi_t n; /* Order of G. */
- gcry_mpi_t h; /* Cofactor. */
+ unsigned int h; /* Cofactor. */
/* The actual key. May not be set. */
gcry_mpi_point_t Q; /* Public key. */