mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 16:38:38 +00:00
- Moved to prevent uninitialized exit var
This commit is contained in:
parent
4248823f43
commit
50546921ac
1 changed files with 13 additions and 13 deletions
|
@ -1396,19 +1396,6 @@ int mpi_exp_mod( mpi *X, const mpi *A, const mpi *E, const mpi *N, mpi *_RR )
|
|||
if( mpi_cmp_int( E, 0 ) < 0 )
|
||||
return( POLARSSL_ERR_MPI_BAD_INPUT_DATA );
|
||||
|
||||
/*
|
||||
* Compensate for negative A (and correct at the end)
|
||||
*/
|
||||
neg = ( A->s == -1 );
|
||||
|
||||
mpi_init( &Apos );
|
||||
if( neg )
|
||||
{
|
||||
MPI_CHK( mpi_copy( &Apos, A ) );
|
||||
Apos.s = 1;
|
||||
A = &Apos;
|
||||
}
|
||||
|
||||
/*
|
||||
* Init temps and window size
|
||||
*/
|
||||
|
@ -1429,6 +1416,19 @@ int mpi_exp_mod( mpi *X, const mpi *A, const mpi *E, const mpi *N, mpi *_RR )
|
|||
MPI_CHK( mpi_grow( &W[1], j ) );
|
||||
MPI_CHK( mpi_grow( &T, j * 2 ) );
|
||||
|
||||
/*
|
||||
* Compensate for negative A (and correct at the end)
|
||||
*/
|
||||
neg = ( A->s == -1 );
|
||||
|
||||
mpi_init( &Apos );
|
||||
if( neg )
|
||||
{
|
||||
MPI_CHK( mpi_copy( &Apos, A ) );
|
||||
Apos.s = 1;
|
||||
A = &Apos;
|
||||
}
|
||||
|
||||
/*
|
||||
* If 1st call, pre-compute R^2 mod N
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue