| /freebsd-14.2/crypto/openssl/providers/implementations/ciphers/ |
| H A D | cipher_chacha20_poly1305_hw.c | 25 len = aad[EVP_AEAD_TLS1_AAD_LEN - 2] << 8 | aad[EVP_AEAD_TLS1_AAD_LEN - 1]; in chacha_poly1305_tls_init() 26 aad = ctx->tls_aad; in chacha_poly1305_tls_init() 63 ctx->len.aad = 0; in chacha20_poly1305_initkey() 65 ctx->aad = 0; in chacha20_poly1305_initkey() 82 ctx->len.aad = 0; in chacha20_poly1305_initiv() 84 ctx->aad = 0; in chacha20_poly1305_initiv() 299 ctx->aad = 1; in chacha20_poly1305_aead_cipher() 306 ctx->len.aad += inl; in chacha20_poly1305_aead_cipher() 307 ctx->aad = 1; in chacha20_poly1305_aead_cipher() 313 ctx->aad = 0; in chacha20_poly1305_aead_cipher() [all …]
|
| H A D | ciphercommon_gcm_hw.c | 20 int ossl_gcm_aad_update(PROV_GCM_CTX *ctx, const unsigned char *aad, in ossl_gcm_aad_update() argument 23 return CRYPTO_gcm128_aad(&ctx->gcm, aad, aad_len) == 0; in ossl_gcm_aad_update() 51 int ossl_gcm_one_shot(PROV_GCM_CTX *ctx, unsigned char *aad, size_t aad_len, in ossl_gcm_one_shot() argument 58 if (!ctx->hw->aadupdate(ctx, aad, aad_len)) in ossl_gcm_one_shot()
|
| H A D | cipher_chacha20_poly1305.h | 25 struct { uint64_t aad, text; } len; member 26 unsigned int aad : 1; member 38 int (*tls_init)(PROV_CIPHER_CTX *ctx, unsigned char *aad, size_t alen);
|
| H A D | cipher_rc4_hmac_md5_hw.c | 166 unsigned char *aad, size_t aad_len) in cipher_hw_rc4_hmac_md5_tls_init() argument 174 len = aad[aad_len - 2] << 8 | aad[aad_len - 1]; in cipher_hw_rc4_hmac_md5_tls_init() 180 aad[aad_len - 2] = len >> 8; in cipher_hw_rc4_hmac_md5_tls_init() 181 aad[aad_len - 1] = len; in cipher_hw_rc4_hmac_md5_tls_init() 185 MD5_Update(&ctx->md, aad, aad_len); in cipher_hw_rc4_hmac_md5_tls_init()
|
| H A D | cipher_aes_gcm_hw_s390x.inc | 113 unsigned char *aad, size_t aad_len, 126 s390x_kma(aad, aad_len, in, in_len, out, fc, kma); 142 const unsigned char *aad, size_t len) 154 /* update the total aad length */ 160 /* check if there is any existing aad data from a previous add */ 165 actx->plat.s390x.ares[n] = *aad; 166 ++aad; 185 s390x_kma(aad, len, NULL, 0, NULL, fc, kma); 187 aad += len; 195 actx->plat.s390x.ares[rem] = aad[rem];
|
| /freebsd-14.2/crypto/openssl/crypto/evp/ |
| H A D | e_chacha20_poly1305.c | 158 struct { uint64_t aad, text; } len; member 176 actx->len.aad = 0; in chacha20_poly1305_init_key() 178 actx->aad = 0; in chacha20_poly1305_init_key() 387 actx->aad = 1; in chacha20_poly1305_cipher() 394 actx->len.aad += len; in chacha20_poly1305_cipher() 395 actx->aad = 1; in chacha20_poly1305_cipher() 402 actx->aad = 0; in chacha20_poly1305_cipher() 435 actx->aad = 0; in chacha20_poly1305_cipher() 510 actx->len.aad = 0; in chacha20_poly1305_ctrl() 512 actx->aad = 0; in chacha20_poly1305_ctrl() [all …]
|
| /freebsd-14.2/sys/net80211/ |
| H A D | ieee80211_crypto_ccmp.c | 399 aad[31] = 0; in ccmp_init_blocks() 400 b0[1] = aad[30]; in ccmp_init_blocks() 403 *(uint16_t *)&aad[30] = 0; in ccmp_init_blocks() 412 aad[25] = 0; in ccmp_init_blocks() 413 b0[1] = aad[24]; in ccmp_init_blocks() 414 aad[1] = 22 + 2; in ccmp_init_blocks() 416 *(uint16_t *)&aad[24] = 0; in ccmp_init_blocks() 418 aad[1] = 22; in ccmp_init_blocks() 420 *(uint16_t *)&aad[26] = 0; in ccmp_init_blocks() 421 *(uint32_t *)&aad[28] = 0; in ccmp_init_blocks() [all …]
|
| /freebsd-14.2/tests/sys/opencrypto/ |
| H A D | cryptodev.py | 255 def _doaead(self, op, src, aad, iv, tag=None): argument 266 aad = str_to_ascii(aad) 267 caead.aadlen = len(aad) 268 saad = array.array('B', aad) 269 caead.aad = saad.buffer_info()[0] 338 def encrypt(self, data, iv, aad=None): argument 339 if aad is None: 346 if aad is None: 660 enc, enctag = c.encrypt(pt, iv, aad=aad) 673 dec, dectag = c.decrypt(ct, iv, aad=aad, tag=enctag) [all …]
|
| H A D | cryptotest.py | 112 aad = binascii.unhexlify(data['AAD']) 134 rct, rtag = c.encrypt(pt, iv, aad) 148 args = (ct, iv, aad, tag) 251 aad = binascii.unhexlify(data['Adata']) 253 aad = None 266 nonce, aad) 291 aad = binascii.unhexlify(data['Adata']) 293 aad = None 313 c.decrypt, payload, nonce, aad, tag) 316 aad, tag)
|
| /freebsd-14.2/contrib/libfido2/src/ |
| H A D | aes256.c | 116 const fido_blob_t *aad, const fido_blob_t *in, fido_blob_t *out, in aes256_gcm() argument 126 if (nonce->len != 12 || key->len != 32 || aad->len > UINT_MAX) { in aes256_gcm() 128 nonce->len, key->len, aad->len); in aes256_gcm() 163 if (EVP_Cipher(ctx, NULL, aad->ptr, (u_int)aad->len) < 0 || in aes256_gcm() 206 const fido_blob_t *aad, const fido_blob_t *in, fido_blob_t *out) in aes256_gcm_enc() argument 208 return aes256_gcm(key, nonce, aad, in, out, 1); in aes256_gcm_enc() 213 const fido_blob_t *aad, const fido_blob_t *in, fido_blob_t *out) in aes256_gcm_dec() argument 215 return aes256_gcm(key, nonce, aad, in, out, 0); in aes256_gcm_dec()
|
| H A D | largeblob.c | 50 largeblob_aad(fido_blob_t *aad, uint64_t size) in largeblob_aad() argument 61 return fido_blob_set(aad, buf, sizeof(buf)); in largeblob_aad() 67 fido_blob_t *plaintext = NULL, *aad = NULL; in largeblob_decrypt() local 71 (aad = fido_blob_new()) == NULL) { in largeblob_decrypt() 75 if (largeblob_aad(aad, blob->origsiz) < 0) { in largeblob_decrypt() 87 fido_blob_free(&aad); in largeblob_decrypt() 121 fido_blob_t *plaintext = NULL, *aad = NULL; in largeblob_seal() local 125 (aad = fido_blob_new()) == NULL) { in largeblob_seal() 133 if (largeblob_aad(aad, body->len) < 0) { in largeblob_seal() 141 if (aes256_gcm_enc(key, &blob->nonce, aad, plaintext, in largeblob_seal() [all …]
|
| /freebsd-14.2/sys/crypto/ |
| H A D | chacha20_poly1305.h | 39 const size_t src_len, const uint8_t *aad, const size_t aad_len, 43 const size_t src_len, const uint8_t *aad, const size_t aad_len, 47 const size_t src_len, const uint8_t *aad, const size_t aad_len, 51 const size_t src_len, const uint8_t *aad, const size_t aad_len,
|
| H A D | chacha20_poly1305.c | 39 const size_t src_len, const uint8_t *aad, const size_t aad_len, in chacha20_poly1305_encrypt() argument 52 exf->update(ctx, aad, aad_len); in chacha20_poly1305_encrypt() 86 const size_t src_len, const uint8_t *aad, const size_t aad_len, in chacha20_poly1305_decrypt() argument 107 exf->update(ctx, aad, aad_len); in chacha20_poly1305_decrypt() 142 const size_t src_len, const uint8_t *aad, const size_t aad_len, in xchacha20_poly1305_encrypt() argument 155 exf->update(ctx, aad, aad_len); in xchacha20_poly1305_encrypt() 189 const size_t src_len, const uint8_t *aad, const size_t aad_len, in xchacha20_poly1305_decrypt() argument 210 exf->update(ctx, aad, aad_len); in xchacha20_poly1305_decrypt()
|
| /freebsd-14.2/crypto/openssl/util/ |
| H A D | cavs-to-evptest.pl | 19 my $aad = ""; 70 $aad = $2; 96 print " $aad"; 116 $aad = "";
|
| /freebsd-14.2/contrib/wpa/src/crypto/ |
| H A D | aes-gcm.c | 229 static void aes_gcm_ghash(const u8 *H, const u8 *aad, size_t aad_len, in aes_gcm_ghash() argument 241 ghash(H, aad, aad_len, S); in aes_gcm_ghash() 256 const u8 *aad, size_t aad_len, u8 *crypt, u8 *tag) in aes_gcm_ae() argument 272 aes_gcm_ghash(H, aad, aad_len, crypt, plain_len, S); in aes_gcm_ae() 290 const u8 *aad, size_t aad_len, const u8 *tag, u8 *plain) in aes_gcm_ad() argument 306 aes_gcm_ghash(H, aad, aad_len, crypt, crypt_len, S); in aes_gcm_ad() 323 const u8 *aad, size_t aad_len, u8 *tag) in aes_gmac() argument 325 return aes_gcm_ae(key, key_len, iv, iv_len, NULL, 0, aad, aad_len, NULL, in aes_gmac()
|
| H A D | aes_wrap.h | 55 const u8 *aad, size_t aad_len, 60 const u8 *aad, size_t aad_len, const u8 *tag, 64 const u8 *aad, size_t aad_len, u8 *tag); 67 const u8 *aad, size_t aad_len, u8 *crypt, u8 *auth); 70 const u8 *aad, size_t aad_len, const u8 *auth,
|
| H A D | aes-ccm.c | 29 const u8 *aad, size_t aad_len, size_t plain_len, in aes_ccm_auth_start() argument 50 os_memcpy(aad_buf + 2, aad, aad_len); in aes_ccm_auth_start() 150 const u8 *aad, size_t aad_len, u8 *crypt, u8 *auth) in aes_ccm_ae() argument 163 aes_ccm_auth_start(aes, M, L, nonce, aad, aad_len, plain_len, x); in aes_ccm_ae() 180 const u8 *aad, size_t aad_len, const u8 *auth, u8 *plain) in aes_ccm_ad() argument 201 aes_ccm_auth_start(aes, M, L, nonce, aad, aad_len, crypt_len, x); in aes_ccm_ad()
|
| H A D | crypto_module_tests.c | 2207 const char *aad; member 2222 .aad = "436f756e742d30", 2237 .aad = "436f756e742d30", 2252 .aad = "436f756e742d30", 2267 .aad = "436f756e742d30", 2282 .aad = "436f756e742d30", 2333 aad = wpabuf_parse_bin(test->aad); in run_hpke_test() 2359 wpabuf_head(aad), wpabuf_len(aad), in run_hpke_test() 2408 wpabuf_head(aad), wpabuf_len(aad), in run_hpke_test() 2421 wpabuf_head(aad), wpabuf_len(aad), in run_hpke_test() [all …]
|
| /freebsd-14.2/crypto/openssl/providers/implementations/include/prov/ |
| H A D | ciphercommon_gcm.h | 86 const unsigned char *aad, size_t aadlen)); 91 PROV_CIPHER_FUNC(int, GCM_oneshot, (PROV_GCM_CTX *ctx, unsigned char *aad, 115 int ossl_gcm_aad_update(PROV_GCM_CTX *ctx, const unsigned char *aad, 118 int ossl_gcm_one_shot(PROV_GCM_CTX *ctx, unsigned char *aad, size_t aad_len,
|
| /freebsd-14.2/tests/sys/kern/ |
| H A D | ktls_test.c | 444 if (aad != NULL) { in aead_encrypt() 507 if (aad != NULL) { in aead_decrypt() 847 debug_hexdump(tc, &aad, sizeof(aad), "aad"); in decrypt_tls_aes_cbc_mte() 849 &aad, sizeof(aad), buf, payload_len, buf + payload_len)); in decrypt_tls_aes_cbc_mte() 878 debug_hexdump(tc, &aad, sizeof(aad), "aad"); in decrypt_tls_12_aead() 918 debug_hexdump(tc, &aad, sizeof(aad), "aad"); in decrypt_tls_13_aead() 1029 debug_hexdump(tc, &aad, sizeof(aad), "aad"); in encrypt_tls_aes_cbc_mte() 1032 &aad, sizeof(aad), src, len, buf + hdr_len + len, &digest_len)); in encrypt_tls_aes_cbc_mte() 1073 debug_hexdump(tc, &aad, sizeof(aad), "aad"); in encrypt_tls_12_aead() 1082 &aad, sizeof(aad), src, (char *)dst + hdr_len, len, in encrypt_tls_12_aead() [all …]
|
| /freebsd-14.2/sys/crypto/openssl/amd64/ |
| H A D | ossl_aes_gcm.c | 93 gcm_aad_avx512(struct ossl_gcm_context *ctx, const unsigned char *aad, in gcm_aad_avx512() argument 118 ctx->gcm.Xi.c[15 - ares] ^= *(aad++); in gcm_aad_avx512() 134 ossl_aes_gcm_update_aad_avx512(ctx, aad, lenblks); in gcm_aad_avx512() 135 aad += lenblks; in gcm_aad_avx512() 143 ctx->gcm.Xi.c[15 - i] ^= aad[i]; in gcm_aad_avx512() 216 .aad = gcm_aad_avx512, 301 ctx->gcm.Xi.c[n] ^= *(aad++); in gcm_aad_aesni() 313 gcm_ghash_avx(ctx->gcm.Xi.u, ctx->gcm.Htable, aad, i); in gcm_aad_aesni() 314 aad += i; in gcm_aad_aesni() 320 ctx->gcm.Xi.c[i] ^= aad[i]; in gcm_aad_aesni() [all …]
|
| /freebsd-14.2/tools/tools/crypto/ |
| H A D | cryptocheck.c | 899 caead.aad = aad; in ocf_eta() 1275 if (aad != NULL) { in openssl_aead_encrypt() 1320 if (aad != NULL) { in openssl_aead_decrypt() 1384 if (aad != NULL) { in openssl_ccm_encrypt() 1442 caead.aad = aad; in ocf_aead() 1488 char *aad, *buffer, *cleartext, *ciphertext; in run_aead_test() local 1523 aad = alloc_buffer(aad_len); in run_aead_test() 1525 aad = NULL; in run_aead_test() 1529 openssl_ccm_encrypt(alg, cipher, key, iv, iv_len, aad, in run_aead_test() 1532 openssl_aead_encrypt(alg, cipher, key, iv, iv_len, aad, in run_aead_test() [all …]
|
| /freebsd-14.2/sys/crypto/openssl/ |
| H A D | ossl_aes_gcm.h | 39 int (*aad)(struct ossl_gcm_context *ctx, const unsigned char *aad, member
|
| /freebsd-14.2/contrib/libfido2/tools/ |
| H A D | largeblob.c | 362 uint8_t aad[4 + sizeof(uint64_t)]; in decode() local 392 aad[0] = 0x62; /* b */ in decode() 393 aad[1] = 0x6c; /* l */ in decode() 394 aad[2] = 0x6f; /* o */ in decode() 395 aad[3] = 0x62; /* b */ in decode() 397 memcpy(&aad[4], &tmp, sizeof(uint64_t)); in decode() 398 if (EVP_Cipher(ctx, NULL, aad, (u_int)sizeof(aad)) < 0 || in decode()
|
| /freebsd-14.2/sys/crypto/openssl/arm/ |
| H A D | ossl_aes_gcm.c | 113 gcm_aad(struct ossl_gcm_context *ctx, const unsigned char *aad, size_t len) in gcm_aad() argument 130 ctx->gcm.Xi.c[n] ^= *(aad++); in gcm_aad() 142 gcm_ghash_neon(ctx->gcm.Xi.u, ctx->gcm.Htable, aad, i); in gcm_aad() 143 aad += i; in gcm_aad() 149 ctx->gcm.Xi.c[i] ^= aad[i]; in gcm_aad() 341 .aad = gcm_aad,
|