1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

- Allow R and A to point to same mpi in mpi_div_mpi

This commit is contained in:
Paul Bakker
2012-11-13 10:25:21 +00:00
parent 36c4a678a6
commit f02c5642d0
3 changed files with 8 additions and 6 deletions

View File

@ -1195,9 +1195,9 @@ int mpi_div_mpi( mpi *Q, mpi *R, const mpi *A, const mpi *B )
if( R != NULL )
{
mpi_shift_r( &X, k );
X.s = A->s;
mpi_copy( R, &X );
R->s = A->s;
if( mpi_cmp_int( R, 0 ) == 0 )
R->s = 1;
}