Lines Matching defs:ctx
86 struct chachapoly_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req));
90 memcpy(iv + sizeof(leicb), ctx->salt, ctx->saltlen);
91 memcpy(iv + sizeof(leicb) + ctx->saltlen, req->iv,
92 CHACHA_IV_SIZE - sizeof(leicb) - ctx->saltlen);
125 struct chachapoly_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req));
143 skcipher_request_set_tfm(&creq->req, ctx->chacha);
172 struct chachapoly_ctx *ctx = crypto_aead_ctx(tfm);
183 ahash_request_set_tfm(&preq->req, ctx->poly);
201 struct chachapoly_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req));
213 ahash_request_set_tfm(&preq->req, ctx->poly);
230 struct chachapoly_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req));
243 ahash_request_set_tfm(&preq->req, ctx->poly);
260 struct chachapoly_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req));
272 ahash_request_set_tfm(&preq->req, ctx->poly);
289 struct chachapoly_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req));
296 ahash_request_set_tfm(&preq->req, ctx->poly);
313 struct chachapoly_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req));
322 ahash_request_set_tfm(&preq->req, ctx->poly);
339 struct chachapoly_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req));
346 ahash_request_set_tfm(&preq->req, ctx->poly);
363 struct chachapoly_ctx *ctx = crypto_aead_ctx(tfm);
383 skcipher_request_set_tfm(&creq->req, ctx->chacha);
401 struct chachapoly_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req));
419 skcipher_request_set_tfm(&creq->req, ctx->chacha);
477 struct chachapoly_ctx *ctx = crypto_aead_ctx(aead);
479 if (keylen != ctx->saltlen + CHACHA_KEY_SIZE)
482 keylen -= ctx->saltlen;
483 memcpy(ctx->salt, key + keylen, ctx->saltlen);
485 crypto_skcipher_clear_flags(ctx->chacha, CRYPTO_TFM_REQ_MASK);
486 crypto_skcipher_set_flags(ctx->chacha, crypto_aead_get_flags(aead) &
488 return crypto_skcipher_setkey(ctx->chacha, key, keylen);
504 struct chachapoly_ctx *ctx = crypto_aead_ctx(tfm);
519 ctx->chacha = chacha;
520 ctx->poly = poly;
521 ctx->saltlen = ictx->saltlen;
540 struct chachapoly_ctx *ctx = crypto_aead_ctx(tfm);
542 crypto_free_ahash(ctx->poly);
543 crypto_free_skcipher(ctx->chacha);
548 struct chachapoly_instance_ctx *ctx = aead_instance_ctx(inst);
550 crypto_drop_skcipher(&ctx->chacha);
551 crypto_drop_ahash(&ctx->poly);
560 struct chachapoly_instance_ctx *ctx;
572 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL);
575 ctx = aead_instance_ctx(inst);
576 ctx->saltlen = CHACHAPOLY_IV_SIZE - ivsize;
578 err = crypto_grab_skcipher(&ctx->chacha, aead_crypto_instance(inst),
582 chacha = crypto_spawn_skcipher_alg(&ctx->chacha);
584 err = crypto_grab_ahash(&ctx->poly, aead_crypto_instance(inst),
588 poly = crypto_spawn_ahash_alg(&ctx->poly);
616 ctx->saltlen;