Lines Matching defs:ctx
35 struct chachapoly_ctx *ctx;
39 if ((ctx = calloc(1, sizeof(*ctx))) == NULL)
41 chacha_keysetup(&ctx->main_ctx, key, 256);
42 chacha_keysetup(&ctx->header_ctx, key + 32, 256);
43 return ctx;
62 chachapoly_crypt(struct chachapoly_ctx *ctx, u_int seqnr, u_char *dest,
76 chacha_ivsetup(&ctx->main_ctx, seqbuf, NULL);
77 chacha_encrypt_bytes(&ctx->main_ctx,
93 chacha_ivsetup(&ctx->header_ctx, seqbuf, NULL);
94 chacha_encrypt_bytes(&ctx->header_ctx, src, dest, aadlen);
98 chacha_ivsetup(&ctx->main_ctx, seqbuf, one);
99 chacha_encrypt_bytes(&ctx->main_ctx, src + aadlen,
117 chachapoly_get_length(struct chachapoly_ctx *ctx,
125 chacha_ivsetup(&ctx->header_ctx, seqbuf, NULL);
126 chacha_encrypt_bytes(&ctx->header_ctx, cp, buf, 4);