Lines Matching defs:c20_ctx

53 	struct aead_chacha20_poly1305_ctx *c20_ctx;
64 if (key_len != sizeof(c20_ctx->key))
67 c20_ctx = malloc(sizeof(struct aead_chacha20_poly1305_ctx));
68 if (c20_ctx == NULL)
71 memcpy(&c20_ctx->key[0], key, key_len);
72 c20_ctx->tag_len = tag_len;
73 ctx->aead_state = c20_ctx;
81 struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state;
83 freezero(c20_ctx, sizeof(*c20_ctx));
131 const struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state;
137 if (max_out_len < in_len + c20_ctx->tag_len) {
153 sizeof(poly1305_key), c20_ctx->key, iv, ctr);
157 CRYPTO_chacha_20(out, in, in_len, c20_ctx->key, iv, ctr + 1);
162 if (c20_ctx->tag_len != POLY1305_TAG_LEN) {
165 memcpy(out + in_len, tag, c20_ctx->tag_len);
166 *out_len = in_len + c20_ctx->tag_len;
181 const struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state;
189 if (in_len < c20_ctx->tag_len) {
199 plaintext_len = in_len - c20_ctx->tag_len;
212 sizeof(poly1305_key), c20_ctx->key, iv, ctr);
222 if (timingsafe_memcmp(mac, in + plaintext_len, c20_ctx->tag_len) != 0) {
227 CRYPTO_chacha_20(out, in, plaintext_len, c20_ctx->key, iv, ctr + 1);
238 const struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state;
243 if (max_out_len < in_len + c20_ctx->tag_len) {
253 CRYPTO_hchacha_20(subkey, c20_ctx->key, nonce);
267 if (c20_ctx->tag_len != POLY1305_TAG_LEN) {
270 memcpy(out + in_len, tag, c20_ctx->tag_len);
271 *out_len = in_len + c20_ctx->tag_len;
286 const struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state;
293 if (in_len < c20_ctx->tag_len) {
303 plaintext_len = in_len - c20_ctx->tag_len;
310 CRYPTO_hchacha_20(subkey, c20_ctx->key, nonce);
323 if (timingsafe_memcmp(mac, in + plaintext_len, c20_ctx->tag_len) != 0) {