Fix possible issue in corner-case for ecp_mul_mx()

This commit is contained in:
Manuel Pégourié-Gonnard 2013-12-05 10:48:42 +01:00
parent 7a949d3f5b
commit 93f41dbdfd

View file

@ -1540,6 +1540,9 @@ static int ecp_mul_mxz( ecp_group *grp, ecp_point *R,
MPI_CHK( mpi_lset( &R->Z, 0 ) ); MPI_CHK( mpi_lset( &R->Z, 0 ) );
mpi_free( &R->Y ); mpi_free( &R->Y );
/* RP.X might be sligtly larger than P, so reduce it */
MOD_ADD( RP.X );
/* Randomize coordinates of the starting point */ /* Randomize coordinates of the starting point */
if( f_rng != NULL ) if( f_rng != NULL )
MPI_CHK( ecp_randomize_mxz( grp, &RP, f_rng, p_rng ) ); MPI_CHK( ecp_randomize_mxz( grp, &RP, f_rng, p_rng ) );