- Found algorithmic bug in mpi_is_prime()

This commit is contained in:
Paul Bakker 2010-03-16 21:26:36 +00:00
parent 4ed999c4b2
commit 41d13f4af8
2 changed files with 3 additions and 1 deletions

View file

@ -12,6 +12,8 @@ Bug fixes
certificate in the chain in ssl_write_certificate() and
ssl_write_certificate_request() (Found by fatbob)
* Added small fixes for compiler warnings on a Mac
* Fixed algorithmic bug in mpi_is_prime() (Found by
Smbat Tonoyan)
= Version 0.12.1 released on 2009-10-04
Changes

View file

@ -1720,8 +1720,8 @@ int mpi_is_prime( mpi *X, int (*f_rng)(void *), void *p_rng )
* W = |X| - 1
* R = W >> lsb( W )
*/
s = mpi_lsb( &W );
MPI_CHK( mpi_sub_int( &W, X, 1 ) );
s = mpi_lsb( &W );
MPI_CHK( mpi_copy( &R, &W ) );
MPI_CHK( mpi_shift_r( &R, s ) );