- Fixed mpi_fill_random() to fill and create right size MPI

This commit is contained in:
Paul Bakker 2012-02-12 17:17:27 +00:00
parent b08e6843c2
commit 39dfdaca8f

View File

@ -1618,10 +1618,10 @@ int mpi_fill_random( mpi *X, size_t size,
{
int ret;
MPI_CHK( mpi_grow( X, size ) );
MPI_CHK( mpi_grow( X, CHARS_TO_LIMBS( size ) ) );
MPI_CHK( mpi_lset( X, 0 ) );
MPI_CHK( f_rng( p_rng, (unsigned char *) X->p, X->n * ciL ) );
MPI_CHK( f_rng( p_rng, (unsigned char *) X->p, size ) );
cleanup:
return( ret );