Lines Matching refs:areq

161 int sun8i_ss_hash_init(struct ahash_request *areq)
163 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
164 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
170 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP;
175 int sun8i_ss_hash_export(struct ahash_request *areq, void *out)
177 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
178 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
182 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP;
187 int sun8i_ss_hash_import(struct ahash_request *areq, const void *in)
189 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
190 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
194 rctx->fallback_req.base.flags = areq->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP;
199 int sun8i_ss_hash_final(struct ahash_request *areq)
201 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
202 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
206 rctx->fallback_req.base.flags = areq->base.flags &
208 rctx->fallback_req.result = areq->result;
225 int sun8i_ss_hash_update(struct ahash_request *areq)
227 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
228 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
232 rctx->fallback_req.base.flags = areq->base.flags &
234 rctx->fallback_req.nbytes = areq->nbytes;
235 rctx->fallback_req.src = areq->src;
240 int sun8i_ss_hash_finup(struct ahash_request *areq)
242 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
243 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
247 rctx->fallback_req.base.flags = areq->base.flags &
250 rctx->fallback_req.nbytes = areq->nbytes;
251 rctx->fallback_req.src = areq->src;
252 rctx->fallback_req.result = areq->result;
269 static int sun8i_ss_hash_digest_fb(struct ahash_request *areq)
271 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
272 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
276 rctx->fallback_req.base.flags = areq->base.flags &
279 rctx->fallback_req.nbytes = areq->nbytes;
280 rctx->fallback_req.src = areq->src;
281 rctx->fallback_req.result = areq->result;
357 static bool sun8i_ss_hash_need_fallback(struct ahash_request *areq)
359 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
366 if (areq->nbytes == 0) {
371 if (areq->nbytes >= MAX_PAD_SIZE - 64) {
377 if (sg_nents(areq->src) > MAX_SG - 1) {
382 sg = areq->src;
406 int sun8i_ss_hash_digest(struct ahash_request *areq)
408 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
409 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
416 if (sun8i_ss_hash_need_fallback(areq))
417 return sun8i_ss_hash_digest_fb(areq);
426 return crypto_transfer_hash_request_to_engine(engine, areq);
492 struct ahash_request *areq = container_of(breq, struct ahash_request, base);
493 struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq);
495 struct sun8i_ss_hash_reqctx *rctx = ahash_request_ctx(areq);
537 nr_sgs = dma_map_sg(ss->dev, areq->src, sg_nents(areq->src), DMA_TO_DEVICE);
552 len = areq->nbytes;
553 sg = areq->src;
586 byte_count = areq->nbytes;
607 byte_count = areq->nbytes + bs;
667 err = sun8i_ss_run_hash_task(ss, rctx, crypto_tfm_alg_name(areq->base.tfm));
703 dma_unmap_sg(ss->dev, areq->src, sg_nents(areq->src),
711 memcpy(areq->result, result, crypto_ahash_digestsize(tfm));