Lines Matching defs:areq

144 int sun8i_ss_hash_init(struct ahash_request *areq)
146 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
147 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
153 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP;
158 int sun8i_ss_hash_export(struct ahash_request *areq, void *out)
160 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
161 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
165 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP;
170 int sun8i_ss_hash_import(struct ahash_request *areq, const void *in)
172 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
173 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
177 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP;
182 int sun8i_ss_hash_final(struct ahash_request *areq)
184 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
185 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
189 rctx->fallback_req.base.flags = areq->base.flags &
191 rctx->fallback_req.result = areq->result;
208 int sun8i_ss_hash_update(struct ahash_request *areq)
210 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
211 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
215 rctx->fallback_req.base.flags = areq->base.flags &
217 rctx->fallback_req.nbytes = areq->nbytes;
218 rctx->fallback_req.src = areq->src;
223 int sun8i_ss_hash_finup(struct ahash_request *areq)
225 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
226 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
230 rctx->fallback_req.base.flags = areq->base.flags &
233 rctx->fallback_req.nbytes = areq->nbytes;
234 rctx->fallback_req.src = areq->src;
235 rctx->fallback_req.result = areq->result;
252 static int sun8i_ss_hash_digest_fb(struct ahash_request *areq)
254 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
255 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
259 rctx->fallback_req.base.flags = areq->base.flags &
262 rctx->fallback_req.nbytes = areq->nbytes;
263 rctx->fallback_req.src = areq->src;
264 rctx->fallback_req.result = areq->result;
340 static bool sun8i_ss_hash_need_fallback(struct ahash_request *areq)
342 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
349 if (areq->nbytes == 0) {
354 if (areq->nbytes >= MAX_PAD_SIZE - 64) {
360 if (sg_nents(areq->src) > MAX_SG - 1) {
365 sg = areq->src;
389 int sun8i_ss_hash_digest(struct ahash_request *areq)
391 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
392 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
399 if (sun8i_ss_hash_need_fallback(areq))
400 return sun8i_ss_hash_digest_fb(areq);
409 return crypto_transfer_hash_request_to_engine(engine, areq);
475 struct ahash_request *areq = container_of(breq, struct ahash_request, base);
476 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
478 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
520 nr_sgs = dma_map_sg(ss->dev, areq->src, sg_nents(areq->src), DMA_TO_DEVICE);
535 len = areq->nbytes;
536 sg = areq->src;
569 byte_count = areq->nbytes;
590 byte_count = areq->nbytes + bs;
650 err = sun8i_ss_run_hash_task(ss, rctx, crypto_tfm_alg_name(areq->base.tfm));
686 dma_unmap_sg(ss->dev, areq->src, sg_nents(areq->src),
694 memcpy(areq->result, result, crypto_ahash_digestsize(tfm));