diff --git a/wolfcrypt/src/integer.c b/wolfcrypt/src/integer.c index 1c8fd87d3..ab0040d0d 100644 --- a/wolfcrypt/src/integer.c +++ b/wolfcrypt/src/integer.c @@ -4103,7 +4103,7 @@ int mp_sub_d (mp_int * a, mp_digit b, mp_int * c) /* subtract first digit */ *tmpc = *tmpa - b; if (b > *tmpa++) - mu = (mp_digit)(((-*tmpc) >> DIGIT_BIT) + 1); + mu = ((0 - *tmpc) >> DIGIT_BIT) + 1; else mu = *tmpc >> DIGIT_BIT; *tmpc++ &= MP_MASK;