[openssl-commits] [openssl] master update
Emilia Kasper
emilia at openssl.org
Mon Apr 27 17:53:17 UTC 2015
The branch master has been updated
via 6038354cf8ca0792420c1ac0ce50d6d2f0aedebf (commit)
from 31b222da1ea6fadd22f5cb134f6ba289f81a2adc (commit)
- Log -----------------------------------------------------------------
commit 6038354cf8ca0792420c1ac0ce50d6d2f0aedebf
Author: Emilia Kasper <emilia at openssl.org>
Date: Mon Apr 27 18:49:43 2015 +0200
NISTZ256: use EC_POINT API and check errors.
Reviewed-by: Rich Salz <rsalz at openssl.org>
-----------------------------------------------------------------------
Summary of changes:
crypto/ec/ecp_nistz256.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/crypto/ec/ecp_nistz256.c b/crypto/ec/ecp_nistz256.c
index f8d4bdd..d938bee 100644
--- a/crypto/ec/ecp_nistz256.c
+++ b/crypto/ec/ecp_nistz256.c
@@ -844,17 +844,25 @@ static int ecp_nistz256_mult_precompute(EC_GROUP *group, BN_CTX *ctx)
for (j = 0; j < 37; j++) {
P256_POINT_AFFINE temp;
/*
- * It would be faster to use ec_GFp_simple_points_make_affine and
+ * It would be faster to use EC_POINTs_make_affine and
* make multiple points affine at the same time.
*/
- ec_GFp_simple_make_affine(group, P, ctx);
- ecp_nistz256_bignum_to_field_elem(temp.X, P->X);
- ecp_nistz256_bignum_to_field_elem(temp.Y, P->Y);
+ if (!EC_POINT_make_affine(group, P, ctx))
+ goto err;
+ if (!ecp_nistz256_bignum_to_field_elem(temp.X, P->X) ||
+ !ecp_nistz256_bignum_to_field_elem(temp.Y, P->Y)) {
+ ECerr(EC_F_ECP_NISTZ256_MULT_PRECOMPUTE,
+ EC_R_COORDINATES_OUT_OF_RANGE);
+ goto err;
+ }
ecp_nistz256_scatter_w7(preComputedTable[j], &temp, k);
- for (i = 0; i < 7; i++)
- ec_GFp_simple_dbl(group, P, P, ctx);
+ for (i = 0; i < 7; i++) {
+ if (!EC_POINT_dbl(group, P, P, ctx))
+ goto err;
+ }
}
- ec_GFp_simple_add(group, T, T, generator, ctx);
+ if (!EC_POINT_add(group, T, T, generator, ctx))
+ goto err;
}
pre_comp->group = group;
More information about the openssl-commits
mailing list