- Make A only smaller if it is larger than |X| - 1
This commit is contained in:
parent
ccba9bc42d
commit
b94081bfc1
1 changed files with 5 additions and 2 deletions
|
@ -1746,8 +1746,11 @@ int mpi_is_prime( mpi *X, int (*f_rng)(void *), void *p_rng )
|
||||||
for( j = 0; j < A.n * ciL; j++ )
|
for( j = 0; j < A.n * ciL; j++ )
|
||||||
*p++ = (unsigned char) f_rng( p_rng );
|
*p++ = (unsigned char) f_rng( p_rng );
|
||||||
|
|
||||||
j = mpi_msb( &A ) - mpi_msb( &W );
|
if( mpi_cmp_mpi( &A, &W ) >= 0 )
|
||||||
MPI_CHK( mpi_shift_r( &A, j + 1 ) );
|
{
|
||||||
|
j = mpi_msb( &A ) - mpi_msb( &W );
|
||||||
|
MPI_CHK( mpi_shift_r( &A, j + 1 ) );
|
||||||
|
}
|
||||||
A.p[0] |= 3;
|
A.p[0] |= 3;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue