Lines Matching refs:rctx

74 		struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
76 rctx->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
97 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
98 u8 tag[sizeof(rctx->tag)];
101 req->assoclen + rctx->cryptlen,
103 if (crypto_memneq(tag, rctx->tag, sizeof(tag)))
110 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
112 scatterwalk_map_and_copy(rctx->tag, req->dst,
113 req->assoclen + rctx->cryptlen,
114 sizeof(rctx->tag), 1);
126 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
127 struct chacha_req *creq = &rctx->u.chacha;
131 if (rctx->cryptlen == 0)
136 src = scatterwalk_ffwd(rctx->src, req->src, req->assoclen);
139 dst = scatterwalk_ffwd(rctx->dst, req->dst, req->assoclen);
141 skcipher_request_set_callback(&creq->req, rctx->flags,
145 rctx->cryptlen, creq->iv);
156 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
158 if (rctx->cryptlen == req->cryptlen) /* encrypting */
173 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
174 struct poly_req *preq = &rctx->u.poly;
177 preq->tail.assoclen = cpu_to_le64(rctx->assoclen);
178 preq->tail.cryptlen = cpu_to_le64(rctx->cryptlen);
181 ahash_request_set_callback(&preq->req, rctx->flags,
185 rctx->tag, sizeof(preq->tail));
202 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
203 struct poly_req *preq = &rctx->u.poly;
207 padlen = -rctx->cryptlen % POLY1305_BLOCK_SIZE;
211 ahash_request_set_callback(&preq->req, rctx->flags,
231 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
232 struct poly_req *preq = &rctx->u.poly;
236 if (rctx->cryptlen == req->cryptlen) /* encrypting */
239 crypt = scatterwalk_ffwd(rctx->src, crypt, req->assoclen);
241 ahash_request_set_callback(&preq->req, rctx->flags,
244 ahash_request_set_crypt(&preq->req, crypt, NULL, rctx->cryptlen);
261 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
262 struct poly_req *preq = &rctx->u.poly;
266 padlen = -rctx->assoclen % POLY1305_BLOCK_SIZE;
270 ahash_request_set_callback(&preq->req, rctx->flags,
290 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
291 struct poly_req *preq = &rctx->u.poly;
294 ahash_request_set_callback(&preq->req, rctx->flags,
297 ahash_request_set_crypt(&preq->req, req->src, NULL, rctx->assoclen);
314 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
315 struct poly_req *preq = &rctx->u.poly;
318 sg_init_one(preq->src, rctx->key, sizeof(rctx->key));
320 ahash_request_set_callback(&preq->req, rctx->flags,
323 ahash_request_set_crypt(&preq->req, preq->src, NULL, sizeof(rctx->key));
340 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
341 struct poly_req *preq = &rctx->u.poly;
344 ahash_request_set_callback(&preq->req, rctx->flags,
364 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
365 struct chacha_req *creq = &rctx->u.chacha;
368 rctx->assoclen = req->assoclen;
371 if (rctx->assoclen < 8)
373 rctx->assoclen -= 8;
376 memset(rctx->key, 0, sizeof(rctx->key));
377 sg_init_one(creq->src, rctx->key, sizeof(rctx->key));
381 skcipher_request_set_callback(&creq->req, rctx->flags,
402 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
403 struct chacha_req *creq = &rctx->u.chacha;
412 src = scatterwalk_ffwd(rctx->src, req->src, req->assoclen);
415 dst = scatterwalk_ffwd(rctx->dst, req->dst, req->assoclen);
417 skcipher_request_set_callback(&creq->req, rctx->flags,
432 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
434 rctx->cryptlen = req->cryptlen;
435 rctx->flags = aead_request_flags(req);
454 struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
456 rctx->cryptlen = req->cryptlen - POLY1305_DIGEST_SIZE;
457 rctx->flags = aead_request_flags(req);