Lines Matching refs:range
131 static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range, in bnrand_range() argument
142 if (range->neg || BN_is_zero(range)) { in bnrand_range()
147 n = BN_num_bits(range); /* n > 0 */ in bnrand_range()
153 else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3)) { in bnrand_range()
169 if (BN_cmp(r, range) >= 0) { in bnrand_range()
170 if (!BN_sub(r, r, range)) in bnrand_range()
172 if (BN_cmp(r, range) >= 0) in bnrand_range()
173 if (!BN_sub(r, r, range)) in bnrand_range()
183 while (BN_cmp(r, range) >= 0); in bnrand_range()
196 while (BN_cmp(r, range) >= 0); in bnrand_range()
203 int BN_rand_range_ex(BIGNUM *r, const BIGNUM *range, unsigned int strength, in BN_rand_range_ex() argument
206 return bnrand_range(NORMAL, r, range, strength, ctx); in BN_rand_range_ex()
210 int BN_rand_range(BIGNUM *r, const BIGNUM *range) in BN_rand_range() argument
212 return bnrand_range(NORMAL, r, range, 0, NULL); in BN_rand_range()
216 int BN_priv_rand_range_ex(BIGNUM *r, const BIGNUM *range, unsigned int strength, in BN_priv_rand_range_ex() argument
219 return bnrand_range(PRIVATE, r, range, strength, ctx); in BN_priv_rand_range_ex()
223 int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range) in BN_priv_rand_range() argument
225 return bnrand_range(PRIVATE, r, range, 0, NULL); in BN_priv_rand_range()
234 int BN_pseudo_rand_range(BIGNUM *r, const BIGNUM *range) in BN_pseudo_rand_range() argument
236 return BN_rand_range(r, range); in BN_pseudo_rand_range()
241 int ossl_bn_priv_rand_range_fixed_top(BIGNUM *r, const BIGNUM *range, in ossl_bn_priv_rand_range_fixed_top() argument
252 if (range->neg || BN_is_zero(range)) { in ossl_bn_priv_rand_range_fixed_top()
257 n = BN_num_bits(range); /* n > 0 */ in ossl_bn_priv_rand_range_fixed_top()
276 while (BN_ucmp(r, range) >= 0); in ossl_bn_priv_rand_range_fixed_top()
294 int ossl_bn_gen_dsa_nonce_fixed_top(BIGNUM *out, const BIGNUM *range, in ossl_bn_gen_dsa_nonce_fixed_top() argument
308 const unsigned num_k_bytes = BN_num_bytes(range) + 1; in ossl_bn_gen_dsa_nonce_fixed_top()
373 ossl_bn_mask_bits_fixed_top(out, BN_num_bits(range)); in ossl_bn_gen_dsa_nonce_fixed_top()
375 if (BN_ucmp(out, range) < 0) { in ossl_bn_gen_dsa_nonce_fixed_top()
397 int BN_generate_dsa_nonce(BIGNUM *out, const BIGNUM *range, in BN_generate_dsa_nonce() argument
403 ret = ossl_bn_gen_dsa_nonce_fixed_top(out, range, priv, message, in BN_generate_dsa_nonce()