/freebsd/tests/sys/sys/ |
H A D | bitstring_test.c | 39 typedef void (testfunc_t)(bitstr_t *bstr, int nbits, const char *memloc); 42 bitstring_run_stack_test(testfunc_t *test, int nbits) in bitstring_run_stack_test() argument 44 bitstr_t bit_decl(bitstr, nbits); in bitstring_run_stack_test() 46 test(bitstr, nbits, "stack"); in bitstring_run_stack_test() 50 bitstring_run_heap_test(testfunc_t *test, int nbits) in bitstring_run_heap_test() argument 52 bitstr_t *bitstr = bit_alloc(nbits); in bitstring_run_heap_test() 54 test(bitstr, nbits, "heap"); in bitstring_run_heap_test() 89 name ## _test(bitstr_t *bitstr, int nbits, const char *memloc) 120 memset(bitstr, 0, bitstr_size(nbits)); in BITSTRING_TC_DEFINE() 122 for (int i = 0; i < nbits; i++) { in BITSTRING_TC_DEFINE() [all …]
|
/freebsd/contrib/jemalloc/include/jemalloc/internal/ |
H A D | bitmap.h | 36 #define BITMAP_BITS2GROUPS(nbits) \ argument 37 (((nbits) + BITMAP_GROUP_NBITS_MASK) >> LG_BITMAP_GROUP_NBITS) 42 #define BITMAP_GROUPS_L0(nbits) \ argument 43 BITMAP_BITS2GROUPS(nbits) 44 #define BITMAP_GROUPS_L1(nbits) \ argument 45 BITMAP_BITS2GROUPS(BITMAP_BITS2GROUPS(nbits)) 46 #define BITMAP_GROUPS_L2(nbits) \ argument 47 BITMAP_BITS2GROUPS(BITMAP_BITS2GROUPS(BITMAP_BITS2GROUPS((nbits)))) 48 #define BITMAP_GROUPS_L3(nbits) \ argument 50 BITMAP_BITS2GROUPS((nbits))))) [all …]
|
/freebsd/contrib/jemalloc/src/ |
H A D | bitmap.c | 12 bitmap_info_init(bitmap_info_t *binfo, size_t nbits) { in bitmap_info_init() argument 16 assert(nbits > 0); in bitmap_info_init() 17 assert(nbits <= (ZU(1) << LG_BITMAP_MAXBITS)); in bitmap_info_init() 25 group_count = BITMAP_BITS2GROUPS(nbits); in bitmap_info_init() 36 binfo->nbits = nbits; in bitmap_info_init() 67 extra = (BITMAP_GROUP_NBITS - (binfo->nbits & BITMAP_GROUP_NBITS_MASK)) in bitmap_init() 86 bitmap_info_init(bitmap_info_t *binfo, size_t nbits) { in bitmap_info_init() argument 87 assert(nbits > 0); in bitmap_info_init() 88 assert(nbits <= (ZU(1) << LG_BITMAP_MAXBITS)); in bitmap_info_init() 90 binfo->ngroups = BITMAP_BITS2GROUPS(nbits); in bitmap_info_init() [all …]
|
/freebsd/contrib/gdtoa/ |
H A D | gethex.c | 48 int big, esign, havedig, irv, j, k, n, n0, nbits, up, zret; local 187 nbits = fpi->nbits; 188 n0 = n = nbits >> kshift; 189 if (nbits & kmask) 197 b->x[j] = ULbits >> (ULbits - (nbits & kmask)); 232 nbits = fpi->nbits; 235 if (n > nbits) { 236 n -= nbits; 249 else if (n < nbits) { 250 n = nbits - n; [all …]
|
H A D | hexnan.c | 62 int havedig, hd0, i, nbits; local 66 nbits = fpi->nbits; 67 x = x0 + (nbits >> kshift); 68 if (nbits & kmask) 138 if ( (i = nbits & (ULbits-1)) !=0)
|
H A D | strtodg.c | 186 bdif -= nb = fpi->nbits; 327 int j, k, nbits, nd, nd0, nf, nz, nz0, rd, rvbits, rve, rve1, sign; local 361 nbits = fpi->nbits; 555 if (nbits <= P && nd <= DBL_DIG) { 670 if ((j = rvbits - nbits) > 0) { 672 rvbits = nbits; 676 e2 = rve + rvbits - nbits; 679 rve1 = rve + rvbits - nbits; 736 j = nbits + 1 - bbbits; 737 i = bbe + bbbits - nbits; [all …]
|
H A D | gdtoa.c | 36 bitstob(bits, nbits, bbits) ULong *bits; int nbits; int *bbits; in bitstob() argument 38 bitstob(ULong *bits, int nbits, int *bbits) 47 while(i < nbits) { 56 be = bits + ((nbits - 1) >> kshift); 157 int j, j1, k, k0, k_check, kind, leftright, m2, m5, nbits; local 188 b = bitstob(bits, nbits = fpi->nbits, &bbits); 295 i = (int)(nbits * .30103) + 3; 506 i = nbits - bbits;
|
/freebsd/sbin/ipf/libipf/ |
H A D | ntomask.c | 13 ntomask(int family, int nbits, u_32_t *ap) in ntomask() argument 17 if (nbits < 0) in ntomask() 23 if (nbits > 32 || use_inet6 == 1) in ntomask() 25 if (nbits == 0) { in ntomask() 29 mask <<= (32 - nbits); in ntomask() 36 if ((nbits > 128) || (use_inet6 == -1)) in ntomask() 38 fill6bits(nbits, ap); in ntomask()
|
/freebsd/crypto/openssl/crypto/rsa/ |
H A D | rsa_sp800_56b_check.c | 88 int ossl_rsa_check_prime_factor_range(const BIGNUM *p, int nbits, BN_CTX *ctx) in ossl_rsa_check_prime_factor_range() argument 94 nbits >>= 1; in ossl_rsa_check_prime_factor_range() 95 shift = nbits - BN_num_bits(&ossl_bn_inv_sqrt_2); in ossl_rsa_check_prime_factor_range() 98 if (BN_num_bits(p) != nbits) in ossl_rsa_check_prime_factor_range() 136 int ossl_rsa_check_prime_factor(BIGNUM *p, BIGNUM *e, int nbits, BN_CTX *ctx) in ossl_rsa_check_prime_factor() argument 144 || ossl_rsa_check_prime_factor_range(p, nbits, ctx) != 1) in ossl_rsa_check_prime_factor() 175 int ossl_rsa_check_private_exponent(const RSA *rsa, int nbits, BN_CTX *ctx) in ossl_rsa_check_private_exponent() argument 181 if (BN_num_bits(rsa->d) <= (nbits >> 1)) in ossl_rsa_check_private_exponent() 243 int nbits) in ossl_rsa_check_pminusq_diff() argument 245 int bitlen = (nbits >> 1) - 100; in ossl_rsa_check_pminusq_diff() [all …]
|
H A D | rsa_sp800_56b_gen.c | 58 int nbits, const BIGNUM *e, BN_CTX *ctx, in ossl_rsa_fips186_4_gen_prob_primes() argument 91 if (nbits < RSA_FIPS1864_MIN_KEYGEN_KEYSIZE) { in ossl_rsa_fips186_4_gen_prob_primes() 126 nbits, e, ctx, cb)) in ossl_rsa_fips186_4_gen_prob_primes() 131 Xq2, nbits, e, ctx, cb)) in ossl_rsa_fips186_4_gen_prob_primes() 135 ok = ossl_rsa_check_pminusq_diff(tmp, Xpo, Xqo, nbits); in ossl_rsa_fips186_4_gen_prob_primes() 142 ok = ossl_rsa_check_pminusq_diff(tmp, rsa->p, rsa->q, nbits); in ossl_rsa_fips186_4_gen_prob_primes() 173 int ossl_rsa_sp800_56b_validate_strength(int nbits, int strength) in ossl_rsa_sp800_56b_validate_strength() argument 175 int s = (int)ossl_ifc_ffc_compute_security_bits(nbits); in ossl_rsa_sp800_56b_validate_strength() 194 static int rsa_validate_rng_strength(EVP_RAND_CTX *rng, int nbits) in rsa_validate_rng_strength() argument 203 if (EVP_RAND_get_strength(rng) < ossl_ifc_ffc_compute_security_bits(nbits)) { in rsa_validate_rng_strength() [all …]
|
H A D | rsa_local.h | 165 int ossl_rsa_sp800_56b_validate_strength(int nbits, int strength); 167 int nbits); 173 int ossl_rsa_check_private_exponent(const RSA *rsa, int nbits, BN_CTX *ctx); 174 int ossl_rsa_check_prime_factor(BIGNUM *p, BIGNUM *e, int nbits, BN_CTX *ctx); 175 int ossl_rsa_check_prime_factor_range(const BIGNUM *p, int nbits, BN_CTX *ctx); 182 int strength, int nbits); 183 int ossl_rsa_sp800_56b_generate_key(RSA *rsa, int nbits, const BIGNUM *efixed, 186 int ossl_rsa_sp800_56b_derive_params_from_pq(RSA *rsa, int nbits, 189 int nbits, const BIGNUM *e, BN_CTX *ctx,
|
/freebsd/sys/cddl/compat/opensolaris/sys/ |
H A D | bitmap.h | 92 #define BT_BITOUL(nbits) \ argument 93 (((nbits) + BT_NBIPUL - 1l) / BT_NBIPUL) 94 #define BT_SIZEOFMAP(nbits) \ argument 95 (BT_BITOUL(nbits) * sizeof (ulong_t)) 104 #define BT_BITOUL32(nbits) \ argument 105 (((nbits) + BT_NBIPUL32 - 1l) / BT_NBIPUL32) 106 #define BT_SIZEOFMAP32(nbits) \ argument 107 (BT_BITOUL32(nbits) * sizeof (uint_t))
|
/freebsd/crypto/openssh/ |
H A D | kexgexs.c | 75 u_int min = 0, max = 0, nbits = 0; in input_kex_dh_gex_request() local 82 (r = sshpkt_get_u32(ssh, &nbits)) != 0 || in input_kex_dh_gex_request() 86 kex->nbits = nbits; in input_kex_dh_gex_request() 91 nbits = MAXIMUM(DH_GRP_MIN, nbits); in input_kex_dh_gex_request() 92 nbits = MINIMUM(DH_GRP_MAX, nbits); in input_kex_dh_gex_request() 94 if (kex->max < kex->min || kex->nbits < kex->min || in input_kex_dh_gex_request() 95 kex->max < kex->nbits || kex->max < DH_GRP_MIN) { in input_kex_dh_gex_request() 101 kex->dh = PRIVSEP(choose_dh(min, nbits, max)); in input_kex_dh_gex_request() 175 kex->min, kex->nbits, kex->max, in input_kex_dh_gex_init()
|
H A D | kexgexc.c | 64 u_int nbits; in kexgex_client() local 66 nbits = dh_estimate(kex->dh_need * 8); in kexgex_client() 70 kex->nbits = nbits; in kexgex_client() 72 kex->nbits = MINIMUM(kex->nbits, 4096); in kexgex_client() 76 (r = sshpkt_put_u32(ssh, kex->nbits)) != 0 || in kexgex_client() 81 kex->min, kex->nbits, kex->max); in kexgex_client() 84 kex->min, kex->nbits, kex->max); in kexgex_client() 197 kex->min, kex->nbits, kex->max, in input_kex_dh_gex_reply()
|
/freebsd/sys/cddl/contrib/opensolaris/uts/common/sys/ |
H A D | bitmap.h | 105 #define BT_BITOUL(nbits) \ argument 106 (((nbits) + BT_NBIPUL - 1l) / BT_NBIPUL) 107 #define BT_SIZEOFMAP(nbits) \ argument 108 (BT_BITOUL(nbits) * sizeof (ulong_t)) 117 #define BT_BITOUL32(nbits) \ argument 118 (((nbits) + BT_NBIPUL32 - 1l) / BT_NBIPUL32) 119 #define BT_SIZEOFMAP32(nbits) \ argument 120 (BT_BITOUL32(nbits) * sizeof (uint_t)) 144 extern index_t bt_availbit(ulong_t *bitmap, size_t nbits);
|
/freebsd/contrib/ntp/libntp/lib/isc/ |
H A D | netaddr.c | 76 unsigned int nbits; /* Number of significant leftover bits */ in isc_netaddr_eqprefix() local 108 nbits = prefixlen % 8; in isc_netaddr_eqprefix() 114 if (nbits > 0) { in isc_netaddr_eqprefix() 117 INSIST(nbits < 8); in isc_netaddr_eqprefix() 120 mask = (0xFF << (8-nbits)) & 0xFF; in isc_netaddr_eqprefix() 218 unsigned int nbits, nbytes, ipbytes = 0; in isc_netaddr_prefixok() local 238 nbits = prefixlen % 8; in isc_netaddr_prefixok() 239 if (nbits != 0) { in isc_netaddr_prefixok() 240 if ((p[nbytes] & (0xff>>nbits)) != 0U) in isc_netaddr_prefixok() 251 unsigned int nbits = 0, nbytes = 0, ipbytes = 0, i; in isc_netaddr_masktoprefixlen() local [all …]
|
/freebsd/crypto/openssl/crypto/dsa/ |
H A D | dsa_pmeth.c | 29 int nbits; /* size of p in bits (default: 2048) */ member 44 dctx->nbits = 2048; in pkey_dsa_init() 64 dctx->nbits = sctx->nbits; in pkey_dsa_copy() 131 dctx->nbits = p1; in pkey_dsa_ctrl() 190 int nbits; in pkey_dsa_ctrl_str() local 191 nbits = atoi(value); in pkey_dsa_ctrl_str() 192 return EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits); in pkey_dsa_ctrl_str() 233 FFC_PARAM_TYPE_DSA, dctx->nbits, in pkey_dsa_paramgen()
|
/freebsd/crypto/openssl/crypto/bn/ |
H A D | bn_x931p.c | 162 int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx) in BN_X931_generate_Xpq() argument 170 if ((nbits < 1024) || (nbits & 0xff)) in BN_X931_generate_Xpq() 172 nbits >>= 1; in BN_X931_generate_Xpq() 178 if (!BN_priv_rand_ex(Xp, nbits, BN_RAND_TOP_TWO, BN_RAND_BOTTOM_ANY, 0, in BN_X931_generate_Xpq() 188 if (!BN_priv_rand_ex(Xq, nbits, BN_RAND_TOP_TWO, BN_RAND_BOTTOM_ANY, 0, in BN_X931_generate_Xpq() 195 if (BN_num_bits(t) > (nbits - 100)) in BN_X931_generate_Xpq()
|
H A D | bn_rsa_fips186_4.c | 60 static int bn_rsa_fips186_5_aux_prime_min_size(int nbits) in bn_rsa_fips186_5_aux_prime_min_size() argument 62 if (nbits >= 4096) in bn_rsa_fips186_5_aux_prime_min_size() 64 if (nbits >= 3072) in bn_rsa_fips186_5_aux_prime_min_size() 66 if (nbits >= 2048) in bn_rsa_fips186_5_aux_prime_min_size() 80 static int bn_rsa_fips186_5_aux_prime_max_sum_size_for_prob_primes(int nbits) in bn_rsa_fips186_5_aux_prime_max_sum_size_for_prob_primes() argument 82 if (nbits >= 4096) in bn_rsa_fips186_5_aux_prime_max_sum_size_for_prob_primes() 84 if (nbits >= 3072) in bn_rsa_fips186_5_aux_prime_max_sum_size_for_prob_primes() 86 if (nbits >= 2048) in bn_rsa_fips186_5_aux_prime_max_sum_size_for_prob_primes()
|
/freebsd/sys/contrib/openzfs/include/sys/ |
H A D | bitmap.h | 78 #define BT_BITOUL(nbits) \ argument 79 (((nbits) + BT_NBIPUL - 1l) / BT_NBIPUL) 80 #define BT_SIZEOFMAP(nbits) \ argument 81 (BT_BITOUL(nbits) * sizeof (ulong_t))
|
/freebsd/crypto/openssl/crypto/modes/ |
H A D | cfb128.c | 151 int nbits, const void *key, in cfbr_encrypt_block() argument 159 if (nbits <= 0 || nbits > 128) in cfbr_encrypt_block() 166 num = (nbits + 7) / 8; in cfbr_encrypt_block() 174 rem = nbits % 8; in cfbr_encrypt_block() 175 num = nbits / 8; in cfbr_encrypt_block()
|
/freebsd/usr.sbin/makefs/zfs/ |
H A D | vdev.c | 238 int align, loc, minblksz, nbits; in vdev_space_alloc() local 255 for (loc = 0, nbits = len / minblksz;; loc = roundup2(loc, align)) { in vdev_space_alloc() 256 bit_ffc_area_at(zfs->spacemap, loc, zfs->spacemapbits, nbits, in vdev_space_alloc() 265 assert(loc + nbits > loc); in vdev_space_alloc() 266 bit_nset(zfs->spacemap, loc, loc + nbits - 1); in vdev_space_alloc() 275 uint64_t nbits; in vdev_spacemap_init() local 279 nbits = rounddown2(zfs->asize, zfs->mssize) >> zfs->ashift; in vdev_spacemap_init() 280 if (nbits > INT_MAX) { in vdev_spacemap_init() 287 zfs->spacemapbits = (int)nbits; in vdev_spacemap_init()
|
/freebsd/usr.sbin/bsdconfig/networking/share/ |
H A D | ipaddr.subr | 186 local nbits="${_ipaddr#*/}" n=0 190 # Taint-check $nbits to be (a) a positive whole-integer, 194 ( f_isinteger "$nbits" && [ $nbits -ge 0 -a $nbits -le 32 ] ) \ 199 (65280 >> ($nbits - 8 * $n) & 255) 200 * ((8*$n) < $nbits & $nbits <= (8*($n+1))) 201 + 255 * ($nbits > (8*($n+1)))
|
/freebsd/crypto/openssl/apps/ |
H A D | gendsa.c | 63 int ret = 1, private = 0, verbose = 0, nbits; in gendsa_main() local 130 nbits = EVP_PKEY_get_bits(pkey); in gendsa_main() 131 if (nbits > OPENSSL_DSA_MAX_MODULUS_BITS) in gendsa_main() 148 pkey = app_keygen(ctx, "DSA", nbits, verbose); in gendsa_main()
|
/freebsd/cddl/contrib/opensolaris/lib/libdtrace/common/ |
H A D | dt_regset.c | 98 ulong_t nbits = drp->dr_size - 1; in dt_regset_alloc() local 99 ulong_t maxw = nbits >> BT_ULSHIFT; in dt_regset_alloc() 108 ulong_t maxb = (wx == maxw) ? nbits & BT_ULMASK : BT_NBIPUL - 1; in dt_regset_alloc()
|