Lines Matching refs:nx_ctx

33 	struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm);  in nx_crypto_ctx_sha512_init()  local
40 nx_ctx_init(nx_ctx, HCOP_FC_SHA); in nx_crypto_ctx_sha512_init()
42 nx_ctx->ap = &nx_ctx->props[NX_PROPS_SHA512]; in nx_crypto_ctx_sha512_init()
44 NX_CPB_SET_DIGEST_SIZE(nx_ctx->csbcpb, NX_DS_SHA512); in nx_crypto_ctx_sha512_init()
72 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_sha512_update() local
73 struct nx_csbcpb *csbcpb = (struct nx_csbcpb *)nx_ctx->csbcpb; in nx_sha512_update()
82 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in nx_sha512_update()
99 max_sg_len = min_t(u64, nx_ctx->ap->sglen, in nx_sha512_update()
102 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_sha512_update()
105 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *)sctx->state, in nx_sha512_update()
107 nx_ctx->op.outlen = (nx_ctx->out_sg - out_sg) * sizeof(struct nx_sg); in nx_sha512_update()
116 struct nx_sg *in_sg = nx_ctx->in_sg; in nx_sha512_update()
128 used_sgs = in_sg - nx_ctx->in_sg; in nx_sha512_update()
146 nx_ctx->op.inlen = (nx_ctx->in_sg - in_sg) * sizeof(struct nx_sg); in nx_sha512_update()
164 if (!nx_ctx->op.inlen || !nx_ctx->op.outlen) { in nx_sha512_update()
169 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op, in nx_sha512_update()
174 atomic_inc(&(nx_ctx->stats->sha512_ops)); in nx_sha512_update()
188 spin_unlock_irqrestore(&nx_ctx->lock, irq_flags); in nx_sha512_update()
195 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_sha512_final() local
196 struct nx_csbcpb *csbcpb = (struct nx_csbcpb *)nx_ctx->csbcpb; in nx_sha512_final()
204 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in nx_sha512_final()
206 max_sg_len = min_t(u64, nx_ctx->ap->sglen, in nx_sha512_final()
209 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_sha512_final()
232 in_sg = nx_build_sg_list(nx_ctx->in_sg, sctx->buf, &len, in nx_sha512_final()
241 out_sg = nx_build_sg_list(nx_ctx->out_sg, out, &len, in nx_sha512_final()
244 nx_ctx->op.inlen = (nx_ctx->in_sg - in_sg) * sizeof(struct nx_sg); in nx_sha512_final()
245 nx_ctx->op.outlen = (nx_ctx->out_sg - out_sg) * sizeof(struct nx_sg); in nx_sha512_final()
247 if (!nx_ctx->op.outlen) { in nx_sha512_final()
252 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op, in nx_sha512_final()
257 atomic_inc(&(nx_ctx->stats->sha512_ops)); in nx_sha512_final()
258 atomic64_add(sctx->count[0], &(nx_ctx->stats->sha512_bytes)); in nx_sha512_final()
262 spin_unlock_irqrestore(&nx_ctx->lock, irq_flags); in nx_sha512_final()