Bignum: Remove dead code

Both variables affected by the code are overwritten before their next
read.
This commit is contained in:
Janos Follath 2018-09-04 11:19:21 +01:00 committed by Darryl Green
parent 3332937538
commit b728c29114

View File

@ -2104,15 +2104,6 @@ static int mpi_miller_rabin( const mbedtls_mpi *X, int flags,
/*
* pick a random A, 1 < A < |X| - 1
*/
MBEDTLS_MPI_CHK( mbedtls_mpi_fill_random( &A, X->n * ciL, f_rng, p_rng ) );
if( mbedtls_mpi_cmp_mpi( &A, &W ) >= 0 )
{
j = mbedtls_mpi_bitlen( &A ) - mbedtls_mpi_bitlen( &W );
MBEDTLS_MPI_CHK( mbedtls_mpi_shift_r( &A, j + 1 ) );
}
A.p[0] |= 3;
count = 0;
do {
MBEDTLS_MPI_CHK( mbedtls_mpi_fill_random( &A, X->n * ciL, f_rng, p_rng ) );