summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ecp_nistp256.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_nistp256.c')
-rw-r--r--src/lib/libcrypto/ec/ecp_nistp256.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ec/ecp_nistp256.c b/src/lib/libcrypto/ec/ecp_nistp256.c
index 558c29c5ba..df80cc2b8a 100644
--- a/src/lib/libcrypto/ec/ecp_nistp256.c
+++ b/src/lib/libcrypto/ec/ecp_nistp256.c
@@ -1985,8 +1985,8 @@ ec_GFp_nistp256_points_mul(const EC_GROUP * group, EC_POINT * r,
1985 */ 1985 */
1986 mixed = 1; 1986 mixed = 1;
1987 } 1987 }
1988 secrets = malloc(num_points * sizeof(felem_bytearray)); 1988 secrets = calloc(num_points, sizeof(felem_bytearray));
1989 pre_comp = malloc(num_points * 17 * 3 * sizeof(smallfelem)); 1989 pre_comp = calloc(num_points, 17 * 3 * sizeof(smallfelem));
1990 if (mixed) 1990 if (mixed)
1991 tmp_smallfelems = malloc((num_points * 17 + 1) * sizeof(smallfelem)); 1991 tmp_smallfelems = malloc((num_points * 17 + 1) * sizeof(smallfelem));
1992 if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_smallfelems == NULL))) { 1992 if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_smallfelems == NULL))) {
@@ -1998,8 +1998,6 @@ ec_GFp_nistp256_points_mul(const EC_GROUP * group, EC_POINT * r,
1998 * infinity, i.e., they contribute nothing to the linear 1998 * infinity, i.e., they contribute nothing to the linear
1999 * combination 1999 * combination
2000 */ 2000 */
2001 memset(secrets, 0, num_points * sizeof(felem_bytearray));
2002 memset(pre_comp, 0, num_points * 17 * 3 * sizeof(smallfelem));
2003 for (i = 0; i < num_points; ++i) { 2001 for (i = 0; i < num_points; ++i) {
2004 if (i == num) 2002 if (i == num)
2005 /* 2003 /*