Skip to content

Commit

Permalink
Assign have_rng in declaration of ecp_mul_mxz
Browse files Browse the repository at this point in the history
Signed-off-by: Agathiyan Bragadeesh <[email protected]>
  • Loading branch information
Agathiyan Bragadeesh committed Jul 31, 2023
1 parent 7b0ee1e commit 5521b4c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions library/ecp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2593,7 +2593,7 @@ static int ecp_mul_mxz(mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
void *p_rng)
{
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
int have_rng;
int have_rng = 1;
size_t i;
unsigned char b;
mbedtls_ecp_point RP;
Expand Down Expand Up @@ -2626,9 +2626,8 @@ static int ecp_mul_mxz(mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
/* RP.X might be slightly larger than P, so reduce it */
MOD_ADD(RP.X);

/* Randomize coordinates of the starting point */
have_rng = 1;
#if defined(MBEDTLS_ECP_NO_INTERNAL_RNG)
/* Derandomize coordinates of the starting point */
if (f_rng == NULL) {
have_rng = 0;
}
Expand Down

0 comments on commit 5521b4c

Please sign in to comment.