X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/e4b4f5a12c4cee51af31de2b7c5def0273a49ca5..783c82b3c5bb0f07deae79e012a864a54bec8749:/sshprime.c diff --git a/sshprime.c b/sshprime.c index b48ce1a3..070eb98a 100644 --- a/sshprime.c +++ b/sshprime.c @@ -1255,6 +1255,10 @@ Bignum primegen(int bits, int modulus, int residue, Bignum factor, moduli[NPRIMES] = modulus; residues[NPRIMES] = (bignum_mod_short(p, (unsigned short) modulus) + modulus - residue); + if (factor) + multipliers[NPRIMES] = bignum_mod_short(factor, modulus); + else + multipliers[NPRIMES] = 1; delta = 0; while (1) { for (i = 0; i < (sizeof(moduli) / sizeof(*moduli)); i++) @@ -1378,6 +1382,7 @@ Bignum primegen(int bits, int modulus, int residue, Bignum factor, * It didn't. Therefore, w is a witness for the * compositeness of p. */ + freebn(wqp); freebn(p); freebn(pm1); freebn(q);