Lines Matching refs:rnd

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,
487 static int probable_prime(BIGNUM *rnd, int bits, int safe, prime_t *mods, in probable_prime() argument
496 if (!BN_priv_rand_ex(rnd, bits, BN_RAND_TOP_TWO, BN_RAND_BOTTOM_ODD, 0, in probable_prime()
499 if (safe && !BN_set_bit(rnd, 1)) in probable_prime()
503 BN_ULONG mod = BN_mod_word(rnd, (BN_ULONG)primes[i]); in probable_prime()
519 && square(primes[i]) > BN_get_word(rnd) + delta) in probable_prime()
529 if (!BN_add_word(rnd, delta)) in probable_prime()
531 if (BN_num_bits(rnd) != bits) in probable_prime()
533 bn_check_top(rnd); in probable_prime()
545 static int probable_prime_dh(BIGNUM *rnd, int bits, int safe, prime_t *mods, in probable_prime_dh() argument
563 if (!BN_rand_ex(rnd, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD, 0, ctx)) in probable_prime_dh()
568 if (!BN_mod(t1, rnd, add, ctx)) in probable_prime_dh()
570 if (!BN_sub(rnd, rnd, t1)) in probable_prime_dh()
573 if (!BN_add_word(rnd, safe ? 3u : 1u)) in probable_prime_dh()
576 if (!BN_add(rnd, rnd, rem)) in probable_prime_dh()
580 if (BN_num_bits(rnd) < bits in probable_prime_dh()
581 || BN_get_word(rnd) < (safe ? 5u : 3u)) { in probable_prime_dh()
582 if (!BN_add(rnd, rnd, add)) in probable_prime_dh()
588 BN_ULONG mod = BN_mod_word(rnd, (BN_ULONG)primes[i]); in probable_prime_dh()
598 && square(primes[i]) > BN_get_word(rnd) + delta) in probable_prime_dh()
609 if (!BN_add_word(rnd, delta)) in probable_prime_dh()
615 bn_check_top(rnd); in probable_prime_dh()