diff options
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_nistp521.c')
| -rw-r--r-- | src/lib/libcrypto/ec/ecp_nistp521.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ec/ecp_nistp521.c b/src/lib/libcrypto/ec/ecp_nistp521.c index 0c40f08346..6792c5b71d 100644 --- a/src/lib/libcrypto/ec/ecp_nistp521.c +++ b/src/lib/libcrypto/ec/ecp_nistp521.c | |||
| @@ -1872,8 +1872,8 @@ ec_GFp_nistp521_points_mul(const EC_GROUP * group, EC_POINT * r, | |||
| 1872 | */ | 1872 | */ |
| 1873 | mixed = 1; | 1873 | mixed = 1; |
| 1874 | } | 1874 | } |
| 1875 | secrets = malloc(num_points * sizeof(felem_bytearray)); | 1875 | secrets = calloc(num_points, sizeof(felem_bytearray)); |
| 1876 | pre_comp = malloc(num_points * 17 * 3 * sizeof(felem)); | 1876 | pre_comp = calloc(num_points, 17 * 3 * sizeof(felem)); |
| 1877 | if (mixed) | 1877 | if (mixed) |
| 1878 | tmp_felems = malloc((num_points * 17 + 1) * sizeof(felem)); | 1878 | tmp_felems = malloc((num_points * 17 + 1) * sizeof(felem)); |
| 1879 | if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL))) { | 1879 | if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL))) { |
| @@ -1885,8 +1885,6 @@ ec_GFp_nistp521_points_mul(const EC_GROUP * group, EC_POINT * r, | |||
| 1885 | * infinity, i.e., they contribute nothing to the linear | 1885 | * infinity, i.e., they contribute nothing to the linear |
| 1886 | * combination | 1886 | * combination |
| 1887 | */ | 1887 | */ |
| 1888 | memset(secrets, 0, num_points * sizeof(felem_bytearray)); | ||
| 1889 | memset(pre_comp, 0, num_points * 17 * 3 * sizeof(felem)); | ||
| 1890 | for (i = 0; i < num_points; ++i) { | 1888 | for (i = 0; i < num_points; ++i) { |
| 1891 | if (i == num) | 1889 | if (i == num) |
| 1892 | /* | 1890 | /* |
