diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-03-01 20:43:31 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-03-01 20:43:31 (GMT) |
commit | 5753c7a42b638962406f9f7f822e48561e7a6253 (patch) | |
tree | 65742203dd83d002e9c923ddf96ddf45460e0d05 /libtommath/bn_mp_invmod_slow.c | |
parent | 6881a1a27437cae50d56f12227e9cfe10c7a49f2 (diff) | |
download | tcl-5753c7a42b638962406f9f7f822e48561e7a6253.zip tcl-5753c7a42b638962406f9f7f822e48561e7a6253.tar.gz tcl-5753c7a42b638962406f9f7f822e48561e7a6253.tar.bz2 |
Lots of code cleanup, mainly [https://github.com/libtom/libtommath/pull/102|Pull request #102]
Diffstat (limited to 'libtommath/bn_mp_invmod_slow.c')
-rw-r--r-- | libtommath/bn_mp_invmod_slow.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libtommath/bn_mp_invmod_slow.c b/libtommath/bn_mp_invmod_slow.c index 2bb5196..360f161 100644 --- a/libtommath/bn_mp_invmod_slow.c +++ b/libtommath/bn_mp_invmod_slow.c @@ -53,8 +53,8 @@ int mp_invmod_slow(const mp_int *a, const mp_int *b, mp_int *c) if ((res = mp_copy(&y, &v)) != MP_OKAY) { goto LBL_ERR; } - mp_set(&A, 1); - mp_set(&D, 1); + mp_set(&A, 1uL); + mp_set(&D, 1uL); top: /* 4. while u is even do */ @@ -143,13 +143,13 @@ top: /* now a = C, b = D, gcd == g*v */ /* if v != 1 then there is no inverse */ - if (mp_cmp_d(&v, 1) != MP_EQ) { + if (mp_cmp_d(&v, 1uL) != MP_EQ) { res = MP_VAL; goto LBL_ERR; } /* if its too low */ - while (mp_cmp_d(&C, 0) == MP_LT) { + while (mp_cmp_d(&C, 0uL) == MP_LT) { if ((res = mp_add(&C, b, &C)) != MP_OKAY) { goto LBL_ERR; } |