summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2022-10-16 15:08:06 +0200
committerNiels Möller <nisse@lysator.liu.se>2022-11-28 19:30:07 +0100
commitd426ab78cb85f93971218beef246311429d2aa63 (patch)
treece5d13a48d57ee56b5d5280c9329d2a23b0698a9
parente4b9ea4ddc0fbc0a308acd9d319798f730a5e51d (diff)
downloadnettle-new-mod-inv.tar.gz
Fix warnings from static analyzer.new-mod-inv
-rw-r--r--ecc-mod-inv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ecc-mod-inv.c b/ecc-mod-inv.c
index d3294485..3aee177a 100644
--- a/ecc-mod-inv.c
+++ b/ecc-mod-inv.c
@@ -315,7 +315,7 @@ ecc_mod_inv (const struct ecc_modulo *m,
matrix_vector_mul (&M, STEPS, n+1, fp, gp, tp);
matrix_vector_mul_mod (&M, mp, m->binv, n, up, vp, tp);
}
- delta = steps (&M, count, delta, fp[0], gp[0]);
+ steps (&M, count, delta, fp[0], gp[0]);
matrix_vector_mul (&M, count, n+1, fp, gp, tp);
/* Only compute u, we don't need v. */
add_add_mul_mod (tp, up, vp, mp, n, M.a[0][0], M.a[0][1]);
@@ -326,7 +326,7 @@ ecc_mod_inv (const struct ecc_modulo *m,
/* Now f = ±1 (if the inverse exists), and a * u = f (mod m) */
cy = cnd_neg (fp[n] >> (GMP_LIMB_BITS - 1), up, up, n);
/* Make u non-negative */
- cy -= mpn_cnd_add_n (cy, up, up, mp, n);
+ mpn_cnd_add_n (cy, up, up, mp, n);
cnd_neg (fp[n] >> (GMP_LIMB_BITS - 1), fp, fp, n + 1);
cy = one_p (fp, n+1);