Lines Matching refs:rctx
41 struct rctx { struct
101 struct rctx *rctx = skcipher_request_ctx(req); in post_crypt() local
102 le128 *buf = rctx->ext ?: rctx->buf; in post_crypt()
110 subreq = &rctx->subreq; in post_crypt()
127 rctx->left -= subreq->cryptlen; in post_crypt()
129 if (err || !rctx->left) in post_crypt()
132 rctx->dst = rctx->dstbuf; in post_crypt()
138 if (rctx->dst != sg) { in post_crypt()
139 rctx->dst[0] = *sg; in post_crypt()
140 sg_unmark_end(rctx->dst); in post_crypt()
141 scatterwalk_crypto_chain(rctx->dst, sg_next(sg), 2); in post_crypt()
143 rctx->dst[0].length -= offset - sg->offset; in post_crypt()
144 rctx->dst[0].offset = offset; in post_crypt()
152 struct rctx *rctx = skcipher_request_ctx(req); in pre_crypt() local
153 le128 *buf = rctx->ext ?: rctx->buf; in pre_crypt()
163 subreq = &rctx->subreq; in pre_crypt()
166 more = rctx->left > cryptlen; in pre_crypt()
168 cryptlen = rctx->left; in pre_crypt()
170 skcipher_request_set_crypt(subreq, rctx->src, rctx->dst, in pre_crypt()
184 *buf++ = rctx->t; in pre_crypt()
185 le128_xor(wdst++, &rctx->t, wsrc++); in pre_crypt()
186 gf128mul_x_ble(&rctx->t, &rctx->t); in pre_crypt()
192 skcipher_request_set_crypt(subreq, rctx->dst, rctx->dst, in pre_crypt()
198 rctx->src = rctx->srcbuf; in pre_crypt()
204 if (rctx->src != sg) { in pre_crypt()
205 rctx->src[0] = *sg; in pre_crypt()
206 sg_unmark_end(rctx->src); in pre_crypt()
207 scatterwalk_crypto_chain(rctx->src, sg_next(sg), 2); in pre_crypt()
209 rctx->src[0].length -= offset - sg->offset; in pre_crypt()
210 rctx->src[0].offset = offset; in pre_crypt()
219 struct rctx *rctx = skcipher_request_ctx(req); in init_crypt() local
223 subreq = &rctx->subreq; in init_crypt()
229 rctx->ext = NULL; in init_crypt()
235 rctx->ext = kmalloc(n, gfp); in init_crypt()
236 if (rctx->ext) in init_crypt()
240 rctx->src = req->src; in init_crypt()
241 rctx->dst = req->dst; in init_crypt()
242 rctx->left = req->cryptlen; in init_crypt()
245 crypto_cipher_encrypt_one(ctx->tweak, (u8 *)&rctx->t, req->iv); in init_crypt()
252 struct rctx *rctx = skcipher_request_ctx(req); in exit_crypt() local
254 rctx->left = 0; in exit_crypt()
256 if (rctx->ext) in exit_crypt()
257 kzfree(rctx->ext); in exit_crypt()
262 struct rctx *rctx = skcipher_request_ctx(req); in do_encrypt() local
265 subreq = &rctx->subreq; in do_encrypt()
267 while (!err && rctx->left) { in do_encrypt()
284 struct rctx *rctx; in encrypt_done() local
286 rctx = skcipher_request_ctx(req); in encrypt_done()
289 if (rctx->left != req->cryptlen) in encrypt_done()
294 subreq = &rctx->subreq; in encrypt_done()
298 if (rctx->left) in encrypt_done()
312 struct rctx *rctx = skcipher_request_ctx(req); in do_decrypt() local
315 subreq = &rctx->subreq; in do_decrypt()
317 while (!err && rctx->left) { in do_decrypt()
334 struct rctx *rctx; in decrypt_done() local
336 rctx = skcipher_request_ctx(req); in decrypt_done()
339 if (rctx->left != req->cryptlen) in decrypt_done()
344 subreq = &rctx->subreq; in decrypt_done()
348 if (rctx->left) in decrypt_done()
383 sizeof(struct rctx)); in init_tfm()