Lines Matching refs:aad

16                                     unsigned char *aad, size_t alen)  in chacha_poly1305_tls_init()  argument
24 memcpy(ctx->tls_aad, aad, EVP_AEAD_TLS1_AAD_LEN); in chacha_poly1305_tls_init()
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()
31 aad[EVP_AEAD_TLS1_AAD_LEN - 2] = (unsigned char)(len >> 8); in chacha_poly1305_tls_init()
32 aad[EVP_AEAD_TLS1_AAD_LEN - 1] = (unsigned char)len; in chacha_poly1305_tls_init()
38 ctx->chacha.counter[2] = ctx->nonce[1] ^ CHACHA_U8TOU32(aad); in chacha_poly1305_tls_init()
39 ctx->chacha.counter[3] = ctx->nonce[2] ^ CHACHA_U8TOU32(aad+4); 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()
142 ctx->len.aad = EVP_AEAD_TLS1_AAD_LEN; in chacha20_poly1305_tls_cipher()
167 ctx->len.aad = EVP_AEAD_TLS1_AAD_LEN; in chacha20_poly1305_tls_cipher()
201 ctx->len.aad = EVP_AEAD_TLS1_AAD_LEN; in chacha20_poly1305_tls_cipher()
221 ctr[0] = (unsigned char)(ctx->len.aad); in chacha20_poly1305_tls_cipher()
222 ctr[1] = (unsigned char)(ctx->len.aad>>8); in chacha20_poly1305_tls_cipher()
223 ctr[2] = (unsigned char)(ctx->len.aad>>16); in chacha20_poly1305_tls_cipher()
224 ctr[3] = (unsigned char)(ctx->len.aad>>24); in chacha20_poly1305_tls_cipher()
225 ctr[4] = (unsigned char)(ctx->len.aad>>32); in chacha20_poly1305_tls_cipher()
226 ctr[5] = (unsigned char)(ctx->len.aad>>40); in chacha20_poly1305_tls_cipher()
227 ctr[6] = (unsigned char)(ctx->len.aad>>48); in chacha20_poly1305_tls_cipher()
228 ctr[7] = (unsigned char)(ctx->len.aad>>56); in chacha20_poly1305_tls_cipher()
294 ctx->len.aad = ctx->len.text = 0; in chacha20_poly1305_aead_cipher()
298 ctx->len.aad = EVP_AEAD_TLS1_AAD_LEN; in chacha20_poly1305_aead_cipher()
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()
310 if (ctx->aad) { /* wrap up aad */ in chacha20_poly1305_aead_cipher()
311 if ((rem = (size_t)ctx->len.aad % POLY1305_BLOCK_SIZE)) in chacha20_poly1305_aead_cipher()
313 ctx->aad = 0; in chacha20_poly1305_aead_cipher()
342 if (ctx->aad) { /* wrap up aad */ in chacha20_poly1305_aead_cipher()
343 if ((rem = (size_t)ctx->len.aad % POLY1305_BLOCK_SIZE)) in chacha20_poly1305_aead_cipher()
345 ctx->aad = 0; in chacha20_poly1305_aead_cipher()
355 temp[0] = (unsigned char)(ctx->len.aad); in chacha20_poly1305_aead_cipher()
356 temp[1] = (unsigned char)(ctx->len.aad>>8); in chacha20_poly1305_aead_cipher()
357 temp[2] = (unsigned char)(ctx->len.aad>>16); in chacha20_poly1305_aead_cipher()
358 temp[3] = (unsigned char)(ctx->len.aad>>24); in chacha20_poly1305_aead_cipher()
359 temp[4] = (unsigned char)(ctx->len.aad>>32); in chacha20_poly1305_aead_cipher()
360 temp[5] = (unsigned char)(ctx->len.aad>>40); in chacha20_poly1305_aead_cipher()
361 temp[6] = (unsigned char)(ctx->len.aad>>48); in chacha20_poly1305_aead_cipher()
362 temp[7] = (unsigned char)(ctx->len.aad>>56); in chacha20_poly1305_aead_cipher()