mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-22 16:51:08 +00:00
- Fixed mpi_fill_random() to fill and create right size MPI
This commit is contained in:
parent
b08e6843c2
commit
39dfdaca8f
|
@ -1618,10 +1618,10 @@ int mpi_fill_random( mpi *X, size_t size,
|
||||||
{
|
{
|
||||||
int ret;
|
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( 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:
|
cleanup:
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
Loading…
Reference in a new issue