mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
- Fixed incorrect handling of one single negative input value in mpi_add_abs() (found by code coverage tests).
This commit is contained in:
@@ -683,6 +683,11 @@ int mpi_add_abs( mpi *X, mpi *A, mpi *B )
|
||||
|
||||
if( X != A )
|
||||
MPI_CHK( mpi_copy( X, A ) );
|
||||
|
||||
/*
|
||||
* X should always be positive as a result of unsigned additions.
|
||||
*/
|
||||
X->s = 1;
|
||||
|
||||
for( j = B->n - 1; j >= 0; j-- )
|
||||
if( B->p[j] != 0 )
|
||||
|
Reference in New Issue
Block a user