Lines Matching refs:prime
54 /* multi-prime is only supported with the builtin key generation */
61 * have to honour it in 2-prime case and assume that it wouldn't
62 * know what to do with multi-prime key generated by builtin
78 BIGNUM *r0 = NULL, *r1 = NULL, *r2 = NULL, *tmp, *prime;
149 /* initialize multi-prime components */
180 prime = rsa->p;
182 prime = rsa->q;
185 prime = pinfo->r;
187 BN_set_flags(prime, BN_FLG_CONSTTIME);
191 if (!BN_generate_prime_ex2(prime, bitsr[i] + adj, 0, NULL, NULL,
195 * prime should not be equal to p, q, r_3...
212 if (!BN_cmp(prime, prev_prime)) {
217 if (!BN_sub(r2, prime, BN_value_one()))
246 if (!BN_mul(r1, rsa->n, prime, ctx))
257 * 0xF). If so, re-generate the last prime.
259 * NOTE: This actually can't happen in two-prime case, because of
262 * Besides, another consideration is, for multi-prime case, even the
264 * 0x8, which could be utilized to distinguish a multi-prime private
277 * Otherwise, we just re-generate the prime with the same length.
282 * 2. stay the same logic with normal 2-prime key
295 * in 4 prime case to avoid long loop. Max retry times
305 /* save product of primes for further use, for multi-prime only */
331 /* multi-prime */
434 * Only multi-prime keys or insecure keys with a small key length or a