Lines Matching refs:aad

158     struct { uint64_t aad, text; } len;  member
159 int aad, mac_inited, tag_len, nonce_len; member
176 actx->len.aad = 0; in chacha20_poly1305_init_key()
178 actx->aad = 0; in chacha20_poly1305_init_key()
238 actx->len.aad = EVP_AEAD_TLS1_AAD_LEN; in chacha20_poly1305_tls_cipher()
263 actx->len.aad = EVP_AEAD_TLS1_AAD_LEN; in chacha20_poly1305_tls_cipher()
297 actx->len.aad = EVP_AEAD_TLS1_AAD_LEN; in chacha20_poly1305_tls_cipher()
320 ctr[0] = (unsigned char)(actx->len.aad); in chacha20_poly1305_tls_cipher()
321 ctr[1] = (unsigned char)(actx->len.aad>>8); in chacha20_poly1305_tls_cipher()
322 ctr[2] = (unsigned char)(actx->len.aad>>16); in chacha20_poly1305_tls_cipher()
323 ctr[3] = (unsigned char)(actx->len.aad>>24); in chacha20_poly1305_tls_cipher()
324 ctr[4] = (unsigned char)(actx->len.aad>>32); in chacha20_poly1305_tls_cipher()
325 ctr[5] = (unsigned char)(actx->len.aad>>40); in chacha20_poly1305_tls_cipher()
326 ctr[6] = (unsigned char)(actx->len.aad>>48); in chacha20_poly1305_tls_cipher()
327 ctr[7] = (unsigned char)(actx->len.aad>>56); in chacha20_poly1305_tls_cipher()
381 actx->len.aad = actx->len.text = 0; in chacha20_poly1305_cipher()
386 actx->len.aad = EVP_AEAD_TLS1_AAD_LEN; in chacha20_poly1305_cipher()
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()
398 if (actx->aad) { /* wrap up aad */ in chacha20_poly1305_cipher()
399 if ((rem = (size_t)actx->len.aad % POLY1305_BLOCK_SIZE)) in chacha20_poly1305_cipher()
402 actx->aad = 0; in chacha20_poly1305_cipher()
431 if (actx->aad) { /* wrap up aad */ in chacha20_poly1305_cipher()
432 if ((rem = (size_t)actx->len.aad % POLY1305_BLOCK_SIZE)) in chacha20_poly1305_cipher()
435 actx->aad = 0; in chacha20_poly1305_cipher()
446 temp[0] = (unsigned char)(actx->len.aad); in chacha20_poly1305_cipher()
447 temp[1] = (unsigned char)(actx->len.aad>>8); in chacha20_poly1305_cipher()
448 temp[2] = (unsigned char)(actx->len.aad>>16); in chacha20_poly1305_cipher()
449 temp[3] = (unsigned char)(actx->len.aad>>24); in chacha20_poly1305_cipher()
450 temp[4] = (unsigned char)(actx->len.aad>>32); in chacha20_poly1305_cipher()
451 temp[5] = (unsigned char)(actx->len.aad>>40); in chacha20_poly1305_cipher()
452 temp[6] = (unsigned char)(actx->len.aad>>48); in chacha20_poly1305_cipher()
453 temp[7] = (unsigned char)(actx->len.aad>>56); in chacha20_poly1305_cipher()
510 actx->len.aad = 0; in chacha20_poly1305_ctrl()
512 actx->aad = 0; in chacha20_poly1305_ctrl()
575 unsigned char *aad = ptr; in chacha20_poly1305_ctrl() local
578 len = aad[EVP_AEAD_TLS1_AAD_LEN - 2] << 8 | in chacha20_poly1305_ctrl()
579 aad[EVP_AEAD_TLS1_AAD_LEN - 1]; in chacha20_poly1305_ctrl()
580 aad = actx->tls_aad; in chacha20_poly1305_ctrl()
585 aad[EVP_AEAD_TLS1_AAD_LEN - 2] = (unsigned char)(len >> 8); in chacha20_poly1305_ctrl()
586 aad[EVP_AEAD_TLS1_AAD_LEN - 1] = (unsigned char)len; in chacha20_poly1305_ctrl()
594 actx->key.counter[2] = actx->nonce[1] ^ CHACHA_U8TOU32(aad); in chacha20_poly1305_ctrl()
595 actx->key.counter[3] = actx->nonce[2] ^ CHACHA_U8TOU32(aad+4); in chacha20_poly1305_ctrl()