aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2023-01-06 11:29:04 +0000
committerDave Rodgman <dave.rodgman@arm.com>2023-01-06 11:31:54 +0000
commitb6466c88df54cb3f66fd42a50b5d8485024f0ab4 (patch)
tree6dce6440e51cc75cd9a542c6b088aa0721e55833
parente4627f34dac421f43f41b4cf2c2184cdfeb97d01 (diff)
downloadmbedtls-b6466c88df54cb3f66fd42a50b5d8485024f0ab4.zip
mbedtls-b6466c88df54cb3f66fd42a50b5d8485024f0ab4.tar.gz
mbedtls-b6466c88df54cb3f66fd42a50b5d8485024f0ab4.tar.bz2
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
-rw-r--r--library/bignum.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/bignum.c b/library/bignum.c
index 37193f5..32038f8 100644
--- a/library/bignum.c
+++ b/library/bignum.c
@@ -1559,9 +1559,9 @@ static mbedtls_mpi_uint mbedtls_int_div_int( mbedtls_mpi_uint u1,
*/
if( 0 == d || u1 >= d )
{
- if (r != NULL) *r = ~0;
+ if (r != NULL) *r = ~(mbedtls_mpi_uint)0u;
- return ( ~0 );
+ return ( ~(mbedtls_mpi_uint)0u );
}
#if defined(MBEDTLS_HAVE_UDBL)
@@ -1700,7 +1700,7 @@ int mbedtls_mpi_div_mpi( mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A,
for( i = n; i > t ; i-- )
{
if( X.p[i] >= Y.p[t] )
- Z.p[i - t - 1] = ~0;
+ Z.p[i - t - 1] = ~(mbedtls_mpi_uint)0u;
else
{
Z.p[i - t - 1] = mbedtls_int_div_int( X.p[i], X.p[i - 1],