Lines Matching refs:rctx

31 	struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req);
50 dma_unmap_sg(qce->dev, rctx->src_sg, rctx->src_nents, dir_src);
51 dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
53 sg_free_table(&rctx->dst_tbl);
59 memcpy(rctx->iv, result_buf->encr_cntr_iv, rctx->ivsize);
67 struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req);
77 rctx->iv = req->iv;
78 rctx->ivsize = crypto_skcipher_ivsize(skcipher);
79 rctx->cryptlen = req->cryptlen;
85 rctx->src_nents = sg_nents_for_len(req->src, req->cryptlen);
87 rctx->dst_nents = sg_nents_for_len(req->dst, req->cryptlen);
89 rctx->dst_nents = rctx->src_nents;
90 if (rctx->src_nents < 0) {
92 return rctx->src_nents;
94 if (rctx->dst_nents < 0) {
96 return -rctx->dst_nents;
99 rctx->dst_nents += 1;
104 ret = sg_alloc_table(&rctx->dst_tbl, rctx->dst_nents, gfp);
108 sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ);
110 sg = qce_sgtable_add(&rctx->dst_tbl, req->dst, req->cryptlen);
116 sg = qce_sgtable_add(&rctx->dst_tbl, &rctx->result_sg,
124 rctx->dst_sg = rctx->dst_tbl.sgl;
126 dst_nents = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
133 src_nents = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src);
138 rctx->src_sg = req->src;
140 rctx->src_sg = rctx->dst_sg;
144 ret = qce_dma_prep_sgs(&qce->dma, rctx->src_sg, src_nents,
145 rctx->dst_sg, dst_nents,
162 dma_unmap_sg(qce->dev, req->src, rctx->src_nents, dir_src);
164 dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
166 sg_free_table(&rctx->dst_tbl);
260 struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req);
266 rctx->flags = tmpl->alg_flags;
267 rctx->flags |= encrypt ? QCE_ENCRYPT : QCE_DECRYPT;
268 keylen = IS_XTS(rctx->flags) ? ctx->enc_keylen >> 1 : ctx->enc_keylen;
278 if (IS_ECB(rctx->flags) || IS_CBC(rctx->flags))
290 if (IS_AES(rctx->flags) &&
292 (IS_XTS(rctx->flags) && ((req->cryptlen <= aes_sw_max_len) ||
295 skcipher_request_set_tfm(&rctx->fallback_req, ctx->fallback);
296 skcipher_request_set_callback(&rctx->fallback_req,
300 skcipher_request_set_crypt(&rctx->fallback_req, req->src,
302 ret = encrypt ? crypto_skcipher_encrypt(&rctx->fallback_req) :
303 crypto_skcipher_decrypt(&rctx->fallback_req);