Lines Matching refs:rctx
93 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ss_cipher_fallback() local
108 skcipher_request_set_tfm(&rctx->fallback_req, op->fallback_tfm); in sun8i_ss_cipher_fallback()
109 skcipher_request_set_callback(&rctx->fallback_req, areq->base.flags, in sun8i_ss_cipher_fallback()
111 skcipher_request_set_crypt(&rctx->fallback_req, areq->src, areq->dst, in sun8i_ss_cipher_fallback()
113 if (rctx->op_dir & SS_DECRYPTION) in sun8i_ss_cipher_fallback()
114 err = crypto_skcipher_decrypt(&rctx->fallback_req); in sun8i_ss_cipher_fallback()
116 err = crypto_skcipher_encrypt(&rctx->fallback_req); in sun8i_ss_cipher_fallback()
125 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ss_setup_ivs() local
130 struct sun8i_ss_flow *sf = &ss->flows[rctx->flow]; in sun8i_ss_setup_ivs()
135 rctx->ivlen = ivsize; in sun8i_ss_setup_ivs()
136 if (rctx->op_dir & SS_DECRYPTION) { in sun8i_ss_setup_ivs()
157 rctx->p_iv[i] = a; in sun8i_ss_setup_ivs()
159 if (rctx->op_dir == SS_ENCRYPTION) in sun8i_ss_setup_ivs()
168 rctx->niv = i; in sun8i_ss_setup_ivs()
176 dma_unmap_single(ss->dev, rctx->p_iv[i], ivsize, DMA_TO_DEVICE); in sun8i_ss_setup_ivs()
188 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ss_cipher() local
191 struct sun8i_ss_flow *sf = &ss->flows[rctx->flow]; in sun8i_ss_cipher()
206 rctx->op_dir, areq->iv, crypto_skcipher_ivsize(tfm), in sun8i_ss_cipher()
213 rctx->op_mode = ss->variant->op_mode[algt->ss_blockmode]; in sun8i_ss_cipher()
214 rctx->method = ss->variant->alg_cipher[algt->ss_algo_id]; in sun8i_ss_cipher()
215 rctx->keylen = op->keylen; in sun8i_ss_cipher()
217 rctx->p_key = dma_map_single(ss->dev, op->key, op->keylen, DMA_TO_DEVICE); in sun8i_ss_cipher()
218 if (dma_mapping_error(ss->dev, rctx->p_key)) { in sun8i_ss_cipher()
259 rctx->t_src[i].addr = sg_dma_address(sg); in sun8i_ss_cipher()
261 rctx->t_src[i].len = todo / 4; in sun8i_ss_cipher()
263 areq->cryptlen, i, rctx->t_src[i].len, sg->offset, todo); in sun8i_ss_cipher()
281 rctx->t_dst[i].addr = sg_dma_address(sg); in sun8i_ss_cipher()
283 rctx->t_dst[i].len = todo / 4; in sun8i_ss_cipher()
285 areq->cryptlen, i, rctx->t_dst[i].len, sg->offset, todo); in sun8i_ss_cipher()
297 err = sun8i_ss_run_task(ss, rctx, crypto_tfm_alg_name(areq->base.tfm)); in sun8i_ss_cipher()
309 for (i = 0; i < rctx->niv; i++) { in sun8i_ss_cipher()
310 dma_unmap_single(ss->dev, rctx->p_iv[i], ivsize, DMA_TO_DEVICE); in sun8i_ss_cipher()
315 if (rctx->op_dir & SS_DECRYPTION) { in sun8i_ss_cipher()
325 dma_unmap_single(ss->dev, rctx->p_key, op->keylen, DMA_TO_DEVICE); in sun8i_ss_cipher()
349 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ss_skdecrypt() local
353 memset(rctx, 0, sizeof(struct sun8i_cipher_req_ctx)); in sun8i_ss_skdecrypt()
354 rctx->op_dir = SS_DECRYPTION; in sun8i_ss_skdecrypt()
361 rctx->flow = e; in sun8i_ss_skdecrypt()
370 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ss_skencrypt() local
374 memset(rctx, 0, sizeof(struct sun8i_cipher_req_ctx)); in sun8i_ss_skencrypt()
375 rctx->op_dir = SS_ENCRYPTION; in sun8i_ss_skencrypt()
382 rctx->flow = e; in sun8i_ss_skencrypt()