Lines Matching refs:safe
22 static int probable_prime(BIGNUM *rnd, int bits, int safe, prime_t *mods,
24 static int probable_prime_dh(BIGNUM *rnd, int bits, int safe, prime_t *mods,
123 int BN_generate_prime_ex2(BIGNUM *ret, int bits, int safe, in BN_generate_prime_ex2() argument
137 } else if (add == NULL && safe && bits < 6 && bits != 3) { in BN_generate_prime_ex2()
158 if (!probable_prime(ret, bits, safe, mods, ctx)) in BN_generate_prime_ex2()
161 if (!probable_prime_dh(ret, bits, safe, mods, add, rem, ctx)) in BN_generate_prime_ex2()
169 if (!safe) { in BN_generate_prime_ex2()
211 int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, in BN_generate_prime_ex() argument
220 retval = BN_generate_prime_ex2(ret, bits, safe, add, rem, cb, ctx); in BN_generate_prime_ex()
487 static int probable_prime(BIGNUM *rnd, int bits, int safe, prime_t *mods, in probable_prime() argument
499 if (safe && !BN_set_bit(rnd, 1)) in probable_prime()
521 if (safe ? (mods[i] + delta) % primes[i] <= 1 in probable_prime()
523 delta += safe ? 4 : 2; in probable_prime()
545 static int probable_prime_dh(BIGNUM *rnd, int bits, int safe, prime_t *mods, in probable_prime_dh() argument
573 if (!BN_add_word(rnd, safe ? 3u : 1u)) in probable_prime_dh()
581 || BN_get_word(rnd) < (safe ? 5u : 3u)) { in probable_prime_dh()
601 if (safe ? (mods[i] + delta) % primes[i] <= 1 in probable_prime_dh()