From 6b66dba626cbab48f7503f39dee8ac235189207c Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Sun, 17 May 2020 18:05:43 +0200 Subject: [PATCH] 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. --- ext/solv_pgpvrfy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.3