From 1d5e58b53c13d739cdd19a0b94738339ad3d4631 Mon Sep 17 00:00:00 2001 From: Bodo Moeller Date: Wed, 13 Aug 2014 17:37:19 +0200 Subject: [PATCH] Further improve/fix ec_GFp_simple_points_make_affine (ecp_smpl.c) and group_order_tests (ectest.c). Also fix the EC_POINTs_mul documentation (ec.h). Reviewed-by: emilia@openssl.org Conflicts: crypto/ec/ectest.c --- crypto/ec/ec.h | 2 +- crypto/ec/ecp_smpl.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/ec/ec.h b/crypto/ec/ec.h index ec911f2637..b721a047c3 100644 --- a/crypto/ec/ec.h +++ b/crypto/ec/ec.h @@ -609,7 +609,7 @@ int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN int EC_POINT_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *); int EC_POINTs_make_affine(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *); -/** Computes r = generator * n sum_{i=0}^num p[i] * m[i] +/** Computes r = generator * n sum_{i=0}^{num-1} p[i] * m[i] * \param group underlying EC_GROUP object * \param r EC_POINT object for the result * \param n BIGNUM with the multiplier for the group generator (optional) diff --git a/crypto/ec/ecp_smpl.c b/crypto/ec/ecp_smpl.c index b2390882b9..1dc35d72a0 100644 --- a/crypto/ec/ecp_smpl.c +++ b/crypto/ec/ecp_smpl.c @@ -1676,8 +1676,8 @@ int ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num, EC_POINT { for (i = 0; i < num; i++) { - if (prod_Z[i] != NULL) - BN_clear_free(prod_Z[i]); + if (prod_Z[i] == NULL) break; + BN_clear_free(prod_Z[i]); } OPENSSL_free(prod_Z); } -- 2.25.1