/freebsd/bin/ls/ |
H A D | util.c | 57 size_t clen; in prn_normal() local 75 s += clen; in prn_normal() 88 size_t clen; in prn_printable() local 107 s += clen; in prn_printable() 113 s += clen; in prn_printable() 137 size_t clen, r; in len_octal() local 156 r += 4 * clen; in len_octal() 157 s += clen; in len_octal() 169 size_t clen; in prn_octal() local 176 goodchar = clen != (size_t)-1 && clen != (size_t)-2; in prn_octal() [all …]
|
/freebsd/sys/contrib/libsodium/test/default/ |
H A D | onetimeauth7.c | 12 int clen; in main() local 14 for (clen = 0; clen < 1000; ++clen) { in main() 16 randombytes_buf(c, clen); in main() 17 crypto_onetimeauth(a, c, clen, key); in main() 18 if (crypto_onetimeauth_verify(a, c, clen, key) != 0) { in main() 19 printf("fail %d\n", clen); in main() 22 if (clen > 0) { in main() 23 c[rand() % clen] += 1 + (rand() % 255); in main() 24 if (crypto_onetimeauth_verify(a, c, clen, key) == 0) { in main() 25 printf("forgery %d\n", clen); in main() [all …]
|
H A D | auth5.c | 12 size_t clen; in main() local 14 for (clen = 0; clen < 1000; ++clen) { in main() 16 randombytes_buf(c, clen); in main() 17 crypto_auth(a, c, clen, key); in main() 18 if (crypto_auth_verify(a, c, clen, key) != 0) { in main() 19 printf("fail %u\n", (unsigned int) clen); in main() 22 if (clen > 0) { in main() 23 c[rand() % clen] += 1 + (rand() % 255); in main() 24 if (crypto_auth_verify(a, c, clen, key) == 0) { in main() 25 printf("forgery %u\n", (unsigned int) clen); in main() [all …]
|
H A D | auth7.c | 12 size_t clen; in main() local 14 for (clen = 0; clen < sizeof c; ++clen) { in main() 16 randombytes_buf(c, clen); in main() 17 crypto_auth_hmacsha512(a, c, clen, key); in main() 18 if (crypto_auth_hmacsha512_verify(a, c, clen, key) != 0) { in main() 19 printf("fail %u\n", (unsigned int) clen); in main() 22 if (clen > 0) { in main() 23 c[(size_t) rand() % clen] += 1 + (rand() % 255); in main() 24 if (crypto_auth_hmacsha512_verify(a, c, clen, key) == 0) { in main() 25 printf("forgery %u\n", (unsigned int) clen); in main() [all …]
|
/freebsd/contrib/bearssl/src/rand/ |
H A D | aesctr_drbg.c | 52 size_t clen; in br_aesctr_drbg_generate() local 60 clen = len; in br_aesctr_drbg_generate() 61 if (clen > 65280) { in br_aesctr_drbg_generate() 62 clen = 65280; in br_aesctr_drbg_generate() 71 if (clen > len) { in br_aesctr_drbg_generate() 72 clen = len; in br_aesctr_drbg_generate() 82 buf += clen; in br_aesctr_drbg_generate() 83 len -= clen; in br_aesctr_drbg_generate() 161 size_t clen; in br_aesctr_drbg_update() local 168 memset(tmp + 16 + clen, 0, 16 - clen); in br_aesctr_drbg_update() [all …]
|
/freebsd/contrib/nvi/ex/ |
H A D | ex.c | 299 for (; ecp->clen > 0; ++ecp->cp, --ecp->clen) { in ex_cmd() 354 for (; ecp->clen > 0; ++ecp->cp, --ecp->clen) { in ex_cmd() 390 ecp->clen > 0; --ecp->clen, ++ecp->cp) in ex_cmd() 525 ecp->clen > 0; --ecp->clen, ++ecp->cp) in ex_cmd() 647 for (; ecp->clen > 0; --ecp->clen, ++ecp->cp) in ex_cmd() 663 ecp->clen > 0; --ecp->clen, ++ecp->cp) { in ex_cmd() 731 for (; ecp->clen > 0; --ecp->clen, ++ecp->cp) in ex_cmd() 977 for (; ecp->clen; --ecp->clen, ++ecp->cp) in ex_cmd() 1005 for (; ecp->clen; --ecp->clen, ++ecp->cp) in ex_cmd() 1220 for (; ecp->clen > 0; --ecp->clen) { in ex_cmd() [all …]
|
/freebsd/usr.bin/cut/ |
H A D | cut.c | 287 clen = 1; in b_n_cut() 322 lbuf += clen; in b_n_cut() 323 lbuflen -= clen; in b_n_cut() 408 if (clen == (size_t)-1 || clen == (size_t)-2) { in f_cut() 413 if (clen == 0) in f_cut() 414 clen = 1; in f_cut() 435 if (clen == (size_t)-1 || clen == (size_t)-2) { in f_cut() 440 if (clen == 0) in f_cut() 441 clen = 1; in f_cut() 442 p += clen; in f_cut() [all …]
|
/freebsd/usr.bin/tr/ |
H A D | str.c | 61 size_t clen; in next() local 82 if (clen == (size_t)-1 || clen == (size_t)-2 || in next() 83 clen == 0) in next() 87 s->str += clen; in next() 190 size_t clen; in genequiv() local 200 if (clen == (size_t)-1 || clen == (size_t)-2 || clen == 0) in genequiv() 241 size_t clen; in genrange() local 250 if (clen == (size_t)-1 || clen == (size_t)-2) in genrange() 253 s->str += clen; in genrange() 294 size_t clen; in genseq() local [all …]
|
/freebsd/contrib/nvi/common/ |
H A D | put.c | 37 size_t blen, clen, len; in put() local 122 MEMCPY(bp, p, clen); in put() 123 p += clen; in put() 124 t += clen; in put() 159 if (clen > 0) { in put() 160 MEMCPY(t, p, clen); in put() 161 t += clen; in put() 187 if (clen) in put() 188 MEMCPY(t + ltp->len, p, clen); in put() 189 clen += ltp->len; in put() [all …]
|
/freebsd/sys/contrib/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/ |
H A D | aead_chacha20poly1305.c | 70 unsigned long long clen = 0ULL; in crypto_aead_chacha20poly1305_encrypt() local 83 clen = mlen + crypto_aead_chacha20poly1305_ABYTES; in crypto_aead_chacha20poly1305_encrypt() 85 *clen_p = clen; in crypto_aead_chacha20poly1305_encrypt() 145 unsigned long long clen = 0ULL; in crypto_aead_chacha20poly1305_ietf_encrypt() local 160 *clen_p = clen; in crypto_aead_chacha20poly1305_ietf_encrypt() 192 mlen = clen; in crypto_aead_chacha20poly1305_decrypt_detached() 229 if (clen >= crypto_aead_chacha20poly1305_ABYTES) { in crypto_aead_chacha20poly1305_decrypt() 232 c, clen - crypto_aead_chacha20poly1305_ABYTES, in crypto_aead_chacha20poly1305_decrypt() 233 c + clen - crypto_aead_chacha20poly1305_ABYTES, in crypto_aead_chacha20poly1305_decrypt() 271 mlen = clen; in crypto_aead_chacha20poly1305_ietf_decrypt_detached() [all …]
|
/freebsd/usr.bin/hexdump/ |
H A D | conv.c | 50 size_t clen, oclen; in conv_c() local 101 clen = mbrtowc(&wc, p, bufsize, &pr->mbstate); in conv_c() 102 if (clen == 0) in conv_c() 103 clen = 1; in conv_c() 104 else if (clen == (size_t)-1 || (clen == (size_t)-2 && in conv_c() 117 clen = 1; in conv_c() 119 } else if (clen == (size_t)-2) { in conv_c() 129 clen += oclen; in conv_c() 132 clen = 1; in conv_c() 147 pr->mbleft = clen - 1; in conv_c()
|
/freebsd/sys/contrib/libsodium/src/libsodium/crypto_box/ |
H A D | crypto_box_easy.c | 66 unsigned long long clen, in crypto_box_open_detached_afternm() argument 70 return crypto_secretbox_open_detached(m, c, mac, clen, n, k); in crypto_box_open_detached_afternm() 76 unsigned long long clen, const unsigned char *n, in crypto_box_open_detached() argument 85 ret = crypto_box_open_detached_afternm(m, c, mac, clen, n, k); in crypto_box_open_detached() 93 unsigned long long clen, const unsigned char *n, in crypto_box_open_easy_afternm() argument 96 if (clen < crypto_box_MACBYTES) { in crypto_box_open_easy_afternm() 100 clen - crypto_box_MACBYTES, in crypto_box_open_easy_afternm() 106 unsigned long long clen, const unsigned char *n, in crypto_box_open_easy() argument 109 if (clen < crypto_box_MACBYTES) { in crypto_box_open_easy() 113 clen - crypto_box_MACBYTES, in crypto_box_open_easy()
|
/freebsd/sys/contrib/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodium/ |
H A D | aead_xchacha20poly1305.c | 53 unsigned long long clen = 0ULL; in crypto_aead_xchacha20poly1305_ietf_encrypt() local 63 clen = mlen + crypto_aead_xchacha20poly1305_ietf_ABYTES; in crypto_aead_xchacha20poly1305_ietf_encrypt() 65 *clen_p = clen; in crypto_aead_xchacha20poly1305_ietf_encrypt() 74 unsigned long long clen, in crypto_aead_xchacha20poly1305_ietf_decrypt_detached() argument 89 (m, nsec, c, clen, mac, ad, adlen, npub2, k2); in crypto_aead_xchacha20poly1305_ietf_decrypt_detached() 101 unsigned long long clen, in crypto_aead_xchacha20poly1305_ietf_decrypt() argument 110 if (clen >= crypto_aead_xchacha20poly1305_ietf_ABYTES) { in crypto_aead_xchacha20poly1305_ietf_decrypt() 113 c, clen - crypto_aead_xchacha20poly1305_ietf_ABYTES, in crypto_aead_xchacha20poly1305_ietf_decrypt() 114 c + clen - crypto_aead_xchacha20poly1305_ietf_ABYTES, in crypto_aead_xchacha20poly1305_ietf_decrypt() 119 mlen = clen - crypto_aead_xchacha20poly1305_ietf_ABYTES; in crypto_aead_xchacha20poly1305_ietf_decrypt()
|
/freebsd/contrib/bearssl/src/kdf/ |
H A D | hkdf.c | 76 size_t clen; in br_hkdf_produce() local 96 clen = hc->dig_len - hc->ptr; in br_hkdf_produce() 97 if (clen > out_len) { in br_hkdf_produce() 98 clen = out_len; in br_hkdf_produce() 100 memcpy(out, hc->buf + hc->ptr, clen); in br_hkdf_produce() 101 out = (unsigned char *)out + clen; in br_hkdf_produce() 102 out_len -= clen; in br_hkdf_produce() 103 hc->ptr += clen; in br_hkdf_produce() 104 tlen += clen; in br_hkdf_produce()
|
/freebsd/sys/contrib/libsodium/src/libsodium/crypto_secretbox/ |
H A D | crypto_secretbox_easy.c | 85 unsigned long long clen, in crypto_secretbox_open_detached() argument 97 if (crypto_onetimeauth_poly1305_verify(mac, c, clen, block0) != 0) { in crypto_secretbox_open_detached() 105 (uintptr_t) c - (uintptr_t) m < clen) || in crypto_secretbox_open_detached() 107 (uintptr_t) m - (uintptr_t) c < clen)) { /* LCOV_EXCL_LINE */ in crypto_secretbox_open_detached() 108 memmove(m, c, clen); in crypto_secretbox_open_detached() 111 mlen0 = clen; in crypto_secretbox_open_detached() 124 if (clen > mlen0) { in crypto_secretbox_open_detached() 125 crypto_stream_salsa20_xor_ic(m + mlen0, c + mlen0, clen - mlen0, in crypto_secretbox_open_detached() 135 unsigned long long clen, const unsigned char *n, in crypto_secretbox_open_easy() argument 138 if (clen < crypto_secretbox_MACBYTES) { in crypto_secretbox_open_easy() [all …]
|
/freebsd/contrib/bearssl/src/aead/ |
H A D | gcm.c | 119 size_t clen; in br_gcm_aad_inject() local 121 clen = 16 - ptr; in br_gcm_aad_inject() 122 if (len < clen) { in br_gcm_aad_inject() 130 len -= clen; in br_gcm_aad_inject() 175 size_t u, clen; in br_gcm_run() local 177 clen = 16 - ptr; in br_gcm_run() 178 if (len < clen) { in br_gcm_run() 179 clen = len; in br_gcm_run() 190 buf += clen; in br_gcm_run() 191 len -= clen; in br_gcm_run() [all …]
|
H A D | ccm.c | 146 size_t clen; in br_ccm_aad_inject() local 149 if (clen > len) { in br_ccm_aad_inject() 155 dbuf += clen; in br_ccm_aad_inject() 156 len -= clen; in br_ccm_aad_inject() 214 size_t clen; in br_ccm_run() local 218 if (clen > len) { in br_ccm_run() 219 clen = len; in br_ccm_run() 222 for (u = 0; u < clen; u ++) { in br_ccm_run() 239 dbuf += clen; in br_ccm_run() 240 len -= clen; in br_ccm_run() [all …]
|
/freebsd/sys/contrib/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/ |
H A D | box_curve25519xchacha20poly1305.c | 113 unsigned long long clen, const unsigned char *n, const unsigned char *k) in crypto_box_curve25519xchacha20poly1305_open_detached_afternm() argument 115 return crypto_secretbox_xchacha20poly1305_open_detached(m, c, mac, clen, n, in crypto_box_curve25519xchacha20poly1305_open_detached_afternm() 122 unsigned long long clen, const unsigned char *n, const unsigned char *pk, in crypto_box_curve25519xchacha20poly1305_open_detached() argument 132 m, c, mac, clen, n, k); in crypto_box_curve25519xchacha20poly1305_open_detached() 140 unsigned char *m, const unsigned char *c, unsigned long long clen, in crypto_box_curve25519xchacha20poly1305_open_easy_afternm() argument 143 if (clen < crypto_box_curve25519xchacha20poly1305_MACBYTES) { in crypto_box_curve25519xchacha20poly1305_open_easy_afternm() 148 clen - crypto_box_curve25519xchacha20poly1305_MACBYTES, n, k); in crypto_box_curve25519xchacha20poly1305_open_easy_afternm() 153 unsigned char *m, const unsigned char *c, unsigned long long clen, in crypto_box_curve25519xchacha20poly1305_open_easy() argument 156 if (clen < crypto_box_curve25519xchacha20poly1305_MACBYTES) { in crypto_box_curve25519xchacha20poly1305_open_easy() 161 clen - crypto_box_curve25519xchacha20poly1305_MACBYTES, n, pk, sk); in crypto_box_curve25519xchacha20poly1305_open_easy()
|
/freebsd/sys/contrib/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/ |
H A D | secretbox_xchacha20poly1305.c | 92 unsigned long long clen, in crypto_secretbox_xchacha20poly1305_open_detached() argument 104 if (crypto_onetimeauth_poly1305_verify(mac, c, clen, block0) != 0) { in crypto_secretbox_xchacha20poly1305_open_detached() 112 (uintptr_t) c - (uintptr_t) m < clen) || in crypto_secretbox_xchacha20poly1305_open_detached() 114 (uintptr_t) m - (uintptr_t) c < clen)) { /* LCOV_EXCL_LINE */ in crypto_secretbox_xchacha20poly1305_open_detached() 115 memmove(m, c, clen); in crypto_secretbox_xchacha20poly1305_open_detached() 118 mlen0 = clen; in crypto_secretbox_xchacha20poly1305_open_detached() 131 if (clen > mlen0) { in crypto_secretbox_xchacha20poly1305_open_detached() 132 crypto_stream_chacha20_xor_ic(m + mlen0, c + mlen0, clen - mlen0, in crypto_secretbox_xchacha20poly1305_open_detached() 143 unsigned long long clen, in crypto_secretbox_xchacha20poly1305_open_easy() argument 147 if (clen < crypto_secretbox_xchacha20poly1305_MACBYTES) { in crypto_secretbox_xchacha20poly1305_open_easy() [all …]
|
/freebsd/crypto/openssl/test/ |
H A D | rsa_test.c | 216 int clen = 0; in rsa_setkey() local 222 clen = key1(*key, ctext); in rsa_setkey() 225 clen = key2(*key, ctext); in rsa_setkey() 228 clen = key3(*key, ctext); in rsa_setkey() 231 return clen; in rsa_setkey() 249 if (clen != NULL) in test_rsa_simple() 250 *clen = clentmp; in test_rsa_simple() 289 int clen = 0; in test_rsa_oaep() local 294 ctext_ex, &clen, &key)) in test_rsa_oaep() 306 for (n = 0; n < clen; ++n) { in test_rsa_oaep() [all …]
|
/freebsd/contrib/bearssl/src/hash/ |
H A D | md5sha1.c | 47 size_t clen; in br_md5sha1_update() local 49 clen = 64 - ptr; in br_md5sha1_update() 50 if (clen > len) { in br_md5sha1_update() 51 clen = len; in br_md5sha1_update() 53 memcpy(cc->buf + ptr, buf, clen); in br_md5sha1_update() 54 ptr += clen; in br_md5sha1_update() 55 buf += clen; in br_md5sha1_update() 56 len -= clen; in br_md5sha1_update() 57 cc->count += (uint64_t)clen; in br_md5sha1_update()
|
H A D | multihash.c | 114 size_t clen; in br_multihash_update() local 116 clen = 128 - ptr; in br_multihash_update() 117 if (clen > len) { in br_multihash_update() 118 clen = len; in br_multihash_update() 120 memcpy(ctx->buf + ptr, buf, clen); in br_multihash_update() 121 ptr += clen; in br_multihash_update() 122 buf += clen; in br_multihash_update() 123 len -= clen; in br_multihash_update() 124 ctx->count += (uint64_t)clen; in br_multihash_update()
|
/freebsd/sys/kern/ |
H A D | tty_outq.c | 146 size_t cbegin, cend, clen; in ttyoutq_read() local 164 clen = cend - cbegin; in ttyoutq_read() 167 memcpy(cbuf, tob->tob_data + cbegin, clen); in ttyoutq_read() 168 cbuf += clen; in ttyoutq_read() 169 len -= clen; in ttyoutq_read() 183 to->to_begin += clen; in ttyoutq_read() 207 size_t cbegin, cend, clen; in ttyoutq_read_uio() local 225 clen = cend - cbegin; in ttyoutq_read_uio() 259 memcpy(ob, tob->tob_data + cbegin, clen); in ttyoutq_read_uio() 260 to->to_begin += clen; in ttyoutq_read_uio() [all …]
|
/freebsd/contrib/wpa/src/crypto/ |
H A D | sha256-tlsprf.c | 32 size_t clen; in tls_prf_sha256() local 63 clen = outlen - pos; in tls_prf_sha256() 64 if (clen > SHA256_MAC_LEN) in tls_prf_sha256() 65 clen = SHA256_MAC_LEN; in tls_prf_sha256() 66 os_memcpy(out + pos, P, clen); in tls_prf_sha256() 67 pos += clen; in tls_prf_sha256()
|
H A D | sha384-tlsprf.c | 32 size_t clen; in tls_prf_sha384() local 63 clen = outlen - pos; in tls_prf_sha384() 64 if (clen > SHA384_MAC_LEN) in tls_prf_sha384() 65 clen = SHA384_MAC_LEN; in tls_prf_sha384() 66 os_memcpy(out + pos, P, clen); in tls_prf_sha384() 67 pos += clen; in tls_prf_sha384()
|