summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ecp_nistp224.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_nistp224.c')
-rw-r--r--src/lib/libcrypto/ec/ecp_nistp224.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/libcrypto/ec/ecp_nistp224.c b/src/lib/libcrypto/ec/ecp_nistp224.c
index b5ff56c252..03f2d9c1d7 100644
--- a/src/lib/libcrypto/ec/ecp_nistp224.c
+++ b/src/lib/libcrypto/ec/ecp_nistp224.c
@@ -1148,7 +1148,7 @@ static void batch_mul(felem x_out, felem y_out, felem z_out,
1148static NISTP224_PRE_COMP *nistp224_pre_comp_new() 1148static NISTP224_PRE_COMP *nistp224_pre_comp_new()
1149 { 1149 {
1150 NISTP224_PRE_COMP *ret = NULL; 1150 NISTP224_PRE_COMP *ret = NULL;
1151 ret = (NISTP224_PRE_COMP *) OPENSSL_malloc(sizeof *ret); 1151 ret = (NISTP224_PRE_COMP *) malloc(sizeof *ret);
1152 if (!ret) 1152 if (!ret)
1153 { 1153 {
1154 ECerr(EC_F_NISTP224_PRE_COMP_NEW, ERR_R_MALLOC_FAILURE); 1154 ECerr(EC_F_NISTP224_PRE_COMP_NEW, ERR_R_MALLOC_FAILURE);
@@ -1181,7 +1181,7 @@ static void nistp224_pre_comp_free(void *pre_)
1181 if (i > 0) 1181 if (i > 0)
1182 return; 1182 return;
1183 1183
1184 OPENSSL_free(pre); 1184 free(pre);
1185 } 1185 }
1186 1186
1187static void nistp224_pre_comp_clear_free(void *pre_) 1187static void nistp224_pre_comp_clear_free(void *pre_)
@@ -1197,7 +1197,7 @@ static void nistp224_pre_comp_clear_free(void *pre_)
1197 return; 1197 return;
1198 1198
1199 OPENSSL_cleanse(pre, sizeof *pre); 1199 OPENSSL_cleanse(pre, sizeof *pre);
1200 OPENSSL_free(pre); 1200 free(pre);
1201 } 1201 }
1202 1202
1203/******************************************************************************/ 1203/******************************************************************************/
@@ -1382,10 +1382,10 @@ int ec_GFp_nistp224_points_mul(const EC_GROUP *group, EC_POINT *r,
1382 * converting those into affine form is time well spent */ 1382 * converting those into affine form is time well spent */
1383 mixed = 1; 1383 mixed = 1;
1384 } 1384 }
1385 secrets = OPENSSL_malloc(num_points * sizeof(felem_bytearray)); 1385 secrets = malloc(num_points * sizeof(felem_bytearray));
1386 pre_comp = OPENSSL_malloc(num_points * 17 * 3 * sizeof(felem)); 1386 pre_comp = malloc(num_points * 17 * 3 * sizeof(felem));
1387 if (mixed) 1387 if (mixed)
1388 tmp_felems = OPENSSL_malloc((num_points * 17 + 1) * sizeof(felem)); 1388 tmp_felems = malloc((num_points * 17 + 1) * sizeof(felem));
1389 if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL))) 1389 if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL)))
1390 { 1390 {
1391 ECerr(EC_F_EC_GFP_NISTP224_POINTS_MUL, ERR_R_MALLOC_FAILURE); 1391 ECerr(EC_F_EC_GFP_NISTP224_POINTS_MUL, ERR_R_MALLOC_FAILURE);
@@ -1506,11 +1506,11 @@ err:
1506 if (new_ctx != NULL) 1506 if (new_ctx != NULL)
1507 BN_CTX_free(new_ctx); 1507 BN_CTX_free(new_ctx);
1508 if (secrets != NULL) 1508 if (secrets != NULL)
1509 OPENSSL_free(secrets); 1509 free(secrets);
1510 if (pre_comp != NULL) 1510 if (pre_comp != NULL)
1511 OPENSSL_free(pre_comp); 1511 free(pre_comp);
1512 if (tmp_felems != NULL) 1512 if (tmp_felems != NULL)
1513 OPENSSL_free(tmp_felems); 1513 free(tmp_felems);
1514 return ret; 1514 return ret;
1515 } 1515 }
1516 1516