/freebsd/sys/ufs/ufs/ |
H A D | ufs_bmap.c | 156 ufs2_daddr_t bn, in ufs_bmaparray() argument 188 error = ufs_getlbns(vp, bn, ap, nump); in ufs_bmaparray() 194 if (bn >= 0 && bn < UFS_NDADDR) { in ufs_bmaparray() 195 *bnp = blkptrtodb(ump, DIP(ip, i_db[bn])); in ufs_bmaparray() 196 } else if (bn < 0 && bn >= -UFS_NXADDR) { in ufs_bmaparray() 197 *bnp = blkptrtodb(ump, ip->i_din2->di_extb[-1 - bn]); in ufs_bmaparray() 218 if (IS_SNAPSHOT(ip) && DIP(ip, i_db[bn]) > 0 && in ufs_bmaparray() 219 DIP(ip, i_db[bn]) < ump->um_seqinc) { in ufs_bmaparray() 223 bn * ump->um_seqinc) : -1; in ufs_bmaparray() 225 ufs2_daddr_t bnb = bn; in ufs_bmaparray() [all …]
|
/freebsd/crypto/openssl/test/ |
H A D | bntests.pl | 17 sub bn subroutine 33 my $sum = bn($s{'Sum'}); 34 my $a = bn($s{'A'}); 35 my $b = bn($s{'B'}); 39 my $lshift1 = bn($s{'LShift1'}); 40 my $a = bn($s{'A'}); 44 my $lshift = bn($s{'LShift'}); 45 my $a = bn($s{'A'}); 46 my $n = bn($s{'N'}); 50 my $rshift = bn($s{'RShift'}); [all …]
|
H A D | bn_internal_test.c | 31 BIGNUM *bn = NULL; in test_is_prime_enhanced() local 33 ret = TEST_ptr(bn = BN_new()) in test_is_prime_enhanced() 35 && TEST_true(BN_set_word(bn, 11)) in test_is_prime_enhanced() 37 && TEST_true(ossl_bn_miller_rabin_is_prime(bn, 10, ctx, NULL, 1, in test_is_prime_enhanced() 40 BN_free(bn); in test_is_prime_enhanced() 52 BIGNUM *bn = NULL; in test_is_composite_enhanced() local 54 ret = TEST_ptr(bn = BN_new()) in test_is_composite_enhanced() 56 && TEST_true(BN_set_word(bn, composites[id])) in test_is_composite_enhanced() 57 && TEST_true(ossl_bn_miller_rabin_is_prime(bn, 10, ctx, NULL, 1, in test_is_composite_enhanced() 61 BN_free(bn); in test_is_composite_enhanced()
|
H A D | bntest.c | 314 BIGNUM *bn = BN_new(); in set_signed_bn() local 316 if (bn == NULL) in set_signed_bn() 318 if (!BN_set_word(bn, value < 0 ? -value : value)) { in set_signed_bn() 319 BN_free(bn); in set_signed_bn() 322 BN_set_negative(bn, value < 0); in set_signed_bn() 323 return bn; in set_signed_bn() 1849 BIGNUM *bn = NULL; in test_dec2bn() local 1852 if (!TEST_int_eq(parsedecBN(&bn, "0"), 1) in test_dec2bn() 1853 || !TEST_BN_eq_word(bn, 0) in test_dec2bn() 1854 || !TEST_BN_eq_zero(bn) in test_dec2bn() [all …]
|
/freebsd/contrib/less/ |
H A D | ch.c | 45 #define bufnode_buf(bn) ((struct buf *) bn) 81 #define FOR_BUFS(bn) \ 82 for (bn = ch_bufhead; bn != END_OF_CHAIN; bn = bn->next) 84 #define BUF_RM(bn) \ 85 (bn)->next->prev = (bn) 52 bufnode_buf(bn) global() argument 88 FOR_BUFS(bn) global() argument 91 BUF_RM(bn) global() argument 95 BUF_INS_HEAD(bn) global() argument 101 BUF_INS_TAIL(bn) global() argument 110 FOR_BUFS_IN_CHAIN(h,bn) global() argument 114 BUF_HASH_RM(bn) global() argument 118 BUF_HASH_INS(bn,h) global() argument 151 struct bufnode *bn; ch_get() local 404 struct bufnode *bn; sync_logfile() local 442 struct bufnode *bn; buffered() local 525 struct bufnode *bn; ch_end_buffer_seek() local 551 struct bufnode *bn; ch_beg_seek() local 668 struct bufnode *bn; ch_flush() local 742 struct bufnode *bn; ch_addbuf() local 779 struct bufnode *bn; ch_delbufs() local [all...] |
/freebsd/sys/fs/ext2fs/ |
H A D | ext2_bmap.c | 91 ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bnp, int *runp, int *runb) in ext4_bmapext() argument 107 lbn = bn; in ext4_bmapext() 210 ext2_bmaparray(struct vnode *vp, daddr_t bn, daddr_t *bnp, int *runp, int *runb) in ext2_bmaparray() argument 238 error = ext2_getlbns(vp, bn, ap, nump); in ext2_bmaparray() 244 *bnp = blkptrtodb(ump, ip->i_db[bn]); in ext2_bmaparray() 248 daddr_t bnb = bn; in ext2_bmaparray() 250 for (++bn; bn < EXT2_NDADDR && *runp < maxrun && in ext2_bmaparray() 251 is_sequential(ump, ip->i_db[bn - 1], ip->i_db[bn]); in ext2_bmaparray() 252 ++bn, ++*runp); in ext2_bmaparray() 253 bn = bnb; in ext2_bmaparray() [all …]
|
/freebsd/contrib/bc/include/ |
H A D | library.h | 99 #define BCL_CHECK_NUM_GEN(c, bn) \ argument 102 size_t gen_ = BCL_GET_GEN(bn); \ 103 BclNum* ptr_ = BCL_NUM(c, bn); \ 115 #define BCL_CHECK_NUM_VALID(c, bn) \ argument 118 size_t idx_ = BCL_NO_GEN(bn); \ 123 BCL_CHECK_NUM_GEN(c, bn); \ 129 * @param bn The number. 132 #define BCL_NUM_ARRAY(bn) ((bn)->n.num) argument 136 * @param bn Th 139 BCL_NUM_ARRAY_NP(bn) global() argument 146 BCL_NUM_NUM(bn) global() argument 153 BCL_NUM_NUM_NP(bn) global() argument 178 BCL_CHECK_NUM_GEN(c,bn) global() argument 181 BCL_NUM_ARRAY(bn) global() argument 182 BCL_NUM_ARRAY_NP(bn) global() argument 184 BCL_NUM_NUM(bn) global() argument 185 BCL_NUM_NUM_NP(bn) global() argument 233 BC_MAYBE_SETUP(c,e,bn,idx) global() argument [all...] |
/freebsd/crypto/openssl/crypto/bn/ |
H A D | bn_const.c | 25 BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn) in BN_get_rfc2409_prime_768() argument 41 return BN_bin2bn(RFC2409_PRIME_768, sizeof(RFC2409_PRIME_768), bn); in BN_get_rfc2409_prime_768() 53 BIGNUM *BN_get_rfc2409_prime_1024(BIGNUM *bn) in BN_get_rfc2409_prime_1024() argument 73 return BN_bin2bn(RFC2409_PRIME_1024, sizeof(RFC2409_PRIME_1024), bn); in BN_get_rfc2409_prime_1024() 86 BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *bn) in BN_get_rfc3526_prime_1536() argument 88 return COPY_BN(bn, ossl_bignum_modp_1536_p); in BN_get_rfc3526_prime_1536() 100 BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn) in BN_get_rfc3526_prime_2048() argument 102 return COPY_BN(bn, ossl_bignum_modp_2048_p); in BN_get_rfc3526_prime_2048() 113 BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn) in BN_get_rfc3526_prime_3072() argument 115 return COPY_BN(bn, ossl_bignum_modp_3072_p); in BN_get_rfc3526_prime_3072() [all …]
|
H A D | bn_conv.c | 126 int BN_hex2bn(BIGNUM **bn, const char *a) in BN_hex2bn() argument 148 if (bn == NULL) in BN_hex2bn() 152 if (*bn == NULL) { in BN_hex2bn() 156 ret = *bn; in BN_hex2bn() 191 *bn = ret; in BN_hex2bn() 198 if (*bn == NULL) in BN_hex2bn() 203 int BN_dec2bn(BIGNUM **bn, const char *a) in BN_dec2bn() argument 224 if (bn == NULL) in BN_dec2bn() 231 if (*bn == NULL) { in BN_dec2bn() 235 ret = *bn; in BN_dec2bn() [all …]
|
/freebsd/crypto/openssh/regress/unittests/sshbuf/ |
H A D | test_sshbuf_getput_crypto.c | 36 BIGNUM *bn, *bn2; in sshbuf_getput_crypto_tests() local 81 MKBN(hexbn1, bn); in sshbuf_getput_crypto_tests() 84 ASSERT_INT_EQ(sshbuf_put_bignum2(p1, bn), 0); in sshbuf_getput_crypto_tests() 86 ASSERT_U32_EQ(PEEK_U32(sshbuf_ptr(p1)), (u_int32_t)BN_num_bytes(bn)); in sshbuf_getput_crypto_tests() 88 BN_free(bn); in sshbuf_getput_crypto_tests() 93 MKBN(hexbn1, bn); in sshbuf_getput_crypto_tests() 97 r = sshbuf_put_bignum2(p1, bn); in sshbuf_getput_crypto_tests() 100 BN_free(bn); in sshbuf_getput_crypto_tests() 105 MKBN(hexbn2, bn); in sshbuf_getput_crypto_tests() 108 ASSERT_INT_EQ(sshbuf_put_bignum2(p1, bn), 0); in sshbuf_getput_crypto_tests() [all …]
|
/freebsd/crypto/openssh/regress/unittests/bitmap/ |
H A D | tests.c | 33 BIGNUM *bn; in tests() local 42 bn = BN_new(); in tests() 43 ASSERT_PTR_NE(bn, NULL); in tests() 51 BN_clear(bn); in tests() 57 ASSERT_INT_EQ(BN_set_bit(bn, i), 1); in tests() 61 ASSERT_INT_EQ(BN_set_bit(bn, j), 1); in tests() 65 ASSERT_INT_EQ(BN_set_bit(bn, k), 1); in tests() 71 ASSERT_INT_EQ(BN_is_bit_set(bn, n), in tests() 77 ASSERT_INT_EQ(BN_num_bits(bn), in tests() 79 ASSERT_INT_EQ(BN_num_bytes(bn), in tests() [all …]
|
/freebsd/usr.sbin/makefs/ffs/ |
H A D | ufs_bmap.c | 66 ufs_getlbns(struct inode *ip, daddr_t bn, struct indir *ap, int *nump) in ufs_getlbns() argument 78 realbn = bn; in ufs_getlbns() 79 if ((long)bn < 0) in ufs_getlbns() 80 bn = -(long)bn; in ufs_getlbns() 82 assert (bn >= UFS_NDADDR); in ufs_getlbns() 91 bn -= UFS_NDADDR; in ufs_getlbns() 92 for (lbc = 0, i = UFS_NIADDR;; i--, bn -= blockcnt) { in ufs_getlbns() 99 if (bn < blockcnt) in ufs_getlbns() 105 metalbn = -(realbn - bn + UFS_NIADDR - i); in ufs_getlbns() 107 metalbn = -(-realbn - bn + UFS_NIADDR - i); in ufs_getlbns() [all …]
|
/freebsd/lib/libmp/ |
H A D | mpasbn.c | 132 mp->bn = BN_new(); in _dtom() 133 if (mp->bn == NULL) in _dtom() 135 BN_ERRCHECK(msg, BN_dec2bn(&mp->bn, s)); in _dtom() 154 BN_ERRCHECK("gcd", BN_gcd(b, mp1->bn, mp2->bn, c)); in mp_gcd() 195 BN_ERRCHECK(msg, BN_add(b, mp1->bn, mp2->bn)); in _madd() 214 return (BN_cmp(mp1->bn, mp2->bn)); in mp_mcmp() 224 return (BN_ucmp(mp1->bn, mp2->bn)); in _mcmpa() 242 BN_ERRCHECK(msg, BN_div(q, r, nmp->bn, dmp->bn, c)); in _mdiv() 268 BN_clear(mp->bn); in _mfree() 269 BN_free(mp->bn); in _mfree() [all …]
|
/freebsd/crypto/openssl/crypto/ |
H A D | param_build_set.c | 70 const char *key, const BIGNUM *bn, size_t sz) in ossl_param_build_set_bn_pad() argument 73 return OSSL_PARAM_BLD_push_BN_pad(bld, key, bn, sz); in ossl_param_build_set_bn_pad() 79 return OSSL_PARAM_set_BN(p, bn); in ossl_param_build_set_bn_pad() 85 const char *key, const BIGNUM *bn) in ossl_param_build_set_bn() argument 88 return OSSL_PARAM_BLD_push_BN(bld, key, bn); in ossl_param_build_set_bn() 92 return OSSL_PARAM_set_BN(p, bn) > 0; in ossl_param_build_set_bn() 102 const BIGNUM *bn; in ossl_param_build_set_multi_key_bn() local 106 bn = sk_BIGNUM_const_value(stk, i); in ossl_param_build_set_multi_key_bn() 107 if (bn != NULL && !OSSL_PARAM_BLD_push_BN(bld, names[i], bn)) in ossl_param_build_set_multi_key_bn() 114 bn = sk_BIGNUM_const_value(stk, i); in ossl_param_build_set_multi_key_bn() [all …]
|
H A D | param_build.c | 30 const BIGNUM *bn; member 194 const BIGNUM *bn) in OSSL_PARAM_BLD_push_BN() argument 196 return OSSL_PARAM_BLD_push_BN_pad(bld, key, bn, in OSSL_PARAM_BLD_push_BN() 197 bn == NULL ? 0 : BN_num_bytes(bn)); in OSSL_PARAM_BLD_push_BN() 201 const BIGNUM *bn, size_t sz) in OSSL_PARAM_BLD_push_BN_pad() argument 206 if (bn != NULL) { in OSSL_PARAM_BLD_push_BN_pad() 207 if (BN_is_negative(bn)) { in OSSL_PARAM_BLD_push_BN_pad() 213 n = BN_num_bytes(bn); in OSSL_PARAM_BLD_push_BN_pad() 222 if (BN_get_flags(bn, BN_FLG_SECURE) == BN_FLG_SECURE) in OSSL_PARAM_BLD_push_BN_pad() 232 pd->bn = bn; in OSSL_PARAM_BLD_push_BN_pad() [all …]
|
/freebsd/crypto/openssl/apps/ |
H A D | prime.c | 45 BIGNUM *bn = NULL; in prime_main() local 102 bn = BN_new(); in prime_main() 103 if (bn == NULL) { in prime_main() 107 if (!BN_generate_prime_ex(bn, bits, safe, NULL, NULL, NULL)) { in prime_main() 111 s = hex ? BN_bn2hex(bn) : BN_bn2dec(bn); in prime_main() 123 r = BN_hex2bn(&bn, argv[0]); in prime_main() 125 r = BN_dec2bn(&bn, argv[0]); in prime_main() 132 BN_print(bio_out, bn); in prime_main() 135 BN_check_prime(bn, NULL, NULL) in prime_main() 142 BN_free(bn); in prime_main()
|
/freebsd/crypto/openssl/providers/ |
H A D | fips.module.sources | 36 crypto/bn/asm/alpha-mont.pl 37 crypto/bn/asm/armv4-gf2m.pl 38 crypto/bn/asm/armv4-mont.pl 39 crypto/bn/asm/armv8-mont.pl 40 crypto/bn/asm/bn-586.pl 41 crypto/bn/asm/c64xplus-gf2m.pl 42 crypto/bn/asm/co-586.pl 43 crypto/bn/asm/ia64-mont.pl 44 crypto/bn/asm/ia64.S 45 crypto/bn/asm/mips-mont.pl [all …]
|
H A D | fips-sources.checksums | 36 155eff9d747eed808398cfa2af4b276dfc1f9aac8a0f9d801b314ab3f2bf5b56 crypto/bn/asm/alpha-mont.pl 37 894cc71b2d783e4e1b54dbef45e9e9280165a2c43981ebdd03282f0e90914928 crypto/bn/asm/armv4-gf2m.pl 38 0d2e31dc9cdce02c619adfc9ac720ccf7171384e76a84cdf0e686a805dd7006e crypto/bn/asm/armv4-mont.pl 39 d7df31176f725c1ae7241fee8f681fdcf2ab9eb4d3cc6c80d49c2248ae40a56a crypto/bn/asm/armv8-mont.pl 40 cb4ad7b7461fcb8e2a0d52881158d0211b79544842d4eae36fc566869a2d62c8 crypto/bn/asm/bn-586.pl 41 10fb73a6cc1bc064ebdcf6d7fe3c7407ea1c28b0d65ad0123046f8b1518fa75a crypto/bn/asm/c64xplus-gf2m.pl 42 c86664fb974362ee52a454c83c2c4b23fd5b7d64b3c9e23ef1e0dfd130a46ee5 crypto/bn/asm/co-586.pl 43 b88190d748056e6a64988bf1a3d19efc4c292e3d338a65f4505cf769a2041077 crypto/bn/asm/ia64-mont.pl 44 a511aafbf76647a0c83705d4491c898a5584d300aa449fa6166c8803372946eb crypto/bn/asm/ia64.S 45 fee42cabeeb87cdf0fa0a6ff3698b2fe98a8a47d10a756052df572097161a8b9 crypto/bn/asm/mips-mont.pl [all …]
|
/freebsd/crypto/openssl/crypto/asn1/ |
H A D | x_bignum.c | 97 BIGNUM *bn; in bn_i2c() local 101 bn = (BIGNUM *)*pval; in bn_i2c() 103 if (BN_num_bits(bn) & 0x7) in bn_i2c() 110 BN_bn2bin(bn, cont); in bn_i2c() 112 return pad + BN_num_bytes(bn); in bn_i2c() 118 BIGNUM *bn; in bn_c2i() local 122 bn = (BIGNUM *)*pval; in bn_c2i() 123 if (!BN_bin2bn(cont, len, bn)) { in bn_c2i() 134 BIGNUM *bn; in bn_secure_c2i() local 144 bn = (BIGNUM *)*pval; in bn_secure_c2i() [all …]
|
H A D | a_int.c | 461 static ASN1_STRING *bn_to_asn1_string(const BIGNUM *bn, ASN1_STRING *ai, in bn_to_asn1_string() argument 479 if (BN_is_negative(bn) && !BN_is_zero(bn)) in bn_to_asn1_string() 482 len = BN_num_bytes(bn); in bn_to_asn1_string() 493 if (BN_is_zero(bn)) in bn_to_asn1_string() 496 len = BN_bn2bin(bn, ret->data); in bn_to_asn1_string() 505 static BIGNUM *asn1_string_to_bn(const ASN1_INTEGER *ai, BIGNUM *bn, in asn1_string_to_bn() argument 515 ret = BN_bin2bn(ai->data, ai->length, bn); in asn1_string_to_bn() 564 ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai) in BN_to_ASN1_INTEGER() argument 566 return bn_to_asn1_string(bn, ai, V_ASN1_INTEGER); in BN_to_ASN1_INTEGER() 569 BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn) in ASN1_INTEGER_to_BN() argument [all …]
|
/freebsd/crypto/openssl/test/testutil/ |
H A D | format_output.c | 184 static const char *test_bignum_zero_null(const BIGNUM *bn) in test_bignum_zero_null() argument 186 if (bn != NULL) in test_bignum_zero_null() 187 return BN_is_negative(bn) ? "-0" : "0"; in test_bignum_zero_null() 195 static void test_bignum_zero_print(const BIGNUM *bn, char sep) in test_bignum_zero_print() argument 197 const char *v = test_bignum_zero_null(bn); in test_bignum_zero_print() 198 const char *suf = bn != NULL ? ": 0" : ""; in test_bignum_zero_print() 208 char *out, int *lz, const BIGNUM *bn) in convert_bn_memory() argument 214 if (bn != NULL && !BN_is_zero(bn)) { in convert_bn_memory() 228 if ((in[bytes] & 0xf0) != 0 && BN_is_negative(bn)) { in convert_bn_memory() 235 if (BN_is_negative(bn)) { in convert_bn_memory() [all …]
|
/freebsd/usr.sbin/makefs/msdos/ |
H A D | msdosfs_lookup.c | 83 daddr_t bn; in createde() local 119 &bn, &dirclust, &blsize); in createde() 125 if ((error = bread((void *)pmp->pm_devvp, bn, blsize, NOCRED, in createde() 151 &bn, 0, &blsize); in createde() 155 error = bread((void *)pmp->pm_devvp, bn, blsize, in createde() 203 daddr_t bn; in m_readep() local 210 bn = detobn(pmp, dirclust, diroffset); in m_readep() 211 if ((error = bread((void *)pmp->pm_devvp, bn, blsize, NOCRED, in m_readep() 245 daddr_t bn; in uniqdosname() local 265 if ((error = pcbmap(dep, cn, &bn, 0, &blsize)) != 0) { in uniqdosname() [all …]
|
H A D | msdosfs_fat.c | 97 u_long bn, size; in fatblock() local 99 bn = ofs / pmp->pm_fatblocksize * pmp->pm_fatblocksec; in fatblock() 100 size = MIN(pmp->pm_fatblocksec, pmp->pm_FATsecs - bn) in fatblock() 102 bn += pmp->pm_fatblk + pmp->pm_curfat * pmp->pm_FATsecs; in fatblock() 105 *bnp = bn; in fatblock() 139 u_long bn; in pcbmap() local 201 fatblock(pmp, byteoffset, &bn, &bsize, &bo); in pcbmap() 202 if (bn != bp_bn) { in pcbmap() 205 error = bread((void *)pmp->pm_devvp, bn, bsize, in pcbmap() 211 bp_bn = bn; in pcbmap() [all …]
|
/freebsd/crypto/openssl/doc/man3/ |
H A D | DH_get_1024_160.pod | 33 BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn); 34 BIGNUM *BN_get_rfc2409_prime_1024(BIGNUM *bn); 35 BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *bn); 36 BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn); 37 BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn); 38 BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn); 39 BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn); 40 BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn); 70 return a BIGNUM for the specified size from IETF RFC 2409. If B<bn>
|
/freebsd/sys/fs/msdosfs/ |
H A D | msdosfs_fat.c | 91 u_long bn, size, fatblocksec; in fatblock() local 99 bn = ofs / pmp->pm_fatblocksize * pmp->pm_fatblocksec; in fatblock() 100 size = roundup(ulmin(fatblocksec, pmp->pm_FATsecs - bn) * DEV_BSIZE, in fatblock() 102 bn += pmp->pm_fatblk + pmp->pm_curfat * pmp->pm_FATsecs; in fatblock() 105 *bnp = bn; in fatblock() 139 u_long bn; in pcbmap() local 203 fatblock(pmp, byteoffset, &bn, &bsize, &bo); in pcbmap() 204 if (bn != bp_bn) { in pcbmap() 207 error = bread(pmp->pm_devvp, bn, bsize, NOCRED, &bp); in pcbmap() 211 bp_bn = bn; in pcbmap() [all …]
|