From: Michael Schroeder Date: Sun, 17 May 2020 16:05:43 +0000 (+0200) Subject: solv_pgpvrfy: fix buf in modulo reduction X-Git-Tag: 0.7.14~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b66dba626cbab48f7503f39dee8ac235189207c;p=thirdparty%2Flibsolv.git solv_pgpvrfy: fix buf in modulo reduction The carry propagation did not work when subtracting the modulo at the end of the computation. I am amazed that this did not show up earlier. --- diff --git a/ext/solv_pgpvrfy.c b/ext/solv_pgpvrfy.c index 9bc256ca..a5b8f830 100644 --- a/ext/solv_pgpvrfy.c +++ b/ext/solv_pgpvrfy.c @@ -101,7 +101,7 @@ mpdomod(int len, mp_t *target, mp2_t x, mp_t *mod) n = 0; for (j = 0; j <= i; j++) { - mp2_t n2 = mod[j] + n; + mp2_t n2 = (mp2_t)mod[j] + n; n = n2 > target[j] ? 1 : 0; target[j] -= (mp_t)n2; }