diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index ae58e857b..07cd1fedc 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -1104,9 +1104,9 @@ void fp_mod_2d(fp_int *a, int b, fp_int *c) bmax = ((unsigned int)b + DIGIT_BIT - 1) / DIGIT_BIT; - /* If a is negative and bmax is larger than FP_SIZE, then the + /* If a is negative and bmax is greater than or equal to FP_SIZE, then the * result can't fit within c. Just return. */ - if (c->sign == FP_NEG && bmax > FP_SIZE) { + if (c->sign == FP_NEG && bmax >= FP_SIZE) { return; }