Lines Matching refs:areq
72 int sun8i_ce_hash_init(struct ahash_request *areq) in sun8i_ce_hash_init() argument
74 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_init()
75 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_init()
81 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP; in sun8i_ce_hash_init()
86 int sun8i_ce_hash_export(struct ahash_request *areq, void *out) in sun8i_ce_hash_export() argument
88 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_export()
89 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_export()
93 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP; in sun8i_ce_hash_export()
98 int sun8i_ce_hash_import(struct ahash_request *areq, const void *in) in sun8i_ce_hash_import() argument
100 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_import()
101 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_import()
105 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP; in sun8i_ce_hash_import()
110 int sun8i_ce_hash_final(struct ahash_request *areq) in sun8i_ce_hash_final() argument
112 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_final()
113 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_final()
117 rctx->fallback_req.base.flags = areq->base.flags & in sun8i_ce_hash_final()
119 rctx->fallback_req.result = areq->result; in sun8i_ce_hash_final()
135 int sun8i_ce_hash_update(struct ahash_request *areq) in sun8i_ce_hash_update() argument
137 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_update()
138 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_update()
142 rctx->fallback_req.base.flags = areq->base.flags & in sun8i_ce_hash_update()
144 rctx->fallback_req.nbytes = areq->nbytes; in sun8i_ce_hash_update()
145 rctx->fallback_req.src = areq->src; in sun8i_ce_hash_update()
150 int sun8i_ce_hash_finup(struct ahash_request *areq) in sun8i_ce_hash_finup() argument
152 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_finup()
153 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_finup()
157 rctx->fallback_req.base.flags = areq->base.flags & in sun8i_ce_hash_finup()
160 rctx->fallback_req.nbytes = areq->nbytes; in sun8i_ce_hash_finup()
161 rctx->fallback_req.src = areq->src; in sun8i_ce_hash_finup()
162 rctx->fallback_req.result = areq->result; in sun8i_ce_hash_finup()
178 static int sun8i_ce_hash_digest_fb(struct ahash_request *areq) in sun8i_ce_hash_digest_fb() argument
180 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_digest_fb()
181 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_digest_fb()
185 rctx->fallback_req.base.flags = areq->base.flags & in sun8i_ce_hash_digest_fb()
188 rctx->fallback_req.nbytes = areq->nbytes; in sun8i_ce_hash_digest_fb()
189 rctx->fallback_req.src = areq->src; in sun8i_ce_hash_digest_fb()
190 rctx->fallback_req.result = areq->result; in sun8i_ce_hash_digest_fb()
206 static bool sun8i_ce_hash_need_fallback(struct ahash_request *areq) in sun8i_ce_hash_need_fallback() argument
208 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_need_fallback()
215 if (areq->nbytes == 0) { in sun8i_ce_hash_need_fallback()
220 if (sg_nents_for_len(areq->src, areq->nbytes) > MAX_SG - 1) { in sun8i_ce_hash_need_fallback()
224 sg = areq->src; in sun8i_ce_hash_need_fallback()
239 int sun8i_ce_hash_digest(struct ahash_request *areq) in sun8i_ce_hash_digest() argument
241 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_digest()
243 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_digest()
250 if (sun8i_ce_hash_need_fallback(areq)) in sun8i_ce_hash_digest()
251 return sun8i_ce_hash_digest_fb(areq); in sun8i_ce_hash_digest()
253 nr_sgs = sg_nents_for_len(areq->src, areq->nbytes); in sun8i_ce_hash_digest()
255 return sun8i_ce_hash_digest_fb(areq); in sun8i_ce_hash_digest()
257 for_each_sg(areq->src, sg, nr_sgs, i) { in sun8i_ce_hash_digest()
259 return sun8i_ce_hash_digest_fb(areq); in sun8i_ce_hash_digest()
269 return crypto_transfer_hash_request_to_engine(engine, areq); in sun8i_ce_hash_digest()
332 struct ahash_request *areq = container_of(breq, struct ahash_request, base); in sun8i_ce_hash_run() local
333 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); in sun8i_ce_hash_run()
335 struct sun8i_ce_hash_reqctx *rctx = ahash_request_ctx(areq); in sun8i_ce_hash_run()
352 int ns = sg_nents_for_len(areq->src, areq->nbytes); in sun8i_ce_hash_run()
384 dev_dbg(ce->dev, "%s %s len=%d\n", __func__, crypto_tfm_alg_name(areq->base.tfm), areq->nbytes); in sun8i_ce_hash_run()
397 nr_sgs = dma_map_sg(ce->dev, areq->src, ns, DMA_TO_DEVICE); in sun8i_ce_hash_run()
404 len = areq->nbytes; in sun8i_ce_hash_run()
405 for_each_sg(areq->src, sg, nr_sgs, i) { in sun8i_ce_hash_run()
425 byte_count = areq->nbytes; in sun8i_ce_hash_run()
457 cet->t_dlen = cpu_to_le32((areq->nbytes + j * 4) * 8); in sun8i_ce_hash_run()
459 cet->t_dlen = cpu_to_le32(areq->nbytes / 4 + j); in sun8i_ce_hash_run()
461 chan->timeout = areq->nbytes; in sun8i_ce_hash_run()
466 dma_unmap_sg(ce->dev, areq->src, ns, DMA_TO_DEVICE); in sun8i_ce_hash_run()
470 memcpy(areq->result, result, algt->alg.hash.base.halg.digestsize); in sun8i_ce_hash_run()