Lines Matching refs:ctr
219 unsigned char *buf, *tohash, *ctr, storage[sizeof(zero) + 32]; in chacha20_poly1305_tls_cipher() local
225 ctr = buf + CHACHA_BLK_SIZE; in chacha20_poly1305_tls_cipher()
243 ctr = xor128_encrypt_n_pad(out, in, ctr, plen); in chacha20_poly1305_tls_cipher()
245 ctr = xor128_decrypt_n_pad(out, in, ctr, plen); in chacha20_poly1305_tls_cipher()
249 tohash_len = (size_t)(ctr - tohash); in chacha20_poly1305_tls_cipher()
268 out[i] = ctr[i] ^= in[i]; in chacha20_poly1305_tls_cipher()
273 out[i] = ctr[i] ^ c; in chacha20_poly1305_tls_cipher()
274 ctr[i] = c; in chacha20_poly1305_tls_cipher()
282 memset(ctr + i, 0, tail); in chacha20_poly1305_tls_cipher()
283 ctr += i + tail; in chacha20_poly1305_tls_cipher()
295 tohash = ctr; in chacha20_poly1305_tls_cipher()
318 memcpy(ctr, (unsigned char *)&actx->len, POLY1305_BLOCK_SIZE); 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()
329 ctr[8] = (unsigned char)(actx->len.text); in chacha20_poly1305_tls_cipher()
330 ctr[9] = (unsigned char)(actx->len.text>>8); in chacha20_poly1305_tls_cipher()
331 ctr[10] = (unsigned char)(actx->len.text>>16); in chacha20_poly1305_tls_cipher()
332 ctr[11] = (unsigned char)(actx->len.text>>24); in chacha20_poly1305_tls_cipher()
333 ctr[12] = (unsigned char)(actx->len.text>>32); in chacha20_poly1305_tls_cipher()
334 ctr[13] = (unsigned char)(actx->len.text>>40); in chacha20_poly1305_tls_cipher()
335 ctr[14] = (unsigned char)(actx->len.text>>48); in chacha20_poly1305_tls_cipher()
336 ctr[15] = (unsigned char)(actx->len.text>>56); in chacha20_poly1305_tls_cipher()