Home
last modified time | relevance | path

Searched refs:bn (Results 1 – 25 of 118) sorted by relevance

12345

/openbsd/regress/lib/libcrypto/bn/
H A Dbn_bits.c26 BIGNUM *bn = NULL; in test_bn_set_bit() local
59 BN_free(bn); in test_bn_set_bit()
68 BIGNUM *bn = NULL; in test_bn_clear_bit() local
103 if (!BN_one(bn)) in test_bn_clear_bit()
105 BN_set_negative(bn, 1); in test_bn_clear_bit()
110 if (!BN_is_zero(bn)) { in test_bn_clear_bit()
122 BN_free(bn); in test_bn_clear_bit()
131 BIGNUM *bn = NULL; in test_bn_mask_bits() local
188 if (!BN_one(bn)) in test_bn_mask_bits()
195 if (!BN_is_zero(bn)) { in test_bn_mask_bits()
[all …]
H A Dbn_convert.c188 BN_free(bn); in test_bn_asc2bn()
189 bn = NULL; in test_bn_asc2bn()
204 bn) != 0) in test_bn_asc2bn()
228 BN_free(bn); in test_bn_asc2bn()
451 BN_free(bn); in test_bn_convert()
459 bn) != 0) in test_bn_convert()
465 BN_free(bn); in test_bn_convert()
473 bn) != 0) in test_bn_convert()
570 BN_free(bn); in test_bn_convert()
655 BN_free(bn); in test_bn_dec2bn()
[all …]
H A Dbn_print.c195 BIGNUM *bn; in main() local
207 if (!BN_set_word(bn, 1)) in main()
215 BN_set_negative(bn, 1); in main()
230 BN_set_negative(bn, 1); in main()
245 BN_set_negative(bn, 0); in main()
260 BN_set_negative(bn, 1); in main()
267 if (!BN_rshift(bn, bn, 7 * 8)) in main()
275 BN_set_negative(bn, 0); in main()
282 BN_zero(bn); in main()
291 BN_set_negative(bn, 1); in main()
[all …]
H A Dbn_shift.c366 if (!BN_one(bn)) in benchmark_bn_lshift1()
370 if (!BN_lshift1(bn, bn)) in benchmark_bn_lshift1()
383 if (!BN_one(bn)) in benchmark_bn_lshift()
387 if (!BN_lshift(bn, bn, n)) in benchmark_bn_lshift()
439 if (!BN_one(bn)) in benchmark_bn_rshift1()
446 if (!BN_rshift1(bn, bn)) in benchmark_bn_rshift1()
456 if (!BN_one(bn)) in benchmark_bn_rshift()
463 if (!BN_rshift(bn, bn, n)) in benchmark_bn_rshift()
596 BIGNUM *bn; in benchmark_run() local
612 bm->func(bn); in benchmark_run()
[all …]
H A Dbn_word.c62 if (BN_is_zero(bn) && BN_is_negative(bn) != 0) { in check_bn_word_test()
80 BIGNUM *bn; in test_bn_word() local
84 if ((bn = BN_new()) == NULL) in test_bn_word()
90 if (!BN_hex2bn(&bn, bwt->in_hex)) { in test_bn_word()
107 BN_free(bn); in test_bn_word()
426 BIGNUM *bn; in test_bn_div_word() local
430 if ((bn = BN_new()) == NULL) in test_bn_div_word()
454 BN_free(bn); in test_bn_div_word()
572 BIGNUM *bn; in test_bn_mod_word() local
576 if ((bn = BN_new()) == NULL) in test_bn_mod_word()
[all …]
H A Dbn_unit.c75 BIGNUM *bn; in test_bn_num_bits() local
79 if ((bn = BN_new()) == NULL) in test_bn_num_bits()
82 if ((num_bits = BN_num_bits(bn)) != 0) { in test_bn_num_bits()
87 if (!BN_set_word(bn, 1)) in test_bn_num_bits()
91 if ((num_bits = BN_num_bits(bn)) != i + 1) { in test_bn_num_bits()
96 if (!BN_lshift1(bn, bn)) in test_bn_num_bits()
100 if (BN_hex2bn(&bn, "0000000000000000010000000000000000") != 34) in test_bn_num_bits()
103 if ((num_bits = BN_num_bits(bn)) != 65) { in test_bn_num_bits()
109 BN_free(bn); in test_bn_num_bits()
141 bn_check_expected_flags(const BIGNUM *bn, int expected, const char *fn, in bn_check_expected_flags() argument
[all …]
/openbsd/usr.bin/less/
H A Dch.c48 #define bufnode_buf(bn) ((struct buf *)bn) argument
85 for ((bn) = ch_bufhead; (bn) != END_OF_CHAIN; (bn) = (bn)->next)
88 (bn)->next->prev = (bn)->prev; \
89 (bn)->prev->next = (bn)->next;
108 (bn) != END_OF_HCHAIN(h); (bn) = (bn)->hnext)
111 (bn)->hnext->hprev = (bn)->hprev; \
112 (bn)->hprev->hnext = (bn)->hnext;
316 BUF_RM(bn); in ch_get()
513 FOR_BUFS(bn) { in ch_beg_seek()
630 FOR_BUFS(bn) { in ch_flush()
[all …]
/openbsd/lib/libcrypto/bn/
H A Dbn_convert.c194 bn->neg = 0; in bn_bin2bn_cbs()
195 bn->top = i; in bn_bin2bn_cbs()
199 *bnp = bn; in bn_bin2bn_cbs()
205 BN_free(bn); in bn_bin2bn_cbs()
223 return bn; in BN_bin2bn()
250 return bn; in BN_lebin2bn()
460 *bnp = bn; in bn_dec2bn_cbs()
656 bn->top = i; in bn_hex2bn_cbs()
661 *bnp = bn; in bn_hex2bn_cbs()
754 BN_clear_bit(bn, BN_num_bits(bn) - 1); in BN_mpi2bn()
[all …]
H A Dbn_print.c35 if (!BN_is_zero(bn)) in bn_print_zero()
48 if (BN_is_zero(bn) || BN_num_bytes(bn) > BN_BYTES) in bn_print_word()
51 if (BN_is_negative(bn)) in bn_print_word()
54 word = BN_get_word(bn); in bn_print_word()
72 if (BN_num_bytes(bn) <= BN_BYTES) in bn_print_bignum()
87 if (BN_is_negative(bn)) { in bn_print_bignum()
130 if (bn == NULL) in bn_printf()
142 if (BN_is_zero(bn)) in bn_printf()
143 return bn_print_zero(bio, bn); in bn_printf()
145 if (BN_num_bytes(bn) <= BN_BYTES) in bn_printf()
[all …]
H A Dbn_const.c27 BN_get_rfc2409_prime_768(BIGNUM *bn) in BN_get_rfc2409_prime_768() argument
29 return BN_bin2bn(RFC2409_PRIME_768, sizeof(RFC2409_PRIME_768), bn); in BN_get_rfc2409_prime_768()
57 BN_get_rfc2409_prime_1024(BIGNUM *bn) in BN_get_rfc2409_prime_1024() argument
59 return BN_bin2bn(RFC2409_PRIME_1024, sizeof(RFC2409_PRIME_1024), bn); in BN_get_rfc2409_prime_1024()
92 BN_get_rfc3526_prime_1536(BIGNUM *bn) in BN_get_rfc3526_prime_1536() argument
94 return BN_bin2bn(RFC3526_PRIME_1536, sizeof(RFC3526_PRIME_1536), bn); in BN_get_rfc3526_prime_1536()
132 BN_get_rfc3526_prime_2048(BIGNUM *bn) in BN_get_rfc3526_prime_2048() argument
182 BN_get_rfc3526_prime_3072(BIGNUM *bn) in BN_get_rfc3526_prime_3072() argument
243 BN_get_rfc3526_prime_4096(BIGNUM *bn) in BN_get_rfc3526_prime_4096() argument
325 BN_get_rfc3526_prime_6144(BIGNUM *bn) in BN_get_rfc3526_prime_6144() argument
[all …]
H A Dbn_lib.c74 BIGNUM *bn; in BN_new() local
82 return bn; in BN_new()
105 if (bn == NULL) in BN_free()
109 freezero(bn->d, bn->dmax * sizeof(bn->d[0])); in BN_free()
112 explicit_bzero(bn, sizeof(*bn)); in BN_free()
116 freezero(bn, sizeof(*bn)); in BN_free()
123 BN_free(bn); in BN_clear_free()
210 d = recallocarray(bn->d, bn->dmax, words, sizeof(BN_ULONG)); in bn_expand_internal()
215 bn->d = d; in bn_expand_internal()
216 bn->dmax = words; in bn_expand_internal()
[all …]
H A Dbn_ctx.c111 BIGNUM *bn = NULL; in BN_CTX_get() local
130 if ((bn = bctx->bignums[bctx->index]) == NULL) { in BN_CTX_get()
131 if ((bn = BN_new()) == NULL) { in BN_CTX_get()
136 bctx->bignums[bctx->index] = bn; in BN_CTX_get()
141 BN_zero(bn); in BN_CTX_get()
143 return bn; in BN_CTX_get()
/openbsd/sys/ufs/ufs/
H A Dufs_bmap.c133 for (++bn; bn < NDADDR && *runp < maxrun && in ufs_bmaparray()
135 DIP(ip, db[bn])); in ufs_bmaparray()
136 ++bn, ++*runp); in ufs_bmaparray()
193 ++bn, ++*runp); in ufs_bmaparray()
207 ++bn, ++*runp); in ufs_bmaparray()
238 realbn = bn; in ufs_getlbns()
239 if (bn < 0) in ufs_getlbns()
240 bn = -bn; in ufs_getlbns()
250 if (bn < NDADDR) in ufs_getlbns()
259 for (blockcnt = 1, i = NIADDR, bn -= NDADDR;; i--, bn -= blockcnt) { in ufs_getlbns()
[all …]
/openbsd/regress/usr.bin/ssh/unittests/sshbuf/
H A Dtest_sshbuf_getput_crypto.c77 BN_free(bn); in sshbuf_getput_crypto_tests()
89 BN_free(bn); in sshbuf_getput_crypto_tests()
102 BN_free(bn); in sshbuf_getput_crypto_tests()
114 BN_free(bn); in sshbuf_getput_crypto_tests()
130 BN_free(bn); in sshbuf_getput_crypto_tests()
145 BN_free(bn); in sshbuf_getput_crypto_tests()
160 BN_free(bn); in sshbuf_getput_crypto_tests()
178 BN_free(bn); in sshbuf_getput_crypto_tests()
194 BN_free(bn); in sshbuf_getput_crypto_tests()
209 BN_free(bn); in sshbuf_getput_crypto_tests()
[all …]
/openbsd/regress/usr.bin/ssh/unittests/bitmap/
H A Dtests.c26 BIGNUM *bn; in tests() local
35 bn = BN_new(); in tests()
36 ASSERT_PTR_NE(bn, NULL); in tests()
44 BN_clear(bn); in tests()
70 ASSERT_INT_EQ(BN_num_bits(bn), in tests()
72 ASSERT_INT_EQ(BN_num_bytes(bn), in tests()
84 r = BN_bn2bin(bn, bnbuf); in tests()
109 BN_clear_bit(bn, i); in tests()
113 BN_clear_bit(bn, j); in tests()
117 BN_clear_bit(bn, k); in tests()
[all …]
/openbsd/usr.sbin/makefs/ffs/
H A Dufs_bmap.c65 ufs_getlbns(struct inode *ip, daddr_t bn, struct indir *ap, int *nump) in ufs_getlbns() argument
77 realbn = bn; in ufs_getlbns()
78 if ((long)bn < 0) in ufs_getlbns()
79 bn = -(long)bn; in ufs_getlbns()
81 assert (bn >= NDADDR); in ufs_getlbns()
90 bn -= NDADDR; in ufs_getlbns()
91 for (lbc = 0, i = NIADDR;; i--, bn -= blockcnt) { in ufs_getlbns()
98 if (bn < blockcnt) in ufs_getlbns()
103 metalbn = -((realbn >= 0 ? realbn : -realbn) - bn + NIADDR - i); in ufs_getlbns()
122 off = (bn >> lbc) & (NINDIR(ip->i_fs) - 1); in ufs_getlbns()
/openbsd/sys/ufs/ext2fs/
H A Dext2fs_bmap.c110 ext4_ext_find_extent(fs, ip, bn, &path); in ext4_bmapext()
170 if ((error = ufs_getlbns(vp, bn, xap, nump)) != 0) in ext2fs_bmaparray()
175 *bnp = blkptrtodb(ump, letoh32(ip->i_e2fs_blocks[bn])); in ext2fs_bmaparray()
179 for (++bn; bn < NDADDR && *runp < maxrun && in ext2fs_bmaparray()
181 letoh32(ip->i_e2fs_blocks[bn - 1]), in ext2fs_bmaparray()
182 letoh32(ip->i_e2fs_blocks[bn])); in ext2fs_bmaparray()
183 ++bn, ++*runp) in ext2fs_bmaparray()
240 for (bn = xap->in_off + 1; in ext2fs_bmaparray()
241 bn < MNINDIR(ump) && *runp < maxrun && in ext2fs_bmaparray()
243 ((u_int32_t *)bp->b_data)[bn]); in ext2fs_bmaparray()
[all …]
H A Dext2fs_balloc.c55 ext2fs_buf_alloc(struct inode *ip, u_int32_t bn, int size, struct ucred *cred, in ext2fs_buf_alloc() argument
71 lbn = bn; in ext2fs_buf_alloc()
76 if (bn < NDADDR) { in ext2fs_buf_alloc()
77 nb = letoh32(ip->i_e2fs_blocks[bn]); in ext2fs_buf_alloc()
79 error = bread(vp, bn, fs->e2fs_bsize, &bp); in ext2fs_buf_alloc()
91 error = ext2fs_alloc(ip, bn, in ext2fs_buf_alloc()
92 ext2fs_blkpref(ip, bn, (int)bn, &ip->i_e2fs_blocks[0]), in ext2fs_buf_alloc()
98 ip->i_e2fs_blocks[bn] = htole32(newb); in ext2fs_buf_alloc()
100 bp = getblk(vp, bn, fs->e2fs_bsize, 0, INFSLP); in ext2fs_buf_alloc()
111 if ((error = ufs_getlbns(vp, bn, indirs, &num)) != 0) in ext2fs_buf_alloc()
/openbsd/usr.bin/openssl/
H A Dprime.c115 BIGNUM *bn = NULL; in prime_main() local
153 bn = BN_new(); in prime_main()
154 if (!bn) { in prime_main()
158 if (!BN_generate_prime_ex(bn, cfg.bits, in prime_main()
163 s = cfg.hex ? BN_bn2hex(bn) : BN_bn2dec(bn); in prime_main()
172 if (!BN_hex2bn(&bn, prime)) { in prime_main()
178 if (!BN_dec2bn(&bn, prime)) { in prime_main()
185 is_prime = BN_is_prime_ex(bn, cfg.checks, NULL, NULL); in prime_main()
197 BN_free(bn); in prime_main()
/openbsd/usr.sbin/makefs/msdos/
H A Dmsdosfs_lookup.c78 daddr_t bn; in createde() local
116 &bn, &dirclust, &blsize); in createde()
155 &bn, 0, &blsize); in createde()
159 error = bread(pmp->pm_devvp, de_bn2kb(pmp, bn), in createde()
210 &bn, NULL, &blsize); in createde()
236 &bn, 0, &blsize); in createde()
240 rberror = bread(pmp->pm_devvp, de_bn2kb(pmp, bn), in createde()
271 daddr_t bn; in readep() local
278 bn = detobn(pmp, dirclust, diroffset); in readep()
312 daddr_t bn; in uniqdosname() local
[all …]
H A Dmsdosfs_fat.c104 u_long bn, size; in fatblock() local
114 *bnp = bn; in fatblock()
153 u_long bn; in pcbmap() local
226 fc_lmdistance[bn]++; in pcbmap()
251 if (bn != bp_bn) { in pcbmap()
260 bp_bn = bn; in pcbmap()
607 updatefats(pmp, bp, bn); in fatentry()
680 updatefats(pmp, bp, bn); in fatchain()
861 if (lbn != bn) { in freeclusterchain()
869 lbn = bn; in freeclusterchain()
[all …]
H A Dmsdosfs_vnops.c120 daddr_t bn; in msdosfs_findslot() local
182 error = bread(pmp->pm_devvp, de_bn2kb(pmp, bn), blsize, in msdosfs_findslot()
453 daddr_t bn; in msdosfs_wfile() local
461 bn = cntobn(pmp, cn); in msdosfs_wfile()
465 DPRINTF(("%s: pcbmap %lu", __func__, bn)); in msdosfs_wfile()
470 cn, (unsigned long long)bn, in msdosfs_wfile()
471 (unsigned long long)de_bn2kb(pmp, bn), blsize)); in msdosfs_wfile()
525 u_long newcluster, pcl, bn; in msdosfs_mkdire() local
560 bn = cntobn(pmp, newcluster); in msdosfs_mkdire()
561 lbn = de_bn2kb(pmp, bn); in msdosfs_mkdire()
[all …]
/openbsd/lib/libcrypto/asn1/
H A Dx_bignum.c143 const BIGNUM *bn; in bn_i2c() local
149 bn = (const BIGNUM *)*pval; in bn_i2c()
151 if ((aint = BN_to_ASN1_INTEGER(bn, NULL)) == NULL) in bn_i2c()
169 BIGNUM *bn; in bn_c2i() local
181 if ((bn = ASN1_INTEGER_to_BN(aint, NULL)) == NULL) in bn_c2i()
183 *pval = (ASN1_VALUE *)bn; in bn_c2i()
197 const BIGNUM *bn = (BIGNUM *)*pval; in bn_print() local
199 if (!BN_print(out, bn)) in bn_print()
/openbsd/sys/msdosfs/
H A Dmsdosfs_fat.c100 uint32_t bn, size; in fatblock() local
107 *bnp = bn; in fatblock()
143 uint32_t bn; in pcbmap() local
204 fc_lmdistance[bn]++; in pcbmap()
217 if (bn != bp_bn) { in pcbmap()
225 bp_bn = bn; in pcbmap()
554 updatefats(pmp, bp, bn); in fatentry()
629 updatefats(pmp, bp, bn); in fatchain()
823 if (lbn != bn) { in freeclusterchain()
831 lbn = bn; in freeclusterchain()
[all …]
H A Dmsdosfs_lookup.c88 daddr_t bn; in msdosfs_lookup() local
235 error = bread(pmp->pm_devvp, bn, blsize, &bp); in msdosfs_lookup()
603 daddr_t bn; in createde() local
641 &bn, &dirclust, &blsize); in createde()
673 &bn, 0, &blsize); in createde()
724 daddr_t bn; in dosdirempty() local
740 error = bread(pmp->pm_devvp, bn, blsize, &bp); in dosdirempty()
886 daddr_t bn; in readep() local
893 bn = detobn(pmp, dirclust, diroffset); in readep()
934 daddr_t bn; in removede() local
[all …]

12345