| /f-stack/freebsd/contrib/libsodium/test/default/ |
| H A D | sodium_utils.c | 33 memset(nonce, 0, sizeof nonce); in main() 34 sodium_increment(nonce, sizeof nonce); in main() 37 memset(nonce, 255, sizeof nonce); in main() 38 sodium_increment(nonce, sizeof nonce); in main() 42 sodium_increment(nonce, sizeof nonce); in main() 129 sodium_add(nonce, nonce, 7U); in main() 130 sodium_add(nonce, nonce, 8U); in main() 135 sodium_add(nonce, nonce, 11U); in main() 136 sodium_add(nonce, nonce, 12U); in main() 140 sodium_add(nonce, nonce, 23U); in main() [all …]
|
| H A D | xchacha20.c | 107 unsigned char *nonce; in tv_stream_xchacha20() local 122 tv->nonce, strlen(tv->nonce), NULL, NULL, NULL); in tv_stream_xchacha20() 182 sodium_free(nonce); in tv_stream_xchacha20() 235 tv->nonce, strlen(tv->nonce), NULL, NULL, NULL); in tv_secretbox_xchacha20poly1305() 259 nonce[0]++; in tv_secretbox_xchacha20poly1305() 263 nonce[0]--; in tv_secretbox_xchacha20poly1305() 281 m_len, nonce, key); in tv_secretbox_xchacha20poly1305() 288 sodium_free(nonce); in tv_secretbox_xchacha20poly1305() 308 unsigned char *nonce; in tv_box_xchacha20poly1305() local 364 nonce, pc) == 0); in tv_box_xchacha20poly1305() [all …]
|
| H A D | chacha20.c | 23 unsigned char nonce[crypto_stream_chacha20_NONCEBYTES]; in tv() local 35 sodium_hex2bin(nonce, sizeof nonce, tests[i].nonce_hex, in tv() 37 crypto_stream_chacha20(out, sizeof out, nonce, key); in tv() 52 crypto_stream_chacha20(out, plen, nonce, key); in tv() 57 crypto_stream_chacha20(out, sizeof out, nonce, key); in tv() 61 assert(crypto_stream_chacha20(out, 0U, nonce, key) == 0); in tv() 67 crypto_stream_chacha20_xor(out, out, sizeof out, nonce, key); in tv() 110 unsigned char nonce[crypto_stream_chacha20_IETF_NONCEBYTES]; in tv_ietf() local 122 sodium_hex2bin(nonce, sizeof nonce, tests[i].nonce_hex, in tv_ietf() 140 crypto_stream_chacha20(out, plen, nonce, key); in tv_ietf() [all …]
|
| H A D | box_easy2.c | 19 unsigned char *nonce; in main() local 42 nonce = (unsigned char *) sodium_malloc(crypto_box_NONCEBYTES); in main() 49 randombytes_buf(nonce, crypto_box_NONCEBYTES); in main() 50 ret = crypto_box_easy(c, m, mlen, nonce, bobpk, alicesk); in main() 54 nonce, alicepk, bobsk) != 0) { in main() 75 nonce, alicepk, bobsk) != 0) { in main() 91 if (crypto_box_easy_afternm(c, m, 0, nonce, k1) != 0) { in main() 96 crypto_box_easy_afternm(c, m, (unsigned long long) mlen, nonce, k1); in main() 98 m2, c, (unsigned long long) mlen + crypto_box_MACBYTES, nonce, in main() 130 nonce, k2) != 0) { in main() [all …]
|
| H A D | secretbox_easy2.c | 11 unsigned char *nonce; in main() local 21 nonce = (unsigned char *) sodium_malloc(crypto_secretbox_NONCEBYTES); in main() 26 randombytes_buf(nonce, crypto_secretbox_NONCEBYTES); in main() 27 crypto_secretbox_easy(c, m, (unsigned long long) mlen, nonce, k); in main() 29 m2, c, (unsigned long long) mlen + crypto_secretbox_MACBYTES, nonce, in main() 36 if (crypto_secretbox_open_easy(m2, c, (unsigned long long) i, nonce, in main() 42 crypto_secretbox_detached(c, mac, m, (unsigned long long) mlen, nonce, k); in main() 44 nonce, k) != 0) { in main() 48 nonce, k) != 0) { in main() 54 crypto_secretbox_easy(c, c, (unsigned long long) mlen, nonce, k); in main() [all …]
|
| H A D | aead_chacha20poly1305.c | 20 static const unsigned char nonce[crypto_aead_chacha20poly1305_NPUBBYTES] in tv() local 35 NULL, nonce, firstkey); in tv() 49 NULL, nonce, firstkey); in tv() 59 nonce, firstkey) != 0) { in tv() 86 ad, ADLEN, nonce, firstkey) in tv() 94 NULL, 0U, NULL, nonce, firstkey); in tv() 120 NULL, 0U, nonce, firstkey) != -1) { in tv() 129 nonce, firstkey) != -1) { in tv() 139 NULL, 0U, NULL, nonce, firstkey); in tv() 218 NULL, nonce, firstkey); in tv_ietf() [all …]
|
| H A D | secretbox_easy.c | 11 static unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, variable 41 crypto_secretbox_easy(c, m, 131, nonce, firstkey); in main() 47 crypto_secretbox_detached(c, mac, m, 131, nonce, firstkey); in main() 59 crypto_secretbox_easy(c, c + 1, 131, nonce, firstkey); in main() 66 crypto_secretbox_easy(c + 1, c, 131, nonce, firstkey); in main() 73 crypto_secretbox_easy(c, c, 131, nonce, firstkey); in main() 79 assert(crypto_secretbox_easy(c, m, 0, nonce, firstkey) == 0); in main() 83 crypto_secretbox_easy(c, c, 0, nonce, firstkey); in main() 88 if (crypto_secretbox_open_easy(c, c, crypto_secretbox_MACBYTES, nonce, in main() 106 crypto_secretbox_easy(c, c + 10, 10, nonce, firstkey); in main() [all …]
|
| H A D | aead_xchacha20poly1305.c | 25 static const unsigned char nonce[crypto_aead_xchacha20poly1305_ietf_NPUBBYTES] in tv() local 44 NULL, nonce, firstkey); in tv() 59 NULL, nonce, firstkey); in tv() 68 ADLEN, nonce, firstkey) != 0) { in tv() 81 nonce, firstkey) != 0) { in tv() 91 ad, ADLEN, nonce, firstkey) in tv() 98 NULL, 0U, NULL, nonce, firstkey); in tv() 123 NULL, 0U, nonce, firstkey) != -1) { in tv() 132 nonce, firstkey) != -1) { in tv() 142 NULL, 0U, NULL, nonce, firstkey); in tv() [all …]
|
| H A D | secretbox2.c | 11 static unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, variable 41 if (crypto_secretbox_open(m, c, 163, nonce, firstkey) == 0) { in main() 49 assert(crypto_secretbox_open(m, c, 31, nonce, firstkey) == -1); in main() 50 assert(crypto_secretbox_open(m, c, 16, nonce, firstkey) == -1); in main() 51 assert(crypto_secretbox_open(m, c, 1, nonce, firstkey) == -1); in main() 52 assert(crypto_secretbox_open(m, c, 0, nonce, firstkey) == -1); in main()
|
| H A D | secretbox.c | 11 static unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, variable 41 crypto_secretbox(c, m, 163, nonce, firstkey); in main() 50 crypto_secretbox(c, c, 163, nonce, firstkey); in main() 58 assert(crypto_secretbox(c, c, 31, nonce, firstkey) == -1); in main() 59 assert(crypto_secretbox(c, c, 12, nonce, firstkey) == -1); in main() 60 assert(crypto_secretbox(c, c, 1, nonce, firstkey) == -1); in main() 61 assert(crypto_secretbox(c, c, 0, nonce, firstkey) == -1); in main()
|
| H A D | stream.c | 11 static unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, variable 27 crypto_stream(output, sizeof output, nonce, firstkey); in main() 34 crypto_stream_xsalsa20_xor_ic(output, output, 4000, nonce, 0U, firstkey); in main() 38 crypto_stream_xsalsa20_xor_ic(output, output, 4000, nonce, 1U, firstkey); in main() 45 crypto_stream(output, (int) (i & 0xff), nonce, firstkey); in main() 51 crypto_stream_xsalsa20_xor_ic(output, output, 192, nonce, in main()
|
| H A D | aead_aes256gcm.c | 3090 unsigned char *nonce; in tv() local 3102 nonce = (unsigned char *) sodium_malloc(crypto_aead_aes256gcm_NPUBBYTES); in tv() 3111 sodium_hex2bin(nonce, crypto_aead_aes256gcm_NPUBBYTES, in tv() 3141 ad, ad_len, NULL, nonce, key); in tv() 3157 ad, ad_len, NULL, nonce, key); in tv() 3174 ad, ad_len, nonce, key) != -1) { in tv() 3184 ad, ad_len, nonce, key) != -1) { in tv() 3190 ad, ad_len, nonce, key) != 0) { in tv() 3195 ad, ad_len, nonce, key) != 0) { in tv() 3206 mac, ad, ad_len, nonce, key) != 0) { in tv() [all …]
|
| H A D | box_easy.c | 17 static unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, variable 44 ret = crypto_box_easy(c, m, 131, nonce, bobpk, alicesk); in main() 53 ret = crypto_box_easy(c, c, 0, nonce, bobpk, alicesk); in main() 60 crypto_box_open_easy(c, c, crypto_box_MACBYTES, nonce, bobpk, alicesk); in main() 67 ret = crypto_box_open_easy(c, c, crypto_box_MACBYTES, nonce, bobpk, alicesk); in main()
|
| H A D | box2.c | 23 static unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, variable 55 if (crypto_box_open(m, c, 163, nonce, alicepk, bobsk) == 0) { in main() 63 ret = crypto_box_open(m, c, 163, nonce, small_order_p, bobsk); in main() 71 if (crypto_box_open_afternm(m, c, 163, nonce, k) == 0) { in main()
|
| H A D | box.c | 23 static const unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, variable 55 ret = crypto_box(c, m, 163, nonce, bobpk, alicesk); in main() 64 ret = crypto_box(c, m, 163, nonce, small_order_p, alicesk); in main() 71 crypto_box_afternm(c, m, 163, nonce, k); in main()
|
| H A D | stream3.c | 11 static unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, variable 23 crypto_stream(rs, 32, nonce, firstkey); in main()
|
| H A D | stream4.c | 11 static unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, variable 40 crypto_stream_xor(c, m, 163, nonce, firstkey); in main()
|
| /f-stack/freebsd/contrib/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/ |
| H A D | box_seal_curve25519xchacha20poly1305.c | 10 _crypto_box_curve25519xchacha20poly1305_seal_nonce(unsigned char *nonce, in _crypto_box_curve25519xchacha20poly1305_seal_nonce() argument 22 crypto_generichash_final(&st, nonce, in _crypto_box_curve25519xchacha20poly1305_seal_nonce() 33 unsigned char nonce[crypto_box_curve25519xchacha20poly1305_NONCEBYTES]; in crypto_box_curve25519xchacha20poly1305_seal() local 42 _crypto_box_curve25519xchacha20poly1305_seal_nonce(nonce, epk, pk); in crypto_box_curve25519xchacha20poly1305_seal() 45 nonce, pk, esk); in crypto_box_curve25519xchacha20poly1305_seal() 48 sodium_memzero(nonce, sizeof nonce); in crypto_box_curve25519xchacha20poly1305_seal() 59 unsigned char nonce[crypto_box_curve25519xchacha20poly1305_NONCEBYTES]; in crypto_box_curve25519xchacha20poly1305_seal_open() local 64 _crypto_box_curve25519xchacha20poly1305_seal_nonce(nonce, c, pk); in crypto_box_curve25519xchacha20poly1305_seal_open() 72 nonce, c, sk); in crypto_box_curve25519xchacha20poly1305_seal_open()
|
| /f-stack/freebsd/contrib/libsodium/src/libsodium/crypto_box/ |
| H A D | crypto_box_seal.c | 10 _crypto_box_seal_nonce(unsigned char *nonce, in _crypto_box_seal_nonce() argument 18 crypto_generichash_final(&st, nonce, crypto_box_NONCEBYTES); in _crypto_box_seal_nonce() 27 unsigned char nonce[crypto_box_NONCEBYTES]; in crypto_box_seal() local 36 _crypto_box_seal_nonce(nonce, epk, pk); in crypto_box_seal() 38 nonce, pk, esk); in crypto_box_seal() 41 sodium_memzero(nonce, sizeof nonce); in crypto_box_seal() 51 unsigned char nonce[crypto_box_NONCEBYTES]; in crypto_box_seal_open() local 56 _crypto_box_seal_nonce(nonce, c, pk); in crypto_box_seal_open() 61 nonce, c, sk); in crypto_box_seal_open()
|
| /f-stack/freebsd/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ |
| H A D | sign.c | 71 unsigned char nonce[64]; in _crypto_sign_ed25519_detached() local 79 _crypto_sign_ed25519_synthetic_r_hv(&hs, nonce, az); in _crypto_sign_ed25519_detached() 86 crypto_hash_sha512_final(&hs, nonce); in _crypto_sign_ed25519_detached() 90 sc25519_reduce(nonce); in _crypto_sign_ed25519_detached() 91 ge25519_scalarmult_base(&R, nonce); in _crypto_sign_ed25519_detached() 101 sc25519_muladd(sig + 32, hram, az, nonce); in _crypto_sign_ed25519_detached() 104 sodium_memzero(nonce, sizeof nonce); in _crypto_sign_ed25519_detached()
|
| H A D | obsolete.c | 38 unsigned char nonce[64]; in crypto_sign_edwards25519sha512batch() local 47 crypto_hash_sha512_final(&hs, nonce); in crypto_sign_edwards25519sha512batch() 50 sc25519_reduce(nonce); in crypto_sign_edwards25519sha512batch() 51 ge25519_scalarmult_base(&R, nonce); in crypto_sign_edwards25519sha512batch() 58 sc25519_muladd(sig + 32, hram, nonce, sk); in crypto_sign_edwards25519sha512batch()
|
| /f-stack/freebsd/contrib/libsodium/src/libsodium/crypto_secretstream/xchacha20poly1305/ |
| H A D | secretstream_xchacha20poly1305.c | 20 #define STATE_COUNTER(STATE) ((STATE)->nonce) 21 #define STATE_INONCE(STATE) ((STATE)->nonce + \ 53 COMPILER_ASSERT(sizeof state->nonce == in crypto_secretstream_xchacha20poly1305_init_push() 99 state->nonce, state->k); in crypto_secretstream_xchacha20poly1305_rekey() 129 crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k); in crypto_secretstream_xchacha20poly1305_push() 140 state->nonce, 1U, state->k); in crypto_secretstream_xchacha20poly1305_push() 145 crypto_stream_chacha20_ietf_xor_ic(c, m, mlen, state->nonce, 2U, state->k); in crypto_secretstream_xchacha20poly1305_push() 205 crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k); in crypto_secretstream_xchacha20poly1305_pull() 216 state->nonce, 1U, state->k); in crypto_secretstream_xchacha20poly1305_pull() 240 crypto_stream_chacha20_ietf_xor_ic(m, c, mlen, state->nonce, 2U, state->k); in crypto_secretstream_xchacha20poly1305_pull()
|
| /f-stack/freebsd/contrib/libsodium/src/libsodium/randombytes/salsa20/ |
| H A D | randombytes_salsa20_random.c | 96 uint64_t nonce; member 149 stream.nonce = sodium_hrtime(); in randombytes_salsa20_random_init() 150 assert(stream.nonce != (uint64_t) 0U); in randombytes_salsa20_random_init() 294 stream.nonce = sodium_hrtime(); in randombytes_salsa20_random_init() 296 assert(stream.nonce != (uint64_t) 0U); in randombytes_salsa20_random_init() 490 COMPILER_ASSERT(sizeof stream.nonce == crypto_stream_salsa20_NONCEBYTES); in randombytes_salsa20_random_buf() 498 (unsigned char *) &stream.nonce, stream.key); in randombytes_salsa20_random_buf() 504 stream.nonce++; in randombytes_salsa20_random_buf() 506 (unsigned char *) &stream.nonce, stream.key); in randombytes_salsa20_random_buf() 529 (unsigned char *) &stream.nonce, in randombytes_salsa20_random() [all …]
|
| /f-stack/freebsd/crypto/aesni/ |
| H A D | aesni_ccm.c | 90 const unsigned char *nonce, size_t nonce_len, in cbc_mac_start() argument 109 bcopy(nonce, byte_ptr + 1, nonce_len); in cbc_mac_start() 198 const unsigned char *addt, const unsigned char *nonce, in AES_CCM_encrypt() argument 238 rolling_mac = cbc_mac_start(addt, abytes, nonce, nlen, in AES_CCM_encrypt() 244 bcopy(nonce, &byte_ptr[1], nlen); in AES_CCM_encrypt() 380 const unsigned char *addt, const unsigned char *nonce, in AES_CCM_decrypt() argument 414 rolling_mac = cbc_mac_start(addt, abytes, nonce, nlen, in AES_CCM_decrypt() 419 bcopy(nonce, &byte_ptr[1], nlen); in AES_CCM_decrypt()
|
| /f-stack/dpdk/lib/librte_ipsec/ |
| H A D | crypto.h | 19 uint32_t nonce; member 55 aes_ctr_cnt_blk_fill(struct aesctr_cnt_blk *ctr, uint64_t iv, uint32_t nonce) in aes_ctr_cnt_blk_fill() argument 57 ctr->nonce = nonce; in aes_ctr_cnt_blk_fill()
|