Lines Matching refs:rctx
59 struct starfive_cryp_request_ctx *rctx = ctx->rctx; in starfive_hash_hmac_key() local
67 rctx->csr.hash.hmac = 1; in starfive_hash_hmac_key()
68 rctx->csr.hash.key_flag = 1; in starfive_hash_hmac_key()
70 writel(rctx->csr.hash.v, cryp->base + STARFIVE_HASH_SHACSR); in starfive_hash_hmac_key()
90 struct starfive_cryp_request_ctx *rctx = ctx->rctx; in starfive_hash_start() local
96 dma_unmap_sg(cryp->dev, rctx->in_sg, rctx->in_sg_len, DMA_TO_DEVICE); in starfive_hash_start()
115 struct starfive_cryp_request_ctx *rctx = ctx->rctx; in starfive_hash_xmit_dma() local
122 if (!rctx->total) { in starfive_hash_xmit_dma()
127 writel(rctx->total, cryp->base + STARFIVE_DMA_IN_LEN_OFFSET); in starfive_hash_xmit_dma()
129 total_len = rctx->total; in starfive_hash_xmit_dma()
131 sg_dma_len(rctx->in_sg) = total_len; in starfive_hash_xmit_dma()
139 ret = dma_map_sg(cryp->dev, rctx->in_sg, rctx->in_sg_len, DMA_TO_DEVICE); in starfive_hash_xmit_dma()
152 in_desc = dmaengine_prep_slave_sg(cryp->tx, rctx->in_sg, in starfive_hash_xmit_dma()
170 struct starfive_cryp_request_ctx *rctx = ctx->rctx; in starfive_hash_xmit() local
174 rctx->csr.hash.v = 0; in starfive_hash_xmit()
175 rctx->csr.hash.reset = 1; in starfive_hash_xmit()
176 writel(rctx->csr.hash.v, cryp->base + STARFIVE_HASH_SHACSR); in starfive_hash_xmit()
181 rctx->csr.hash.v = 0; in starfive_hash_xmit()
182 rctx->csr.hash.mode = ctx->hash_mode; in starfive_hash_xmit()
183 rctx->csr.hash.ie = 1; in starfive_hash_xmit()
190 rctx->csr.hash.start = 1; in starfive_hash_xmit()
191 rctx->csr.hash.firstb = 1; in starfive_hash_xmit()
192 writel(rctx->csr.hash.v, cryp->base + STARFIVE_HASH_SHACSR); in starfive_hash_xmit()
200 struct starfive_cryp_request_ctx *rctx = ahash_request_ctx(req); in starfive_hash_copy_hash() local
208 mlen = rctx->digsize / sizeof(u32); in starfive_hash_copy_hash()
274 struct starfive_cryp_request_ctx *rctx = ahash_request_ctx(req); in starfive_hash_init() local
277 ahash_request_set_tfm(&rctx->ahash_fbk_req, ctx->ahash_fbk); in starfive_hash_init()
278 ahash_request_set_callback(&rctx->ahash_fbk_req, in starfive_hash_init()
282 ahash_request_set_crypt(&rctx->ahash_fbk_req, req->src, in starfive_hash_init()
285 return crypto_ahash_init(&rctx->ahash_fbk_req); in starfive_hash_init()
290 struct starfive_cryp_request_ctx *rctx = ahash_request_ctx(req); in starfive_hash_update() local
294 ahash_request_set_tfm(&rctx->ahash_fbk_req, ctx->ahash_fbk); in starfive_hash_update()
295 ahash_request_set_callback(&rctx->ahash_fbk_req, in starfive_hash_update()
299 ahash_request_set_crypt(&rctx->ahash_fbk_req, req->src, in starfive_hash_update()
302 return crypto_ahash_update(&rctx->ahash_fbk_req); in starfive_hash_update()
307 struct starfive_cryp_request_ctx *rctx = ahash_request_ctx(req); in starfive_hash_final() local
311 ahash_request_set_tfm(&rctx->ahash_fbk_req, ctx->ahash_fbk); in starfive_hash_final()
312 ahash_request_set_callback(&rctx->ahash_fbk_req, in starfive_hash_final()
316 ahash_request_set_crypt(&rctx->ahash_fbk_req, req->src, in starfive_hash_final()
319 return crypto_ahash_final(&rctx->ahash_fbk_req); in starfive_hash_final()
324 struct starfive_cryp_request_ctx *rctx = ahash_request_ctx(req); in starfive_hash_finup() local
328 ahash_request_set_tfm(&rctx->ahash_fbk_req, ctx->ahash_fbk); in starfive_hash_finup()
329 ahash_request_set_callback(&rctx->ahash_fbk_req, in starfive_hash_finup()
333 ahash_request_set_crypt(&rctx->ahash_fbk_req, req->src, in starfive_hash_finup()
336 return crypto_ahash_finup(&rctx->ahash_fbk_req); in starfive_hash_finup()
341 struct starfive_cryp_request_ctx *rctx = ahash_request_ctx(req); in starfive_hash_digest_fb() local
345 ahash_request_set_tfm(&rctx->ahash_fbk_req, ctx->ahash_fbk); in starfive_hash_digest_fb()
346 ahash_request_set_callback(&rctx->ahash_fbk_req, req->base.flags, in starfive_hash_digest_fb()
349 ahash_request_set_crypt(&rctx->ahash_fbk_req, req->src, in starfive_hash_digest_fb()
352 return crypto_ahash_digest(&rctx->ahash_fbk_req); in starfive_hash_digest_fb()
359 struct starfive_cryp_request_ctx *rctx = ahash_request_ctx(req); in starfive_hash_digest() local
362 memset(rctx, 0, sizeof(struct starfive_cryp_request_ctx)); in starfive_hash_digest()
365 rctx->total = req->nbytes; in starfive_hash_digest()
366 rctx->in_sg = req->src; in starfive_hash_digest()
367 rctx->blksize = crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); in starfive_hash_digest()
368 rctx->digsize = crypto_ahash_digestsize(tfm); in starfive_hash_digest()
369 rctx->in_sg_len = sg_nents_for_len(rctx->in_sg, rctx->total); in starfive_hash_digest()
370 ctx->rctx = rctx; in starfive_hash_digest()
372 if (starfive_hash_check_aligned(rctx->in_sg, rctx->total, rctx->blksize)) in starfive_hash_digest()
380 struct starfive_cryp_request_ctx *rctx = ahash_request_ctx(req); in starfive_hash_export() local
384 ahash_request_set_tfm(&rctx->ahash_fbk_req, ctx->ahash_fbk); in starfive_hash_export()
385 ahash_request_set_callback(&rctx->ahash_fbk_req, in starfive_hash_export()
389 return crypto_ahash_export(&rctx->ahash_fbk_req, out); in starfive_hash_export()
394 struct starfive_cryp_request_ctx *rctx = ahash_request_ctx(req); in starfive_hash_import() local
398 ahash_request_set_tfm(&rctx->ahash_fbk_req, ctx->ahash_fbk); in starfive_hash_import()
399 ahash_request_set_callback(&rctx->ahash_fbk_req, in starfive_hash_import()
403 return crypto_ahash_import(&rctx->ahash_fbk_req, in); in starfive_hash_import()