/freebsd/bin/ls/ |
H A D | util.c | 57 size_t clen; in prn_normal() local 61 while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) { in prn_normal() 62 if (clen == (size_t)-2) { in prn_normal() 66 if (clen == (size_t)-1) { in prn_normal() 73 for (i = 0; i < (int)clen; i++) in prn_normal() 75 s += clen; in prn_normal() 88 size_t clen; in prn_printable() local 92 while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) { in prn_printable() 93 if (clen == (size_t)-1) { in prn_printable() 100 if (clen in prn_printable() 137 size_t clen, r; len_octal() local 169 size_t clen; prn_octal() local [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() 69 if ((uint32_t)(ctx->cc + ((clen + 15) >> 4)) > 32768) { in br_aesctr_drbg_generate() 70 clen = (32768 - ctx->cc) << 4; in br_aesctr_drbg_generate() 71 if (clen > len) { in br_aesctr_drbg_generate() 72 clen = len; in br_aesctr_drbg_generate() 79 memset(buf, 0, clen); in br_aesctr_drbg_generate() 81 iv, ctx->cc, buf, clen); in br_aesctr_drbg_generate() [all …]
|
/freebsd/contrib/nvi/ex/ |
H A D | ex.c | 120 gp->excmd.clen = 1; in ex() 123 gp->excmd.clen = tp->len; in ex() 258 for (notempty = 0; ecp->clen > 0; ++ecp->cp, --ecp->clen) in ex_cmd() 274 if (ecp->clen != 0 && ch == ':') { in ex_cmd() 276 while (--ecp->clen > 0 && (ch = *++ecp->cp) == ':'); in ex_cmd() 288 if (ecp->clen != 0 && ch == '"') { in ex_cmd() 289 while (--ecp->clen > 0 && *++ecp->cp != '\n'); in ex_cmd() 293 --ecp->clen; in ex_cmd() 299 for (; ecp->clen > 0; ++ecp->cp, --ecp->clen) { in ex_cmd() 320 if (ecp->clen == 0 && in ex_cmd() [all …]
|
/freebsd/usr.bin/cut/ |
H A D | cut.c | 274 int canwrite, clen, warned; in b_n_cut() 280 for (col = 0; lbuflen > 0; col += clen) { in b_n_cut() 281 if ((clen = mbrlen(lbuf, lbuflen, &mbs)) < 0) { in b_n_cut() 287 clen = 1; in b_n_cut() 289 if (clen == 0 || *lbuf == '\n') in b_n_cut() 299 while (i < col + clen && i < maxval && in b_n_cut() 302 canwrite = i < col + clen; in b_n_cut() 303 for (; i < col + clen && i < maxval; i++) in b_n_cut() 306 fwrite(lbuf, 1, clen, stdout); in b_n_cut() 313 for (i = col; i < col + clen; in b_n_cut() 273 int canwrite, clen, warned; b_n_cut() local 386 size_t clen, lbuflen, reallen; f_cut() local [all...] |
/freebsd/usr.bin/tr/ |
H A D | str.c | 61 size_t clen; in next() local 81 clen = mbrtowc(&wch, s->str, MB_LEN_MAX, NULL); in next() 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 199 clen = mbrtowc(&wc, s->str, MB_LEN_MAX, NULL); in genequiv() 200 if (clen == (size_t)-1 || clen == (size_t)-2 || clen == 0) in genequiv() 203 if (s->str[clen] != '=') in genequiv() 205 s->str += clen + 2; in genequiv() [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 158 clen = mlen + crypto_aead_chacha20poly1305_ietf_ABYTES; in crypto_aead_chacha20poly1305_ietf_encrypt() 160 *clen_p = clen; in crypto_aead_chacha20poly1305_ietf_encrypt() 169 unsigned long long clen, in crypto_aead_chacha20poly1305_decrypt_detached() argument 192 mlen = clen; in crypto_aead_chacha20poly1305_decrypt_detached() 220 unsigned long long clen, in crypto_aead_chacha20poly1305_decrypt() argument 229 if (clen >= crypto_aead_chacha20poly1305_ABYTES) { in crypto_aead_chacha20poly1305_decrypt() [all …]
|
/freebsd/contrib/nvi/common/ |
H A D | put.c | 37 size_t blen, clen, len; in put() local 121 if (len > 0 && (clen = cp->cno + (append ? 1 : 0)) > 0) { in put() 122 MEMCPY(bp, p, clen); in put() 123 p += clen; in put() 124 t += clen; in put() 134 clen = len == 0 ? 0 : len - (cp->cno + (append ? 1 : 0)); in put() 159 if (clen > 0) { in put() 160 MEMCPY(t, p, clen); in put() 161 t += clen; in put() 182 ADD_SPACE_RETW(sp, bp, blen, ltp->len + clen); in put() [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/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() 127 memcpy(ctx->buf + ptr, data, clen); in br_gcm_aad_inject() 129 data = (const unsigned char *)data + clen; in br_gcm_aad_inject() 130 len -= clen; in br_gcm_aad_inject() 131 ctx->count_aad += (uint64_t)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() [all …]
|
H A D | ccm.c | 146 size_t clen; in br_ccm_aad_inject() local 148 clen = (sizeof ctx->buf) - ptr; in br_ccm_aad_inject() 149 if (clen > len) { in br_ccm_aad_inject() 154 memcpy(ctx->buf + ptr, dbuf, clen); 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 217 clen = (sizeof ctx->buf) - ptr; in br_ccm_run() 218 if (clen > len) { in br_ccm_run() 219 clen = len; in br_ccm_run() [all …]
|
H A D | eax.c | 277 size_t clen; in br_eax_aad_inject() local 279 clen = 16 - ptr; in br_eax_aad_inject() 280 if (len <= clen) { in br_eax_aad_inject() 285 memcpy(ctx->buf + ptr, data, clen); in br_eax_aad_inject() 286 data = (const unsigned char *)data + clen; in br_eax_aad_inject() 287 len -= clen; in br_eax_aad_inject() 360 size_t u, clen; in br_eax_run() local 362 clen = 16 - ptr; in br_eax_run() 363 if (len <= clen) { in br_eax_run() 364 clen = len; in br_eax_run() [all …]
|
/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/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/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/crypto/libecc/src/examples/sig/rsa/ |
H A D | rsa_tests.h | 91 u32 clen; in perform_rsa_tests() local 93 clen = sizeof(cipher); in perform_rsa_tests() 94 …ret = rsaes_pkcs1_v1_5_encrypt(&pub, t->m, t->mlen, cipher, &clen, modbits, t->salt, t->saltlen); … in perform_rsa_tests() 96 MUST_HAVE((clen == t->reslen), ret, err1); in perform_rsa_tests() 101 clen = sizeof(cipher); in perform_rsa_tests() 102 ret = rsaes_pkcs1_v1_5_decrypt(&priv, t->res, t->reslen, cipher, &clen, modbits); EG(ret, err1); in perform_rsa_tests() 104 MUST_HAVE((clen == t->mlen), ret, err1); in perform_rsa_tests() 108 clen = sizeof(cipher); in perform_rsa_tests() 109 …ret = rsaes_pkcs1_v1_5_decrypt_hardened(&priv, &pub, t->res, t->reslen, cipher, &clen, modbits); E… in perform_rsa_tests() 111 MUST_HAVE((clen == t->mlen), ret, err1); in perform_rsa_tests() [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() 235 int success, unsigned char *ctext_ex, int *clen, in test_rsa_simple() argument 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() [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() 248 error = uiomove(tob->tob_data + cbegin, clen, uio); in ttyoutq_read_uio() 259 memcpy(ob, tob->tob_data + cbegin, clen); in ttyoutq_read_uio() [all …]
|