Home
last modified time | relevance | path

Searched refs:aad_len (Results 1 – 25 of 33) sorted by relevance

12

/third_party/mbedtls/library/
Dchachapoly.c60 uint32_t partial_block_len = (uint32_t) ( ctx->aad_len % 16U ); in chachapoly_pad_aad()
98 ctx->aad_len = 0U; in mbedtls_chachapoly_init()
111 ctx->aad_len = 0U; in mbedtls_chachapoly_free()
158 ctx->aad_len = 0U; in mbedtls_chachapoly_starts()
171 size_t aad_len ) in mbedtls_chachapoly_update_aad() argument
174 CHACHAPOLY_VALIDATE_RET( aad_len == 0 || aad != NULL ); in mbedtls_chachapoly_update_aad()
179 ctx->aad_len += aad_len; in mbedtls_chachapoly_update_aad()
181 return( mbedtls_poly1305_update( &ctx->poly1305_ctx, aad, aad_len ) ); in mbedtls_chachapoly_update_aad()
266 MBEDTLS_PUT_UINT64_LE(ctx->aad_len, len_block, 0); in mbedtls_chachapoly_finish()
283 size_t aad_len, in chachapoly_crypt_and_tag() argument
[all …]
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/crypto/
Daes-ccm.c29 const u8 *aad, size_t aad_len, size_t plain_len, in aes_ccm_auth_start() argument
37 b[0] = aad_len ? 0x40 : 0 /* Adata */; in aes_ccm_auth_start()
46 if (!aad_len) in aes_ccm_auth_start()
49 WPA_PUT_BE16(aad_buf, aad_len); in aes_ccm_auth_start()
50 os_memcpy(aad_buf + 2, aad, aad_len); in aes_ccm_auth_start()
51 os_memset(aad_buf + 2 + aad_len, 0, sizeof(aad_buf) - 2 - aad_len); in aes_ccm_auth_start()
56 if (aad_len > AES_BLOCK_SIZE - 2) { in aes_ccm_auth_start()
150 const u8 *aad, size_t aad_len, u8 *crypt, u8 *auth) in aes_ccm_ae() argument
156 if (aad_len > 30 || M > AES_BLOCK_SIZE) in aes_ccm_ae()
163 aes_ccm_auth_start(aes, M, L, nonce, aad, aad_len, plain_len, x); in aes_ccm_ae()
[all …]
Daes-gcm.c229 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()
243 WPA_PUT_BE64(len_buf, aad_len * 8); 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()
Daes_wrap.h55 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,
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/crypto/
Daes-ccm.c29 const u8 *aad, size_t aad_len, size_t plain_len, in aes_ccm_auth_start() argument
37 b[0] = aad_len ? 0x40 : 0 /* Adata */; in aes_ccm_auth_start()
46 if (!aad_len) in aes_ccm_auth_start()
49 WPA_PUT_BE16(aad_buf, aad_len); in aes_ccm_auth_start()
50 os_memcpy(aad_buf + 2, aad, aad_len); in aes_ccm_auth_start()
51 os_memset(aad_buf + 2 + aad_len, 0, sizeof(aad_buf) - 2 - aad_len); in aes_ccm_auth_start()
56 if (aad_len > AES_BLOCK_SIZE - 2) { in aes_ccm_auth_start()
150 const u8 *aad, size_t aad_len, u8 *crypt, u8 *auth) in aes_ccm_ae() argument
156 if (aad_len > 30 || M > AES_BLOCK_SIZE) in aes_ccm_ae()
163 aes_ccm_auth_start(aes, M, L, nonce, aad, aad_len, plain_len, x); in aes_ccm_ae()
[all …]
Daes-gcm.c229 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()
243 WPA_PUT_BE64(len_buf, aad_len * 8); 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()
Daes_wrap.h55 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,
/third_party/libwebsockets/lib/jose/jwe/
Dprivate-lib-jose-jwe.h40 uint8_t *aad, int aad_len);
47 uint8_t *aad, int aad_len);
54 uint8_t *enc_cek, uint8_t *aad, int aad_len);
76 uint8_t *aad, int aad_len);
80 uint8_t *cek, uint8_t *aad, int aad_len);
/third_party/mbedtls/tests/suites/
Dtest_suite_chachapoly.function79 size_t aad_len = sizeof( aad );
96 TEST_ASSERT( mbedtls_chachapoly_update_aad( &ctx, aad, aad_len )
107 TEST_ASSERT( mbedtls_chachapoly_update_aad( &ctx, aad, aad_len )
119 TEST_ASSERT( mbedtls_chachapoly_update_aad( &ctx, aad, aad_len )
131 TEST_ASSERT( mbedtls_chachapoly_update_aad( &ctx, aad, aad_len )
137 TEST_ASSERT( mbedtls_chachapoly_update_aad( &ctx, aad, aad_len )
139 TEST_ASSERT( mbedtls_chachapoly_update_aad( &ctx, aad, aad_len )
/third_party/mbedtls/include/mbedtls/
Dchachapoly.h65 …uint64_t MBEDTLS_PRIVATE(aad_len); /**< The length (bytes) of the Additional…
213 size_t aad_len );
303 size_t aad_len,
337 size_t aad_len,
/third_party/openssl/providers/implementations/ciphers/
Dcipher_rc4_hmac_md5_hw.c166 unsigned char *aad, size_t aad_len) in cipher_hw_rc4_hmac_md5_tls_init() argument
171 if (aad_len != EVP_AEAD_TLS1_AAD_LEN) in cipher_hw_rc4_hmac_md5_tls_init()
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()
Dciphercommon_gcm_hw.c21 size_t aad_len) 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()
Dciphercommon_gcm.c19 static int gcm_tls_init(PROV_GCM_CTX *dat, unsigned char *aad, size_t aad_len);
446 static int gcm_tls_init(PROV_GCM_CTX *dat, unsigned char *aad, size_t aad_len) in gcm_tls_init() argument
451 if (!ossl_prov_is_running() || aad_len != EVP_AEAD_TLS1_AAD_LEN) in gcm_tls_init()
456 memcpy(buf, aad, aad_len); in gcm_tls_init()
457 dat->tls_aad_len = aad_len; in gcm_tls_init()
459 len = buf[aad_len - 2] << 8 | buf[aad_len - 1]; in gcm_tls_init()
471 buf[aad_len - 2] = (unsigned char)(len >> 8); in gcm_tls_init()
472 buf[aad_len - 1] = (unsigned char)(len & 0xff); in gcm_tls_init()
Dcipher_aes_cbc_hmac_sha1_hw.c664 unsigned char *aad_rec, int aad_len) in aesni_cbc_hmac_sha1_set_tls1_aad() argument
671 if (aad_len != EVP_AEAD_TLS1_AAD_LEN) in aesni_cbc_hmac_sha1_set_tls1_aad()
674 len = p[aad_len - 2] << 8 | p[aad_len - 1]; in aesni_cbc_hmac_sha1_set_tls1_aad()
679 p[aad_len - 4] << 8 | p[aad_len - 3]) >= TLS1_1_VERSION) { in aesni_cbc_hmac_sha1_set_tls1_aad()
683 p[aad_len - 2] = len >> 8; in aesni_cbc_hmac_sha1_set_tls1_aad()
684 p[aad_len - 1] = len; in aesni_cbc_hmac_sha1_set_tls1_aad()
687 sha1_update(&sctx->md, p, aad_len); in aesni_cbc_hmac_sha1_set_tls1_aad()
693 memcpy(ctx->aux.tls_aad, aad_rec, aad_len); in aesni_cbc_hmac_sha1_set_tls1_aad()
694 ctx->payload_length = aad_len; in aesni_cbc_hmac_sha1_set_tls1_aad()
Dcipher_aes_cbc_hmac_sha256_hw.c717 unsigned char *aad_rec, int aad_len) in aesni_cbc_hmac_sha256_set_tls1_aad() argument
724 if (aad_len != EVP_AEAD_TLS1_AAD_LEN) in aesni_cbc_hmac_sha256_set_tls1_aad()
727 len = p[aad_len - 2] << 8 | p[aad_len - 1]; in aesni_cbc_hmac_sha256_set_tls1_aad()
732 p[aad_len - 4] << 8 | p[aad_len - 3]) >= TLS1_1_VERSION) { in aesni_cbc_hmac_sha256_set_tls1_aad()
736 p[aad_len - 2] = len >> 8; in aesni_cbc_hmac_sha256_set_tls1_aad()
737 p[aad_len - 1] = len; in aesni_cbc_hmac_sha256_set_tls1_aad()
740 sha256_update(&sctx->md, p, aad_len); in aesni_cbc_hmac_sha256_set_tls1_aad()
746 memcpy(ctx->aux.tls_aad, p, aad_len); in aesni_cbc_hmac_sha256_set_tls1_aad()
747 ctx->payload_length = aad_len; in aesni_cbc_hmac_sha256_set_tls1_aad()
Dcipher_rc4_hmac_md5.h27 int (*tls_init)(PROV_CIPHER_CTX *ctx, unsigned char *aad, size_t aad_len);
Dcipher_aes_cbc_hmac_sha.h19 int (*set_tls1_aad)(void *ctx, unsigned char *aad_rec, int aad_len);
/third_party/libwebsockets/lib/jose/jwe/enc/
Daescbc.c30 uint8_t *aad, int aad_len) in lws_jwe_encrypt_cbc_hs() argument
116 lws_jwe_be64((unsigned int)aad_len * 8, al); in lws_jwe_encrypt_cbc_hs()
137 if (lws_genhmac_update(&hmacctx, aad, (unsigned int)aad_len) || in lws_jwe_encrypt_cbc_hs()
163 uint8_t *aad, int aad_len) in lws_jwe_auth_and_decrypt_cbc_hs() argument
200 lws_jwe_be64((unsigned int)aad_len * 8, al); in lws_jwe_auth_and_decrypt_cbc_hs()
209 if (lws_genhmac_update(&hmacctx, aad, (unsigned int)aad_len) || in lws_jwe_auth_and_decrypt_cbc_hs()
Daesgcm.c54 uint8_t *enc_cek, uint8_t *aad, int aad_len) in lws_jwe_encrypt_gcm() argument
89 n = lws_genaes_crypt(&aesctx, aad, (unsigned int)aad_len, NULL, in lws_jwe_encrypt_gcm()
118 uint8_t *enc_cek, uint8_t *aad, int aad_len) in lws_jwe_auth_and_decrypt_gcm() argument
152 n = lws_genaes_crypt(&aesctx, aad, (unsigned int)aad_len, in lws_jwe_auth_and_decrypt_gcm()
/third_party/openssl/providers/implementations/include/prov/
Dciphercommon_gcm.h92 size_t aad_len, const unsigned char *in,
116 size_t aad_len);
118 int ossl_gcm_one_shot(PROV_GCM_CTX *ctx, unsigned char *aad, size_t aad_len,
/third_party/openssl/test/
Dacvp_test.c720 const unsigned char *aad, size_t aad_len, in aes_ccm_enc_dec() argument
744 || !TEST_true(EVP_CipherUpdate(ctx, NULL, &len, aad, aad_len)) in aes_ccm_enc_dec()
789 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_ccm_enc_dec_test()
793 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_ccm_enc_dec_test()
798 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_ccm_enc_dec_test()
807 const unsigned char *aad, size_t aad_len, in aes_gcm_enc_dec() argument
840 || !TEST_true(EVP_CipherUpdate(ctx, NULL, &len, aad, aad_len)) in aes_gcm_enc_dec()
877 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_gcm_enc_dec_test()
882 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_gcm_enc_dec_test()
888 tst->iv, tst->iv_len, tst->aad, tst->aad_len, in aes_gcm_enc_dec_test()
/third_party/wpa_supplicant/wpa_supplicant-2.9/wpa_supplicant/
Dmesh_rsn.c541 const size_t aad_len[] = { ETH_ALEN, ETH_ALEN, ie - cat }; in mesh_rsn_protect_frame() local
621 aad, aad_len, mic_payload)) { in mesh_rsn_protect_frame()
645 const size_t aad_len[] = { ETH_ALEN, ETH_ALEN, in mesh_rsn_process_ampe() local
694 aad, aad_len, ampe_buf)) { in mesh_rsn_process_ampe()
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/wpa_supplicant/
Dmesh_rsn.c540 const size_t aad_len[] = { ETH_ALEN, ETH_ALEN, ie - cat }; in mesh_rsn_protect_frame() local
616 aad, aad_len, mic_payload)) { in mesh_rsn_protect_frame()
640 const size_t aad_len[] = { ETH_ALEN, ETH_ALEN, in mesh_rsn_process_ampe() local
689 aad, aad_len, ampe_buf)) { in mesh_rsn_process_ampe()
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/ap/
Dwpa_auth.c1544 size_t aad_len[1]; in __wpa_send_eapol() local
1555 aad_len[0] = key_mic + 2 - (u8 *) hdr; in __wpa_send_eapol()
1557 1, aad, aad_len, key_mic + 2) < 0) { in __wpa_send_eapol()
2342 size_t aad_len[1]; in wpa_aead_decrypt() local
2363 aad_len[0] = pos - buf; in wpa_aead_decrypt()
2365 1, aad, aad_len, tmp) < 0) { in wpa_aead_decrypt()
2492 size_t aad_len[5]; in fils_decrypt_assoc() local
2538 aad_len[0] = ETH_ALEN; in fils_decrypt_assoc()
2541 aad_len[1] = ETH_ALEN; in fils_decrypt_assoc()
2544 aad_len[2] = FILS_NONCE_LEN; in fils_decrypt_assoc()
[all …]
/third_party/libwebsockets/include/libwebsockets/
Dlws-jwe.h159 uint8_t *aad, int aad_len);

12