Lines Matching refs:bits
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,
74 static int calc_trial_divisions(int bits) in calc_trial_divisions() argument
76 if (bits <= 512) in calc_trial_divisions()
78 else if (bits <= 1024) in calc_trial_divisions()
80 else if (bits <= 2048) in calc_trial_divisions()
82 else if (bits <= 4096) in calc_trial_divisions()
94 static int bn_mr_min_checks(int bits) in bn_mr_min_checks() argument
96 if (bits > 2048) in bn_mr_min_checks()
123 int BN_generate_prime_ex2(BIGNUM *ret, int bits, int safe, in BN_generate_prime_ex2() argument
131 int checks = bn_mr_min_checks(bits); in BN_generate_prime_ex2()
133 if (bits < 2) { in BN_generate_prime_ex2()
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()
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
492 int trial_divisions = calc_trial_divisions(bits); in probable_prime()
496 if (!BN_priv_rand_ex(rnd, bits, BN_RAND_TOP_TWO, BN_RAND_BOTTOM_ODD, 0, in probable_prime()
518 if (bits <= 31 && delta <= 0x7fffffff in probable_prime()
531 if (BN_num_bits(rnd) != bits) in probable_prime()
545 static int probable_prime_dh(BIGNUM *rnd, int bits, int safe, prime_t *mods, in probable_prime_dh() argument
552 int trial_divisions = calc_trial_divisions(bits); in probable_prime_dh()
563 if (!BN_rand_ex(rnd, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD, 0, ctx)) in probable_prime_dh()
580 if (BN_num_bits(rnd) < bits in probable_prime_dh()
597 if (bits <= 31 && delta <= 0x7fffffff in probable_prime_dh()