mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 11:15:43 +01: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;
|
||||
|
||||
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 );
|
||||
|
Loading…
Reference in New Issue
Block a user