/freebsd-current/sys/contrib/libsodium/test/default/ |
H A D | sodium_utils.c | 12 unsigned char nonce[24]; local 33 memset(nonce, 0, sizeof nonce); 34 sodium_increment(nonce, sizeof nonce); 36 sodium_bin2hex(nonce_hex, sizeof nonce_hex, nonce, sizeof nonce)); 37 memset(nonce, 255, sizeof nonce); 38 sodium_increment(nonce, sizeo [all...] |
H A D | secretbox_easy2.c | 11 unsigned char *nonce; local 21 nonce = (unsigned char *) sodium_malloc(crypto_secretbox_NONCEBYTES); 26 randombytes_buf(nonce, crypto_secretbox_NONCEBYTES); 27 crypto_secretbox_easy(c, m, (unsigned long long) mlen, nonce, k); 29 m2, c, (unsigned long long) mlen + crypto_secretbox_MACBYTES, nonce, 36 if (crypto_secretbox_open_easy(m2, c, (unsigned long long) i, nonce, 42 crypto_secretbox_detached(c, mac, m, (unsigned long long) mlen, nonce, k); 44 nonce, k) != 0) { 48 nonce, k) != 0) { 54 crypto_secretbox_easy(c, c, (unsigned long long) mlen, nonce, [all...] |
H A D | chacha20.c | 23 unsigned char nonce[crypto_stream_chacha20_NONCEBYTES]; local 35 sodium_hex2bin(nonce, sizeof nonce, tests[i].nonce_hex, 37 crypto_stream_chacha20(out, sizeof out, nonce, key); 42 crypto_stream_chacha20_xor(part, out, plen, nonce, key); 52 crypto_stream_chacha20(out, plen, nonce, key); 57 crypto_stream_chacha20(out, sizeof out, nonce, key); 61 assert(crypto_stream_chacha20(out, 0U, nonce, key) == 0); 62 assert(crypto_stream_chacha20_xor(out, out, 0U, nonce, key) == 0); 63 assert(crypto_stream_chacha20_xor(out, out, 0U, nonce, ke 110 unsigned char nonce[crypto_stream_chacha20_IETF_NONCEBYTES]; local [all...] |
H A D | xchacha20.c | 85 const char nonce[crypto_stream_xchacha20_NONCEBYTES * 2 + 1]; member in struct:XChaCha20TV_ 107 unsigned char *nonce; local 114 nonce = (unsigned char *) sodium_malloc(crypto_stream_xchacha20_NONCEBYTES); 121 sodium_hex2bin(nonce, crypto_stream_xchacha20_NONCEBYTES, 122 tv->nonce, strlen(tv->nonce), NULL, NULL, NULL); 126 crypto_stream_xchacha20(out2, out_len, nonce, key); 128 crypto_stream_xchacha20_xor(out2, out, out_len, nonce, key); 130 crypto_stream_xchacha20_xor_ic(out2, out, out_len, nonce, 0, key); 132 crypto_stream_xchacha20_xor_ic(out2, out, out_len, nonce, 194 const char nonce[crypto_secretbox_xchacha20poly1305_NONCEBYTES * 2 + 1]; member in struct:XChaCha20Poly1305TV_ 216 unsigned char *nonce; local 308 unsigned char *nonce; local [all...] |
H A D | box_easy2.c | 19 unsigned char *nonce; local 42 nonce = (unsigned char *) sodium_malloc(crypto_box_NONCEBYTES); 49 randombytes_buf(nonce, crypto_box_NONCEBYTES); 50 ret = crypto_box_easy(c, m, mlen, nonce, bobpk, alicesk); 54 nonce, alicepk, bobsk) != 0) { 61 if (crypto_box_open_easy(m2, c, (unsigned long long) i, nonce, alicepk, 69 crypto_box_easy(c, c, (unsigned long long) mlen, nonce, bobpk, alicesk); 75 nonce, alicepk, bobsk) != 0) { 91 if (crypto_box_easy_afternm(c, m, 0, nonce, k1) != 0) { 96 crypto_box_easy_afternm(c, m, (unsigned long long) mlen, nonce, k [all...] |
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); 34 crypto_stream_xsalsa20_xor_ic(output, output, 4000, nonce, 0U, firstkey); 38 crypto_stream_xsalsa20_xor_ic(output, output, 4000, nonce, 1U, firstkey); 45 crypto_stream(output, (int) (i & 0xff), nonce, firstkey); 51 crypto_stream_xsalsa20_xor_ic(output, output, 192, nonce,
|
H A D | aead_chacha20poly1305.c | 20 static const unsigned char nonce[crypto_aead_chacha20poly1305_NPUBBYTES] local 35 NULL, nonce, firstkey); 49 NULL, nonce, firstkey); 59 nonce, firstkey) != 0) { 72 nonce, firstkey) == 0); 76 nonce, firstkey) != 0) { 86 ad, ADLEN, nonce, firstkey) 94 NULL, 0U, NULL, nonce, firstkey); 107 NULL, 0U, nonce, firstkey) != 0) { 120 NULL, 0U, nonce, firstke 200 static const unsigned char nonce[crypto_aead_chacha20poly1305_ietf_NPUBBYTES] local [all...] |
H A D | aead_xchacha20poly1305.c | 25 static const unsigned char nonce[crypto_aead_xchacha20poly1305_ietf_NPUBBYTES] local 44 NULL, nonce, firstkey); 59 NULL, nonce, firstkey); 68 ADLEN, nonce, firstkey) != 0) { 81 nonce, firstkey) != 0) { 91 ad, ADLEN, nonce, firstkey) 98 NULL, 0U, NULL, nonce, firstkey); 110 NULL, 0U, nonce, firstkey) != 0) { 123 NULL, 0U, nonce, firstkey) != -1) { 132 nonce, firstke [all...] |
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);
|
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); 47 crypto_secretbox_detached(c, mac, m, 131, nonce, firstkey); 59 crypto_secretbox_easy(c, c + 1, 131, nonce, firstkey); 66 crypto_secretbox_easy(c + 1, c, 131, nonce, firstkey); 73 crypto_secretbox_easy(c, c, 131, nonce, firstkey); 79 assert(crypto_secretbox_easy(c, m, 0, nonce, firstkey) == 0); 83 crypto_secretbox_easy(c, c, 0, nonce, firstkey); 88 if (crypto_secretbox_open_easy(c, c, crypto_secretbox_MACBYTES, nonce, 97 if (crypto_secretbox_open_easy(c, c, crypto_secretbox_MACBYTES, nonce, [all...] |
/freebsd-current/sys/contrib/libsodium/src/libsodium/crypto_box/ |
H A D | crypto_box_seal.c | 10 _crypto_box_seal_nonce(unsigned char *nonce, argument 18 crypto_generichash_final(&st, nonce, crypto_box_NONCEBYTES); 27 unsigned char nonce[crypto_box_NONCEBYTES]; local 36 _crypto_box_seal_nonce(nonce, epk, pk); 38 nonce, pk, esk); 41 sodium_memzero(nonce, sizeof nonce); 51 unsigned char nonce[crypto_box_NONCEBYTES]; local 56 _crypto_box_seal_nonce(nonce, c, pk); 61 nonce, [all...] |
/freebsd-current/sys/contrib/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/ |
H A D | box_seal_curve25519xchacha20poly1305.c | 10 _crypto_box_curve25519xchacha20poly1305_seal_nonce(unsigned char *nonce, argument 22 crypto_generichash_final(&st, nonce, 33 unsigned char nonce[crypto_box_curve25519xchacha20poly1305_NONCEBYTES]; local 42 _crypto_box_curve25519xchacha20poly1305_seal_nonce(nonce, epk, pk); 45 nonce, pk, esk); 48 sodium_memzero(nonce, sizeof nonce); 59 unsigned char nonce[crypto_box_curve25519xchacha20poly1305_NONCEBYTES]; local 64 _crypto_box_curve25519xchacha20poly1305_seal_nonce(nonce, c, pk); 72 nonce, [all...] |
/freebsd-current/crypto/openssl/crypto/modes/ |
H A D | ccm128.c | 30 memset(ctx->nonce.c, 0, sizeof(ctx->nonce.c)); 31 ctx->nonce.c[0] = ((u8)(L - 1) & 7) | (u8)(((M - 2) / 2) & 7) << 3; 39 /* Then you setup per-message nonce and pass the length of the message */ 41 const unsigned char *nonce, size_t nlen, size_t mlen) 43 unsigned int L = ctx->nonce.c[0] & 7; /* the L parameter */ 46 return -1; /* nonce is too short */ 49 ctx->nonce.c[8] = (u8)(mlen >> (56 % (sizeof(mlen) * 8))); 50 ctx->nonce.c[9] = (u8)(mlen >> (48 % (sizeof(mlen) * 8))); 51 ctx->nonce 40 CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, const unsigned char *nonce, size_t nlen, size_t mlen) argument [all...] |
/freebsd-current/sys/crypto/ |
H A D | chacha20_poly1305.h | 40 const uint8_t *nonce, const size_t nonce_len, const uint8_t *key); 44 const uint8_t *nonce, const size_t nonce_len, const uint8_t *key); 48 const uint8_t *nonce, const uint8_t *key); 52 const uint8_t *nonce, const uint8_t *key);
|
/freebsd-current/sys/dev/wg/ |
H A D | crypto.h | 29 const uint64_t nonce, 34 le64enc(nonce_bytes, nonce); 42 const uint64_t nonce, 47 le64enc(nonce_bytes, nonce); 56 const uint8_t nonce[XCHACHA20POLY1305_NONCE_SIZE], 59 xchacha20_poly1305_encrypt(dst, src, src_len, ad, ad_len, nonce, key); 66 const uint8_t nonce[XCHACHA20POLY1305_NONCE_SIZE], 69 return (xchacha20_poly1305_decrypt(dst, src, src_len, ad, ad_len, nonce, key)); 73 chacha20poly1305_encrypt_mbuf(struct mbuf *, const uint64_t nonce, 77 chacha20poly1305_decrypt_mbuf(struct mbuf *, const uint64_t nonce, 27 chacha20poly1305_encrypt(uint8_t *dst, const uint8_t *src, const size_t src_len, const uint8_t *ad, const size_t ad_len, const uint64_t nonce, const uint8_t key[CHACHA20POLY1305_KEY_SIZE]) argument 40 chacha20poly1305_decrypt(uint8_t *dst, const uint8_t *src, const size_t src_len, const uint8_t *ad, const size_t ad_len, const uint64_t nonce, const uint8_t key[CHACHA20POLY1305_KEY_SIZE]) argument 53 xchacha20poly1305_encrypt(uint8_t *dst, const uint8_t *src, const size_t src_len, const uint8_t *ad, const size_t ad_len, const uint8_t nonce[XCHACHA20POLY1305_NONCE_SIZE], const uint8_t key[CHACHA20POLY1305_KEY_SIZE]) argument 63 xchacha20poly1305_decrypt(uint8_t *dst, const uint8_t *src, const size_t src_len, const uint8_t *ad, const size_t ad_len, const uint8_t nonce[XCHACHA20POLY1305_NONCE_SIZE], const uint8_t key[CHACHA20POLY1305_KEY_SIZE]) argument [all...] |
/freebsd-current/sys/crypto/openssl/ |
H A D | ossl_poly1305.h | 21 const unsigned int nonce[4]); 28 unsigned int nonce[4]; member in struct:poly1305_context
|
/freebsd-current/sys/contrib/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ |
H A D | sign.c | 71 unsigned char nonce[64]; local 79 _crypto_sign_ed25519_synthetic_r_hv(&hs, nonce, az); 86 crypto_hash_sha512_final(&hs, nonce); 90 sc25519_reduce(nonce); 91 ge25519_scalarmult_base(&R, nonce); 101 sc25519_muladd(sig + 32, hram, az, nonce); 104 sodium_memzero(nonce, sizeof nonce);
|
/freebsd-current/crypto/openssl/include/crypto/ |
H A D | poly1305.h | 25 const unsigned int nonce[4]); 32 unsigned int nonce[4]; member in struct:poly1305_context
|
/freebsd-current/contrib/bearssl/src/ssl/ |
H A D | ssl_rec_ccm.c | 73 unsigned char nonce[12], header[13]; local 80 * Make nonce (implicit + explicit parts). 82 memcpy(nonce, cc->iv, sizeof cc->iv); 83 memcpy(nonce + 4, data, 8); 97 br_ccm_reset(&zc, nonce, sizeof nonce, sizeof header, len, cc->tag_len); 154 unsigned char nonce[12], header[13]; local 161 * Make nonce; the explicit part is an encoding of the sequence 164 memcpy(nonce, cc->iv, sizeof cc->iv); 165 br_enc64be(nonce [all...] |
/freebsd-current/sys/opencrypto/ |
H A D | xform_chacha20_poly1305.c | 40 char nonce[CHACHA20_POLY1305_IV_LEN]; member in struct:chacha20_poly1305_ctx 67 KASSERT(ivlen == 8 || ivlen == sizeof(ctx->nonce), 68 ("%s: invalid nonce length", __func__)); 70 memcpy(ctx->nonce, iv, ivlen); 93 CHACHA20_NATIVE_BLOCK_LEN, ctx->nonce, ctx->ic, ctx->key); 96 CHACHA20_NATIVE_BLOCK_LEN, ctx->nonce, ctx->ic, ctx->key); 111 ctx->nonce, ctx->ic, ctx->key); 113 error = crypto_stream_chacha20_xor_ic(out, in, len, ctx->nonce, 129 ctx->nonce, ctx->ic, ctx->key); 131 error = crypto_stream_chacha20_xor_ic(out, in, len, ctx->nonce, 192 char nonce[CHACHA20_POLY1305_IV_LEN]; local [all...] |
H A D | cbc_mac.h | 51 const uint8_t *nonce; member in struct:aes_cbc_mac_ctx
|
/freebsd-current/contrib/wpa/src/crypto/ |
H A D | aes-ctr.c | 20 * @nonce: Nonce for counter mode (16 bytes) 25 int aes_ctr_encrypt(const u8 *key, size_t key_len, const u8 *nonce, argument 37 os_memcpy(counter, nonce, AES_BLOCK_SIZE); 62 * @nonce: Nonce for counter mode (16 bytes) 67 int aes_128_ctr_encrypt(const u8 *key, const u8 *nonce, argument 70 return aes_ctr_encrypt(key, 16, nonce, data, data_len);
|
/freebsd-current/contrib/libarchive/libarchive/ |
H A D | archive_cryptor.c | 171 memset(ctx->nonce, 0, sizeof(ctx->nonce)); 187 r = CCCryptorUpdate(ref, ctx->nonce, AES_BLOCK_SIZE, ctx->encr_buf, 196 memset(ctx->nonce, 0, sizeof(ctx->nonce)); 279 status = BCryptEncrypt(ctx->hKey, (PUCHAR)ctx->nonce, AES_BLOCK_SIZE, 309 memset(ctx->nonce, 0, sizeof(ctx->nonce)); 320 if (mbedtls_aes_crypt_ecb(&ctx->ctx, MBEDTLS_AES_ENCRYPT, ctx->nonce, 341 memset(ctx->nonce, 479 uint8_t *const nonce = ctx->nonce; local [all...] |
/freebsd-current/crypto/openssl/crypto/ts/ |
H A D | ts_req_print.c | 39 if (a->nonce == NULL) 42 TS_ASN1_INTEGER_print_bio(bio, a->nonce);
|
/freebsd-current/crypto/openssl/providers/implementations/ciphers/ |
H A D | cipher_aes_ccm.h | 36 } nonce; member in struct:prov_aes_ccm_ctx_st::__anon4116::__anon4118
|