Lines Matching refs:ctr
217 unsigned char *buf, *tohash, *ctr, storage[sizeof(zero) + 32]; in chacha20_poly1305_tls_cipher() local
223 ctr = buf + CHACHA_BLK_SIZE; in chacha20_poly1305_tls_cipher()
241 ctr = xor128_encrypt_n_pad(out, in, ctr, plen); in chacha20_poly1305_tls_cipher()
243 ctr = xor128_decrypt_n_pad(out, in, ctr, plen); in chacha20_poly1305_tls_cipher()
247 tohash_len = (size_t)(ctr - tohash); in chacha20_poly1305_tls_cipher()
266 out[i] = ctr[i] ^= in[i]; in chacha20_poly1305_tls_cipher()
271 out[i] = ctr[i] ^ c; in chacha20_poly1305_tls_cipher()
272 ctr[i] = c; in chacha20_poly1305_tls_cipher()
280 memset(ctr + i, 0, tail); in chacha20_poly1305_tls_cipher()
281 ctr += i + tail; in chacha20_poly1305_tls_cipher()
293 tohash = ctr; in chacha20_poly1305_tls_cipher()
319 memcpy(ctr, (unsigned char *)&actx->len, POLY1305_BLOCK_SIZE); in chacha20_poly1305_tls_cipher()
321 ctr[0] = (unsigned char)(actx->len.aad); in chacha20_poly1305_tls_cipher()
322 ctr[1] = (unsigned char)(actx->len.aad>>8); in chacha20_poly1305_tls_cipher()
323 ctr[2] = (unsigned char)(actx->len.aad>>16); in chacha20_poly1305_tls_cipher()
324 ctr[3] = (unsigned char)(actx->len.aad>>24); in chacha20_poly1305_tls_cipher()
325 ctr[4] = (unsigned char)(actx->len.aad>>32); in chacha20_poly1305_tls_cipher()
326 ctr[5] = (unsigned char)(actx->len.aad>>40); in chacha20_poly1305_tls_cipher()
327 ctr[6] = (unsigned char)(actx->len.aad>>48); in chacha20_poly1305_tls_cipher()
328 ctr[7] = (unsigned char)(actx->len.aad>>56); in chacha20_poly1305_tls_cipher()
330 ctr[8] = (unsigned char)(actx->len.text); in chacha20_poly1305_tls_cipher()
331 ctr[9] = (unsigned char)(actx->len.text>>8); in chacha20_poly1305_tls_cipher()
332 ctr[10] = (unsigned char)(actx->len.text>>16); in chacha20_poly1305_tls_cipher()
333 ctr[11] = (unsigned char)(actx->len.text>>24); in chacha20_poly1305_tls_cipher()
334 ctr[12] = (unsigned char)(actx->len.text>>32); in chacha20_poly1305_tls_cipher()
335 ctr[13] = (unsigned char)(actx->len.text>>40); in chacha20_poly1305_tls_cipher()
336 ctr[14] = (unsigned char)(actx->len.text>>48); in chacha20_poly1305_tls_cipher()
337 ctr[15] = (unsigned char)(actx->len.text>>56); in chacha20_poly1305_tls_cipher()