Lines Matching refs:rctx

74 	struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq);  in sun8i_ss_cipher_fallback()  local
84 skcipher_request_set_tfm(&rctx->fallback_req, op->fallback_tfm); in sun8i_ss_cipher_fallback()
85 skcipher_request_set_callback(&rctx->fallback_req, areq->base.flags, in sun8i_ss_cipher_fallback()
87 skcipher_request_set_crypt(&rctx->fallback_req, areq->src, areq->dst, in sun8i_ss_cipher_fallback()
89 if (rctx->op_dir & SS_DECRYPTION) in sun8i_ss_cipher_fallback()
90 err = crypto_skcipher_decrypt(&rctx->fallback_req); in sun8i_ss_cipher_fallback()
92 err = crypto_skcipher_encrypt(&rctx->fallback_req); in sun8i_ss_cipher_fallback()
101 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ss_setup_ivs() local
106 struct sun8i_ss_flow *sf = &ss->flows[rctx->flow]; in sun8i_ss_setup_ivs()
111 rctx->ivlen = ivsize; in sun8i_ss_setup_ivs()
112 if (rctx->op_dir & SS_DECRYPTION) { in sun8i_ss_setup_ivs()
133 rctx->p_iv[i] = a; in sun8i_ss_setup_ivs()
135 if (rctx->op_dir & SS_ENCRYPTION) in sun8i_ss_setup_ivs()
144 rctx->niv = i; in sun8i_ss_setup_ivs()
152 dma_unmap_single(ss->dev, rctx->p_iv[i], ivsize, DMA_TO_DEVICE); in sun8i_ss_setup_ivs()
164 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ss_cipher() local
167 struct sun8i_ss_flow *sf = &ss->flows[rctx->flow]; in sun8i_ss_cipher()
180 rctx->op_dir, areq->iv, crypto_skcipher_ivsize(tfm), in sun8i_ss_cipher()
187 rctx->op_mode = ss->variant->op_mode[algt->ss_blockmode]; in sun8i_ss_cipher()
188 rctx->method = ss->variant->alg_cipher[algt->ss_algo_id]; in sun8i_ss_cipher()
189 rctx->keylen = op->keylen; in sun8i_ss_cipher()
191 rctx->p_key = dma_map_single(ss->dev, op->key, op->keylen, DMA_TO_DEVICE); in sun8i_ss_cipher()
192 if (dma_mapping_error(ss->dev, rctx->p_key)) { in sun8i_ss_cipher()
236 rctx->t_src[i].addr = sg_dma_address(sg); in sun8i_ss_cipher()
238 rctx->t_src[i].len = todo / 4; in sun8i_ss_cipher()
240 areq->cryptlen, i, rctx->t_src[i].len, sg->offset, todo); in sun8i_ss_cipher()
258 rctx->t_dst[i].addr = sg_dma_address(sg); in sun8i_ss_cipher()
260 rctx->t_dst[i].len = todo / 4; in sun8i_ss_cipher()
262 areq->cryptlen, i, rctx->t_dst[i].len, sg->offset, todo); in sun8i_ss_cipher()
274 err = sun8i_ss_run_task(ss, rctx, crypto_tfm_alg_name(areq->base.tfm)); in sun8i_ss_cipher()
286 for (i = 0; i < rctx->niv; i++) { in sun8i_ss_cipher()
287 dma_unmap_single(ss->dev, rctx->p_iv[i], ivsize, DMA_TO_DEVICE); in sun8i_ss_cipher()
292 if (rctx->op_dir & SS_DECRYPTION) { in sun8i_ss_cipher()
302 dma_unmap_single(ss->dev, rctx->p_key, op->keylen, DMA_TO_DEVICE); in sun8i_ss_cipher()
326 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ss_skdecrypt() local
330 memset(rctx, 0, sizeof(struct sun8i_cipher_req_ctx)); in sun8i_ss_skdecrypt()
331 rctx->op_dir = SS_DECRYPTION; in sun8i_ss_skdecrypt()
338 rctx->flow = e; in sun8i_ss_skdecrypt()
347 struct sun8i_cipher_req_ctx *rctx = skcipher_request_ctx(areq); in sun8i_ss_skencrypt() local
351 memset(rctx, 0, sizeof(struct sun8i_cipher_req_ctx)); in sun8i_ss_skencrypt()
352 rctx->op_dir = SS_ENCRYPTION; in sun8i_ss_skencrypt()
359 rctx->flow = e; in sun8i_ss_skencrypt()