Lines Matching refs:areq

73 int sun8i_ss_hash_init(struct ahash_request *areq)
75 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
76 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
82 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP;
87 int sun8i_ss_hash_export(struct ahash_request *areq, void *out)
89 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
90 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
94 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP;
99 int sun8i_ss_hash_import(struct ahash_request *areq, const void *in)
101 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
102 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
106 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP;
111 int sun8i_ss_hash_final(struct ahash_request *areq)
113 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
114 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
122 rctx->fallback_req.base.flags = areq->base.flags &
124 rctx->fallback_req.result = areq->result;
134 int sun8i_ss_hash_update(struct ahash_request *areq)
136 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
137 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
141 rctx->fallback_req.base.flags = areq->base.flags &
143 rctx->fallback_req.nbytes = areq->nbytes;
144 rctx->fallback_req.src = areq->src;
149 int sun8i_ss_hash_finup(struct ahash_request *areq)
151 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
152 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
160 rctx->fallback_req.base.flags = areq->base.flags &
163 rctx->fallback_req.nbytes = areq->nbytes;
164 rctx->fallback_req.src = areq->src;
165 rctx->fallback_req.result = areq->result;
174 static int sun8i_ss_hash_digest_fb(struct ahash_request *areq)
176 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
177 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
185 rctx->fallback_req.base.flags = areq->base.flags &
188 rctx->fallback_req.nbytes = areq->nbytes;
189 rctx->fallback_req.src = areq->src;
190 rctx->fallback_req.result = areq->result;
258 static bool sun8i_ss_hash_need_fallback(struct ahash_request *areq)
262 if (areq->nbytes == 0)
265 if (sg_nents(areq->src) > MAX_SG - 1)
267 sg = areq->src;
282 int sun8i_ss_hash_digest(struct ahash_request *areq)
284 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
286 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
293 if (sun8i_ss_hash_need_fallback(areq))
294 return sun8i_ss_hash_digest_fb(areq);
296 nr_sgs = sg_nents(areq->src);
298 return sun8i_ss_hash_digest_fb(areq);
300 for_each_sg(areq->src, sg, nr_sgs, i) {
302 return sun8i_ss_hash_digest_fb(areq);
312 return crypto_transfer_hash_request_to_engine(engine, areq);
320 struct ahash_request *areq = container_of(breq, struct ahash_request, base);
321 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
323 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
360 nr_sgs = dma_map_sg(ss->dev, areq->src, sg_nents(areq->src), DMA_TO_DEVICE);
374 len = areq->nbytes;
375 sg = areq->src;
397 byte_count = areq->nbytes;
435 err = sun8i_ss_run_hash_task(ss, rctx, crypto_tfm_alg_name(areq->base.tfm));
438 dma_unmap_sg(ss->dev, areq->src, nr_sgs, DMA_TO_DEVICE);
441 memcpy(areq->result, result, algt->alg.hash.halg.digestsize);