commit | 93f41dbdfdb047a87872a772881405aefcf6828e | [log] [tgz] |
---|---|---|
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | Thu Dec 05 10:48:42 2013 +0100 |
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | Thu Dec 05 15:58:38 2013 +0100 |
tree | 51e3a04a6b543d0ac53ff221a8e44799f6eb814c | |
parent | 7a949d3f5bde06d632866234b1c5dddf4b6c269a [diff] [blame] |
Fix possible issue in corner-case for ecp_mul_mx()
diff --git a/library/ecp.c b/library/ecp.c index 0cb61f4..02f1b61 100644 --- a/library/ecp.c +++ b/library/ecp.c
@@ -1540,6 +1540,9 @@ MPI_CHK( mpi_lset( &R->Z, 0 ) ); 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 */ if( f_rng != NULL ) MPI_CHK( ecp_randomize_mxz( grp, &RP, f_rng, p_rng ) );