mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
- Fixed incorrect handling of negative first input value in mpi_sub_abs() (found by code coverage tests).
This commit is contained in:
@ -762,6 +762,11 @@ int mpi_sub_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 substractions.
|
||||
*/
|
||||
X->s = 1;
|
||||
|
||||
ret = 0;
|
||||
|
||||
for( n = B->n - 1; n >= 0; n-- )
|
||||
|
Reference in New Issue
Block a user