From 39dfdaca8f19a157bb95e2b544f44c4c3f13134f Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Sun, 12 Feb 2012 17:17:27 +0000 Subject: [PATCH] - Fixed mpi_fill_random() to fill and create right size MPI --- library/bignum.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/bignum.c b/library/bignum.c index 9dff9914d..eccb9d30f 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -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 );