summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ecp_nistp521.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_nistp521.c')
-rw-r--r--src/lib/libcrypto/ec/ecp_nistp521.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/libcrypto/ec/ecp_nistp521.c b/src/lib/libcrypto/ec/ecp_nistp521.c
index 178b655f7f..24eb032951 100644
--- a/src/lib/libcrypto/ec/ecp_nistp521.c
+++ b/src/lib/libcrypto/ec/ecp_nistp521.c
@@ -1533,7 +1533,7 @@ const EC_METHOD *EC_GFp_nistp521_method(void)
1533static NISTP521_PRE_COMP *nistp521_pre_comp_new() 1533static NISTP521_PRE_COMP *nistp521_pre_comp_new()
1534 { 1534 {
1535 NISTP521_PRE_COMP *ret = NULL; 1535 NISTP521_PRE_COMP *ret = NULL;
1536 ret = (NISTP521_PRE_COMP *)OPENSSL_malloc(sizeof(NISTP521_PRE_COMP)); 1536 ret = (NISTP521_PRE_COMP *)malloc(sizeof(NISTP521_PRE_COMP));
1537 if (!ret) 1537 if (!ret)
1538 { 1538 {
1539 ECerr(EC_F_NISTP521_PRE_COMP_NEW, ERR_R_MALLOC_FAILURE); 1539 ECerr(EC_F_NISTP521_PRE_COMP_NEW, ERR_R_MALLOC_FAILURE);
@@ -1566,7 +1566,7 @@ static void nistp521_pre_comp_free(void *pre_)
1566 if (i > 0) 1566 if (i > 0)
1567 return; 1567 return;
1568 1568
1569 OPENSSL_free(pre); 1569 free(pre);
1570 } 1570 }
1571 1571
1572static void nistp521_pre_comp_clear_free(void *pre_) 1572static void nistp521_pre_comp_clear_free(void *pre_)
@@ -1582,7 +1582,7 @@ static void nistp521_pre_comp_clear_free(void *pre_)
1582 return; 1582 return;
1583 1583
1584 OPENSSL_cleanse(pre, sizeof(*pre)); 1584 OPENSSL_cleanse(pre, sizeof(*pre));
1585 OPENSSL_free(pre); 1585 free(pre);
1586 } 1586 }
1587 1587
1588/******************************************************************************/ 1588/******************************************************************************/
@@ -1766,10 +1766,10 @@ int ec_GFp_nistp521_points_mul(const EC_GROUP *group, EC_POINT *r,
1766 * converting those into affine form is time well spent */ 1766 * converting those into affine form is time well spent */
1767 mixed = 1; 1767 mixed = 1;
1768 } 1768 }
1769 secrets = OPENSSL_malloc(num_points * sizeof(felem_bytearray)); 1769 secrets = malloc(num_points * sizeof(felem_bytearray));
1770 pre_comp = OPENSSL_malloc(num_points * 17 * 3 * sizeof(felem)); 1770 pre_comp = malloc(num_points * 17 * 3 * sizeof(felem));
1771 if (mixed) 1771 if (mixed)
1772 tmp_felems = OPENSSL_malloc((num_points * 17 + 1) * sizeof(felem)); 1772 tmp_felems = malloc((num_points * 17 + 1) * sizeof(felem));
1773 if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL))) 1773 if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL)))
1774 { 1774 {
1775 ECerr(EC_F_EC_GFP_NISTP521_POINTS_MUL, ERR_R_MALLOC_FAILURE); 1775 ECerr(EC_F_EC_GFP_NISTP521_POINTS_MUL, ERR_R_MALLOC_FAILURE);
@@ -1891,11 +1891,11 @@ err:
1891 if (new_ctx != NULL) 1891 if (new_ctx != NULL)
1892 BN_CTX_free(new_ctx); 1892 BN_CTX_free(new_ctx);
1893 if (secrets != NULL) 1893 if (secrets != NULL)
1894 OPENSSL_free(secrets); 1894 free(secrets);
1895 if (pre_comp != NULL) 1895 if (pre_comp != NULL)
1896 OPENSSL_free(pre_comp); 1896 free(pre_comp);
1897 if (tmp_felems != NULL) 1897 if (tmp_felems != NULL)
1898 OPENSSL_free(tmp_felems); 1898 free(tmp_felems);
1899 return ret; 1899 return ret;
1900 } 1900 }
1901 1901