summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_lcl.h
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2017-12-30 15:08:31 +0100
committerAndy Polyakov <appro@openssl.org>2018-01-07 21:31:37 +0100
commiteb7916960bf50f436593abe3d5f2e0592d291017 (patch)
tree3ad36bd09f212dccca8bb59fdedb223cdab8786e /crypto/ec/ec_lcl.h
parent617b49db14fa4c1211bfc5d0e88294d0f159c9a9 (diff)
ec/ecp_nistz256.c: improve ECDSA sign by 30-40%.
This is based on RT#3810, which added dedicated modular inversion. ECDSA verify results improves as well, but not as much. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5001)
Diffstat (limited to 'crypto/ec/ec_lcl.h')
-rw-r--r--crypto/ec/ec_lcl.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/ec/ec_lcl.h b/crypto/ec/ec_lcl.h
index 6cc0190aa7..540aa534e7 100644
--- a/crypto/ec/ec_lcl.h
+++ b/crypto/ec/ec_lcl.h
@@ -155,6 +155,9 @@ struct ec_method_st {
/* custom ECDH operation */
int (*ecdh_compute_key)(unsigned char **pout, size_t *poutlen,
const EC_POINT *pub_key, const EC_KEY *ecdh);
+ /* Inverse modulo order */
+ int (*field_inverse_mod_ord)(const EC_GROUP *, BIGNUM *r, BIGNUM *x,
+ BN_CTX *ctx);
};
/*
@@ -520,7 +523,6 @@ void ec_GFp_nistp_points_make_affine_internal(size_t num, void *point_array,
void ec_GFp_nistp_recode_scalar_bits(unsigned char *sign,
unsigned char *digit, unsigned char in);
#endif
-int ec_precompute_mont_data(EC_GROUP *);
int ec_group_simple_order_bits(const EC_GROUP *group);
#ifdef ECP_NISTZ256_ASM
@@ -604,3 +606,6 @@ int X25519(uint8_t out_shared_key[32], const uint8_t private_key[32],
const uint8_t peer_public_value[32]);
void X25519_public_from_private(uint8_t out_public_value[32],
const uint8_t private_key[32]);
+
+int EC_GROUP_do_inverse_ord(const EC_GROUP *group, BIGNUM *res,
+ BIGNUM *x, BN_CTX *ctx);