Lines Matching refs:rctx
58 struct rctx { struct
151 struct rctx *rctx = skcipher_request_ctx(req); in post_crypt() local
152 be128 *buf = rctx->ext ?: rctx->buf; in post_crypt()
160 subreq = &rctx->subreq; in post_crypt()
177 rctx->left -= subreq->cryptlen; in post_crypt()
179 if (err || !rctx->left) in post_crypt()
182 rctx->dst = rctx->dstbuf; in post_crypt()
188 if (rctx->dst != sg) { in post_crypt()
189 rctx->dst[0] = *sg; in post_crypt()
190 sg_unmark_end(rctx->dst); in post_crypt()
191 scatterwalk_crypto_chain(rctx->dst, sg_next(sg), 2); in post_crypt()
193 rctx->dst[0].length -= offset - sg->offset; in post_crypt()
194 rctx->dst[0].offset = offset; in post_crypt()
203 struct rctx *rctx = skcipher_request_ctx(req); in pre_crypt() local
205 be128 *buf = rctx->ext ?: rctx->buf; in pre_crypt()
216 subreq = &rctx->subreq; in pre_crypt()
220 more = rctx->left > cryptlen; in pre_crypt()
222 cryptlen = rctx->left; in pre_crypt()
224 skcipher_request_set_crypt(subreq, rctx->src, rctx->dst, in pre_crypt()
239 *buf++ = rctx->t; in pre_crypt()
240 be128_xor(wdst++, &rctx->t, wsrc++); in pre_crypt()
244 be128_xor(&rctx->t, &rctx->t, in pre_crypt()
253 skcipher_request_set_crypt(subreq, rctx->dst, rctx->dst, in pre_crypt()
259 rctx->src = rctx->srcbuf; in pre_crypt()
265 if (rctx->src != sg) { in pre_crypt()
266 rctx->src[0] = *sg; in pre_crypt()
267 sg_unmark_end(rctx->src); in pre_crypt()
268 scatterwalk_crypto_chain(rctx->src, sg_next(sg), 2); in pre_crypt()
270 rctx->src[0].length -= offset - sg->offset; in pre_crypt()
271 rctx->src[0].offset = offset; in pre_crypt()
280 struct rctx *rctx = skcipher_request_ctx(req); in init_crypt() local
284 subreq = &rctx->subreq; in init_crypt()
289 rctx->ext = NULL; in init_crypt()
295 rctx->ext = kmalloc(n, gfp); in init_crypt()
296 if (rctx->ext) in init_crypt()
300 rctx->src = req->src; in init_crypt()
301 rctx->dst = req->dst; in init_crypt()
302 rctx->left = req->cryptlen; in init_crypt()
305 memcpy(&rctx->t, req->iv, sizeof(rctx->t)); in init_crypt()
308 gf128mul_64k_bbe(&rctx->t, ctx->table); in init_crypt()
315 struct rctx *rctx = skcipher_request_ctx(req); in exit_crypt() local
317 rctx->left = 0; in exit_crypt()
319 if (rctx->ext) in exit_crypt()
320 kzfree(rctx->ext); in exit_crypt()
325 struct rctx *rctx = skcipher_request_ctx(req); in do_encrypt() local
328 subreq = &rctx->subreq; in do_encrypt()
330 while (!err && rctx->left) { in do_encrypt()
347 struct rctx *rctx; in encrypt_done() local
349 rctx = skcipher_request_ctx(req); in encrypt_done()
352 if (rctx->left != req->cryptlen) in encrypt_done()
357 subreq = &rctx->subreq; in encrypt_done()
361 if (rctx->left) in encrypt_done()
375 struct rctx *rctx = skcipher_request_ctx(req); in do_decrypt() local
378 subreq = &rctx->subreq; in do_decrypt()
380 while (!err && rctx->left) { in do_decrypt()
397 struct rctx *rctx; in decrypt_done() local
399 rctx = skcipher_request_ctx(req); in decrypt_done()
402 if (rctx->left != req->cryptlen) in decrypt_done()
407 subreq = &rctx->subreq; in decrypt_done()
411 if (rctx->left) in decrypt_done()
437 sizeof(struct rctx)); in init_tfm()