update comment to reflect new sanity check

This commit is contained in:
Jacob Barthelmeh
2019-11-25 10:57:09 -07:00
parent 316b8b0b4d
commit 7c3a4a1975

View File

@@ -964,7 +964,7 @@ int wolfcrypt_mp_invmod(mp_int * a, mp_int * b, mp_int * c)
int mp_invmod (mp_int * a, mp_int * b, mp_int * c) int mp_invmod (mp_int * a, mp_int * b, mp_int * c)
#endif #endif
{ {
/* b cannot be negative */ /* b cannot be negative or zero, and can not divide by 0 (1/a mod b) */
if (b->sign == MP_NEG || mp_iszero(b) == MP_YES || mp_iszero(a) == MP_YES) { if (b->sign == MP_NEG || mp_iszero(b) == MP_YES || mp_iszero(a) == MP_YES) {
return MP_VAL; return MP_VAL;
} }