diff --git a/ChangeLog b/ChangeLog index e13bf3e03..3a63c4420 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/library/bignum.c b/library/bignum.c index 357dd4601..fa9f1f141 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -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 ) );