diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-01-31 16:34:07 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-01-31 22:18:30 +0000 |
commit | be2e334fce734e726a4085701bc3cbbaabf9d893 (patch) | |
tree | 1abe68a660b992e194fdb26dd42aed6860d3e87a /crypto/ec/ecp_nistz256.c | |
parent | 81e03785f718f98861a2a84b7b5d798b00df1670 (diff) |
Add EC_GROUP_order_bits, EC_GROUP_get0_order and EC_GROUP_get0_cofactor
New functions to return internal pointer for order and cofactor. This
avoids the need to allocate a new BIGNUM which to copy the value to.
Simplify code to use new functions.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/ec/ecp_nistz256.c')
-rw-r--r-- | crypto/ec/ecp_nistz256.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/crypto/ec/ecp_nistz256.c b/crypto/ec/ecp_nistz256.c index 7d953a306d..388e87e0fb 100644 --- a/crypto/ec/ecp_nistz256.c +++ b/crypto/ec/ecp_nistz256.c @@ -756,7 +756,7 @@ __owur static int ecp_nistz256_mult_precompute(EC_GROUP *group, BN_CTX *ctx) * implicit value of infinity at index zero. We use window of size 7, and * therefore require ceil(256/7) = 37 tables. */ - BIGNUM *order; + const BIGNUM *order; EC_POINT *P = NULL, *T = NULL; const EC_POINT *generator; NISTZ256_PRE_COMP *pre_comp; @@ -793,14 +793,11 @@ __owur static int ecp_nistz256_mult_precompute(EC_GROUP *group, BN_CTX *ctx) } BN_CTX_start(ctx); - order = BN_CTX_get(ctx); + order = EC_GROUP_get0_order(group); if (order == NULL) goto err; - if (!EC_GROUP_get_order(group, order, ctx)) - goto err; - if (BN_is_zero(order)) { ECerr(EC_F_ECP_NISTZ256_MULT_PRECOMPUTE, EC_R_UNKNOWN_ORDER); goto err; |