Lines Matching refs:chacha
37 ctx->chacha.counter[1] = ctx->nonce[0]; 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()
52 ctx->nonce[0] = ctx->chacha.counter[1] = CHACHA_U8TOU32(fixed); in chacha_poly1305_tls_iv_set_fixed()
53 ctx->nonce[1] = ctx->chacha.counter[2] = CHACHA_U8TOU32(fixed + 4); in chacha_poly1305_tls_iv_set_fixed()
54 ctx->nonce[2] = ctx->chacha.counter[3] = CHACHA_U8TOU32(fixed + 8); in chacha_poly1305_tls_iv_set_fixed()
70 return ossl_chacha20_einit(&ctx->chacha, key, keylen, NULL, 0, NULL); in chacha20_poly1305_initkey()
72 return ossl_chacha20_dinit(&ctx->chacha, key, keylen, NULL, 0, NULL); in chacha20_poly1305_initkey()
93 ret = ossl_chacha20_einit(&ctx->chacha, NULL, 0, in chacha20_poly1305_initiv()
96 ret = ossl_chacha20_dinit(&ctx->chacha, NULL, 0, in chacha20_poly1305_initiv()
98 ctx->nonce[0] = ctx->chacha.counter[1]; in chacha20_poly1305_initiv()
99 ctx->nonce[1] = ctx->chacha.counter[2]; in chacha20_poly1305_initiv()
100 ctx->nonce[2] = ctx->chacha.counter[3]; in chacha20_poly1305_initiv()
135 ctx->chacha.counter[0] = 0; in chacha20_poly1305_tls_cipher()
137 ChaCha20_ctr32(buf, zero, buf_len, ctx->chacha.key.d, ctx->chacha.counter); in chacha20_poly1305_tls_cipher()
139 ctx->chacha.partial_len = 0; in chacha20_poly1305_tls_cipher()
160 ctx->chacha.counter[0] = 0; in chacha20_poly1305_tls_cipher()
162 ctx->chacha.key.d, ctx->chacha.counter); in chacha20_poly1305_tls_cipher()
164 ctx->chacha.partial_len = 0; in chacha20_poly1305_tls_cipher()
192 ctx->chacha.counter[0] = 0; in chacha20_poly1305_tls_cipher()
194 ctx->chacha.key.d, ctx->chacha.counter); in chacha20_poly1305_tls_cipher()
196 ctx->chacha.counter[0] = 1; in chacha20_poly1305_tls_cipher()
197 ctx->chacha.partial_len = 0; in chacha20_poly1305_tls_cipher()
205 ChaCha20_ctr32(out, in, plen, ctx->chacha.key.d, ctx->chacha.counter); in chacha20_poly1305_tls_cipher()
209 ChaCha20_ctr32(out, in, plen, ctx->chacha.key.d, ctx->chacha.counter); in chacha20_poly1305_tls_cipher()
288 ctx->chacha.counter[0] = 0; in chacha20_poly1305_aead_cipher()
289 ChaCha20_ctr32(ctx->chacha.buf, zero, CHACHA_BLK_SIZE, in chacha20_poly1305_aead_cipher()
290 ctx->chacha.key.d, ctx->chacha.counter); in chacha20_poly1305_aead_cipher()
291 Poly1305_Init(poly, ctx->chacha.buf); in chacha20_poly1305_aead_cipher()
292 ctx->chacha.counter[0] = 1; in chacha20_poly1305_aead_cipher()
293 ctx->chacha.partial_len = 0; in chacha20_poly1305_aead_cipher()
323 ctx->chacha.base.hw->cipher(&ctx->chacha.base, out, in, plen); in chacha20_poly1305_aead_cipher()
330 ctx->chacha.base.hw->cipher(&ctx->chacha.base, out, in, plen); in chacha20_poly1305_aead_cipher()