| /f-stack/freebsd/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 …]
|
| /f-stack/freebsd/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()
|
| H A D | crypto_box.c | 94 unsigned long long clen, const unsigned char *n, in crypto_box_open_afternm() argument 97 return crypto_box_curve25519xsalsa20poly1305_open_afternm(m, c, clen, n, k); in crypto_box_open_afternm() 110 unsigned long long clen, const unsigned char *n, in crypto_box_open() argument 113 return crypto_box_curve25519xsalsa20poly1305_open(m, c, clen, n, pk, sk); in crypto_box_open()
|
| /f-stack/freebsd/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 …]
|
| /f-stack/freebsd/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()
|
| /f-stack/freebsd/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 …]
|
| /f-stack/freebsd/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()
|
| /f-stack/freebsd/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 …]
|
| /f-stack/tools/ifconfig/ |
| H A D | ifgre.c | 64 size_t clen = sizeof(uint32_t); in gre_status() 65 if (ioctl_va(s, GREGKEY, &ifr, 3, offset, ifr.ifr_data, clen) == 0) in gre_status() 73 if (ioctl_va(s, GREGOPTS, &ifr, 3, offset, ifr.ifr_data, clen) != 0 || opts == 0) in gre_status() 82 if (ioctl_va(s, GREGOPTS, &ifr, 3, offset, ifr.ifr_data, clen) != 0 || opts == 0) in gre_status() 101 size_t clen = sizeof(uint32_t); in setifgrekey() 102 if (ioctl_va(s, GRESKEY, (caddr_t)&ifr, 3, offset, ifr.ifr_data, clen) < 0) in setifgrekey() 119 size_t clen = sizeof(uint32_t); in setifgreport() 120 if (ioctl_va(s, GRESPORT, (caddr_t)&ifr, 3, offset, ifr.ifr_data, clen) < 0) in setifgreport() 135 size_t clen = sizeof(uint32_t); 136 if (ioctl_va(s, GREGOPTS, (caddr_t)&ifr, 3, offset, ifr.ifr_data, clen) == -1) { [all …]
|
| H A D | ifgif.c | 70 size_t clen = sizeof(int); in gif_status() 71 if (ioctl_va(s, GIFGOPTS, &ifr, 3, offset, ifr.ifr_data, clen) == -1) in gif_status() 90 size_t clen = sizeof(int); 91 if (ioctl_va(s, GIFGOPTS, &ifr, 3, offset, ifr.ifr_data, clen) == -1) { 105 if (ioctl_va(s, GIFSOPTS, &ifr, 3, offset, ifr.ifr_data, clen) == -1) {
|
| H A D | ifvlan.c | 88 size_t clen = sizeof(*vreq); in getvlan() local 89 return ioctl_va(s, SIOCGETVLAN, (caddr_t)ifr, 3, offset, ifr->ifr_data, clen); in getvlan() 173 size_t clen = sizeof(params); in vlan_create() local 174 if (ioctl_va(s, SIOCIFCREATE2, ifr, 3, offset, ifr->ifr_data, clen) < 0) in vlan_create() 198 size_t clen = sizeof(params); in vlan_set() 199 if (ioctl_va(s, SIOCSETVLAN, ifr, 3, offset, ifr->ifr_data, clen) == -1) in vlan_set() 281 size_t clen = sizeof(vreq); in DECL_CMD_FUNC() 282 if (ioctl_va(s, SIOCGETVLAN, (caddr_t)&ifr, 3, offset, ifr.ifr_data, clen) == -1) in DECL_CMD_FUNC() 292 if (ioctl_va(s, SIOCSETVLAN, (caddr_t)&ifr, 3, offset, ifr.ifr_data, clen) == -1) in DECL_CMD_FUNC()
|
| H A D | ifipsec.c | 63 size_t clen = sizeof(uint32_t); in ipsec_status() 64 if (ioctl_va(s, IPSECGREQID, &ifr, 3, offset, ifr.ifr_data, clen) == -1) in ipsec_status() 87 size_t clen = sizeof(uint32_t); 88 if (ioctl_va(s, IPSECGREQID, &ifr, 3, offset, ifr.ifr_data, clen) == -1) {
|
| /f-stack/freebsd/kern/ |
| H A D | tty_outq.c | 149 size_t cbegin, cend, clen; in ttyoutq_read() local 167 clen = cend - cbegin; in ttyoutq_read() 170 memcpy(cbuf, tob->tob_data + cbegin, clen); in ttyoutq_read() 171 cbuf += clen; in ttyoutq_read() 172 len -= clen; in ttyoutq_read() 186 to->to_begin += clen; in ttyoutq_read() 210 size_t cbegin, cend, clen; in ttyoutq_read_uio() local 228 clen = cend - cbegin; in ttyoutq_read_uio() 262 memcpy(ob, tob->tob_data + cbegin, clen); in ttyoutq_read_uio() 263 to->to_begin += clen; in ttyoutq_read_uio() [all …]
|
| /f-stack/freebsd/contrib/libsodium/src/libsodium/crypto_stream/salsa2012/ref/ |
| H A D | stream_salsa2012_ref.c | 14 crypto_stream_salsa2012(unsigned char *c, unsigned long long clen, in crypto_stream_salsa2012() argument 23 if (!clen) { in crypto_stream_salsa2012() 35 while (clen >= 64) { in crypto_stream_salsa2012() 43 clen -= 64; in crypto_stream_salsa2012() 46 if (clen) { in crypto_stream_salsa2012() 48 for (i = 0; i < (unsigned int)clen; ++i) { in crypto_stream_salsa2012()
|
| /f-stack/freebsd/contrib/libsodium/src/libsodium/crypto_stream/salsa208/ref/ |
| H A D | stream_salsa208_ref.c | 14 crypto_stream_salsa208(unsigned char *c, unsigned long long clen, in crypto_stream_salsa208() argument 23 if (!clen) { in crypto_stream_salsa208() 35 while (clen >= 64) { in crypto_stream_salsa208() 43 clen -= 64; in crypto_stream_salsa208() 46 if (clen) { in crypto_stream_salsa208() 48 for (i = 0; i < (unsigned int)clen; ++i) { in crypto_stream_salsa208()
|
| /f-stack/freebsd/contrib/libsodium/src/libsodium/include/sodium/ |
| H A D | crypto_box.h | 66 unsigned long long clen, const unsigned char *n, 80 unsigned long long clen, 104 unsigned long long clen, const unsigned char *n, 116 unsigned long long clen, const unsigned char *n, 132 unsigned long long clen, 154 unsigned long long clen, const unsigned char *n, 165 unsigned long long clen, const unsigned char *n,
|
| H A D | crypto_box_curve25519xchacha20poly1305.h | 66 unsigned long long clen, 86 unsigned long long clen, 110 unsigned long long clen, 127 unsigned long long clen, 150 unsigned long long clen,
|
| /f-stack/freebsd/contrib/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/ |
| H A D | chacha20_dolbeau-ssse3.c | 84 stream_ref(unsigned char *c, unsigned long long clen, const unsigned char *n, in stream_ref() argument 89 if (!clen) { in stream_ref() 95 memset(c, 0, clen); in stream_ref() 96 chacha20_encrypt_bytes(&ctx, c, c, clen); in stream_ref() 103 stream_ietf_ref(unsigned char *c, unsigned long long clen, in stream_ietf_ref() argument 108 if (!clen) { in stream_ietf_ref() 114 memset(c, 0, clen); in stream_ietf_ref() 115 chacha20_encrypt_bytes(&ctx, c, c, clen); in stream_ietf_ref()
|
| H A D | chacha20_dolbeau-avx2.c | 90 stream_ref(unsigned char *c, unsigned long long clen, const unsigned char *n, in stream_ref() argument 95 if (!clen) { in stream_ref() 101 memset(c, 0, clen); in stream_ref() 102 chacha20_encrypt_bytes(&ctx, c, c, clen); in stream_ref() 109 stream_ietf_ref(unsigned char *c, unsigned long long clen, in stream_ietf_ref() argument 114 if (!clen) { in stream_ietf_ref() 120 memset(c, 0, clen); in stream_ietf_ref() 121 chacha20_encrypt_bytes(&ctx, c, c, clen); in stream_ietf_ref()
|
| /f-stack/freebsd/contrib/libsodium/src/libsodium/crypto_stream/salsa20/ref/ |
| H A D | salsa20_ref.c | 19 stream_ref(unsigned char *c, unsigned long long clen, const unsigned char *n, in stream_ref() argument 28 if (!clen) { in stream_ref() 40 while (clen >= 64) { in stream_ref() 48 clen -= 64; in stream_ref() 51 if (clen) { in stream_ref() 53 for (i = 0; i < (unsigned int) clen; i++) { in stream_ref()
|
| /f-stack/freebsd/contrib/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/ |
| H A D | pbkdf2-sha256.c | 57 size_t clen; in PBKDF2_SHA256() local 88 clen = dkLen - i * 32; in PBKDF2_SHA256() 89 if (clen > 32) { in PBKDF2_SHA256() 90 clen = 32; in PBKDF2_SHA256() 92 memcpy(&buf[i * 32], T, clen); in PBKDF2_SHA256()
|
| /f-stack/freebsd/contrib/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ |
| H A D | secretbox_xsalsa20poly1305.c | 27 unsigned long long clen, in crypto_secretbox_xsalsa20poly1305_open() argument 34 if (clen < 32) { in crypto_secretbox_xsalsa20poly1305_open() 39 clen - 32, subkey) != 0) { in crypto_secretbox_xsalsa20poly1305_open() 42 crypto_stream_xsalsa20_xor(m, c, clen, n, k); in crypto_secretbox_xsalsa20poly1305_open()
|
| /f-stack/tools/compat/ |
| H A D | ioctl.c | 55 size_t offset, clen; in ioctl_va() local 68 clen = va_arg(ap, size_t); in ioctl_va() 120 if (size + clen > msg->buf_len) { in ioctl_va() 128 memcpy(buf_addr, cpy_mem, clen); in ioctl_va() 155 memcpy(cpy_mem, retmsg->buf_addr, clen); in ioctl_va()
|