Lines Matching refs:w
27 static int bn_is_prime_int(const BIGNUM *w, int checks, BN_CTX *ctx,
234 int BN_is_prime_fasttest_ex(const BIGNUM *w, int checks, BN_CTX *ctx, in BN_is_prime_fasttest_ex() argument
237 return ossl_bn_check_prime(w, checks, ctx, do_trial_division, cb); in BN_is_prime_fasttest_ex()
242 int ossl_bn_check_prime(const BIGNUM *w, int checks, BN_CTX *ctx, in ossl_bn_check_prime() argument
245 int min_checks = bn_mr_min_checks(BN_num_bits(w)); in ossl_bn_check_prime()
250 return bn_is_prime_int(w, checks, ctx, do_trial_division, cb); in ossl_bn_check_prime()
258 int ossl_bn_check_generated_prime(const BIGNUM *w, int checks, BN_CTX *ctx, in ossl_bn_check_generated_prime() argument
261 return bn_is_prime_int(w, checks, ctx, 1, cb); in ossl_bn_check_generated_prime()
275 static int bn_is_prime_int(const BIGNUM *w, int checks, BN_CTX *ctx, in bn_is_prime_int() argument
288 if (BN_cmp(w, BN_value_one()) <= 0) in bn_is_prime_int()
292 if (BN_is_odd(w)) { in bn_is_prime_int()
294 if (BN_is_word(w, 3)) in bn_is_prime_int()
298 return BN_is_word(w, 2); in bn_is_prime_int()
303 int trial_divisions = calc_trial_divisions(BN_num_bits(w)); in bn_is_prime_int()
306 BN_ULONG mod = BN_mod_word(w, primes[i]); in bn_is_prime_int()
310 return BN_is_word(w, primes[i]); in bn_is_prime_int()
320 if (!ossl_bn_miller_rabin_is_prime(w, checks, ctx, cb, 0, &status)) { in bn_is_prime_int()
347 int ossl_bn_miller_rabin_is_prime(const BIGNUM *w, int iterations, BN_CTX *ctx, in ossl_bn_miller_rabin_is_prime() argument
355 if (!BN_is_odd(w)) in ossl_bn_miller_rabin_is_prime()
369 && BN_copy(w1, w) in ossl_bn_miller_rabin_is_prime()
372 && BN_copy(w3, w) in ossl_bn_miller_rabin_is_prime()
390 if (mont == NULL || !BN_MONT_CTX_set(mont, w, ctx)) in ossl_bn_miller_rabin_is_prime()
394 iterations = bn_mr_min_checks(BN_num_bits(w)); in ossl_bn_miller_rabin_is_prime()
405 if (!BN_gcd(g, b, w, ctx)) in ossl_bn_miller_rabin_is_prime()
415 if (!BN_mod_exp_mont(z, b, m, w, ctx, mont)) in ossl_bn_miller_rabin_is_prime()
423 if (!BN_copy(x, z) || !BN_mod_mul(z, x, x, w, ctx)) in ossl_bn_miller_rabin_is_prime()
434 if (!BN_copy(x, z) || !BN_mod_mul(z, x, x, w, ctx)) in ossl_bn_miller_rabin_is_prime()
445 if (!BN_sub_word(x, 1) || !BN_gcd(g, x, w, ctx)) in ossl_bn_miller_rabin_is_prime()