Lines Matching refs:rctx
93 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ce_cipher_fallback() local
108 skcipher_request_set_tfm(&rctx->fallback_req, op->fallback_tfm); in sun8i_ce_cipher_fallback()
109 skcipher_request_set_callback(&rctx->fallback_req, areq->base.flags, in sun8i_ce_cipher_fallback()
111 skcipher_request_set_crypt(&rctx->fallback_req, areq->src, areq->dst, in sun8i_ce_cipher_fallback()
113 if (rctx->op_dir & CE_DECRYPTION) in sun8i_ce_cipher_fallback()
114 err = crypto_skcipher_decrypt(&rctx->fallback_req); in sun8i_ce_cipher_fallback()
116 err = crypto_skcipher_encrypt(&rctx->fallback_req); in sun8i_ce_cipher_fallback()
126 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ce_cipher_prepare() local
146 rctx->op_dir, areq->iv, crypto_skcipher_ivsize(tfm), in sun8i_ce_cipher_prepare()
153 flow = rctx->flow; in sun8i_ce_cipher_prepare()
162 common |= rctx->op_dir | CE_COMM_INT; in sun8i_ce_cipher_prepare()
187 rctx->addr_key = dma_map_single(ce->dev, op->key, op->keylen, DMA_TO_DEVICE); in sun8i_ce_cipher_prepare()
188 if (dma_mapping_error(ce->dev, rctx->addr_key)) { in sun8i_ce_cipher_prepare()
193 cet->t_key = cpu_to_le32(rctx->addr_key); in sun8i_ce_cipher_prepare()
197 rctx->ivlen = ivsize; in sun8i_ce_cipher_prepare()
198 if (rctx->op_dir & CE_DECRYPTION) { in sun8i_ce_cipher_prepare()
204 rctx->addr_iv = dma_map_single(ce->dev, chan->bounce_iv, rctx->ivlen, in sun8i_ce_cipher_prepare()
206 if (dma_mapping_error(ce->dev, rctx->addr_iv)) { in sun8i_ce_cipher_prepare()
211 cet->t_iv = cpu_to_le32(rctx->addr_iv); in sun8i_ce_cipher_prepare()
268 rctx->nr_sgs = nr_sgs; in sun8i_ce_cipher_prepare()
269 rctx->nr_sgd = nr_sgd; in sun8i_ce_cipher_prepare()
283 if (rctx->addr_iv) in sun8i_ce_cipher_prepare()
284 dma_unmap_single(ce->dev, rctx->addr_iv, rctx->ivlen, DMA_TO_DEVICE); in sun8i_ce_cipher_prepare()
286 if (rctx->op_dir & CE_DECRYPTION) { in sun8i_ce_cipher_prepare()
296 dma_unmap_single(ce->dev, rctx->addr_key, op->keylen, DMA_TO_DEVICE); in sun8i_ce_cipher_prepare()
309 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ce_cipher_unprepare() local
313 int nr_sgs = rctx->nr_sgs; in sun8i_ce_cipher_unprepare()
314 int nr_sgd = rctx->nr_sgd; in sun8i_ce_cipher_unprepare()
317 flow = rctx->flow; in sun8i_ce_cipher_unprepare()
332 dma_unmap_single(ce->dev, rctx->addr_iv, rctx->ivlen, DMA_TO_DEVICE); in sun8i_ce_cipher_unprepare()
334 if (rctx->op_dir & CE_DECRYPTION) { in sun8i_ce_cipher_unprepare()
344 dma_unmap_single(ce->dev, rctx->addr_key, op->keylen, DMA_TO_DEVICE); in sun8i_ce_cipher_unprepare()
353 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(breq); in sun8i_ce_cipher_run() local
356 flow = rctx->flow; in sun8i_ce_cipher_run()
379 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ce_skdecrypt() local
383 rctx->op_dir = CE_DECRYPTION; in sun8i_ce_skdecrypt()
388 rctx->flow = e; in sun8i_ce_skdecrypt()
398 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ce_skencrypt() local
402 rctx->op_dir = CE_ENCRYPTION; in sun8i_ce_skencrypt()
407 rctx->flow = e; in sun8i_ce_skencrypt()