Lines Matching refs:nx_ctx
44 struct nx_crypto_ctx *nx_ctx = crypto_shash_ctx(desc); in nx_xcbc_set_key() local
45 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in nx_xcbc_set_key()
49 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in nx_xcbc_set_key()
73 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_xcbc_empty() local
74 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in nx_xcbc_empty()
93 in_sg = nx_build_sg_list(nx_ctx->in_sg, (u8 *) keys, &len, in nx_xcbc_empty()
94 nx_ctx->ap->sglen); in nx_xcbc_empty()
99 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *) keys, &len, in nx_xcbc_empty()
100 nx_ctx->ap->sglen); in nx_xcbc_empty()
105 nx_ctx->op.inlen = (nx_ctx->in_sg - in_sg) * sizeof(struct nx_sg); in nx_xcbc_empty()
106 nx_ctx->op.outlen = (nx_ctx->out_sg - out_sg) * sizeof(struct nx_sg); in nx_xcbc_empty()
108 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op, in nx_xcbc_empty()
112 atomic_inc(&(nx_ctx->stats->aes_ops)); in nx_xcbc_empty()
121 in_sg = nx_build_sg_list(nx_ctx->in_sg, (u8 *) keys[1], &len, in nx_xcbc_empty()
122 nx_ctx->ap->sglen); in nx_xcbc_empty()
128 out_sg = nx_build_sg_list(nx_ctx->out_sg, out, &len, in nx_xcbc_empty()
129 nx_ctx->ap->sglen); in nx_xcbc_empty()
134 nx_ctx->op.inlen = (nx_ctx->in_sg - in_sg) * sizeof(struct nx_sg); in nx_xcbc_empty()
135 nx_ctx->op.outlen = (nx_ctx->out_sg - out_sg) * sizeof(struct nx_sg); in nx_xcbc_empty()
137 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op, in nx_xcbc_empty()
141 atomic_inc(&(nx_ctx->stats->aes_ops)); in nx_xcbc_empty()
154 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in nx_crypto_ctx_aes_xcbc_init2() local
155 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in nx_crypto_ctx_aes_xcbc_init2()
162 nx_ctx_init(nx_ctx, HCOP_FC_AES); in nx_crypto_ctx_aes_xcbc_init2()
184 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_xcbc_update() local
185 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in nx_xcbc_update()
194 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in nx_xcbc_update()
209 in_sg = nx_ctx->in_sg; in nx_xcbc_update()
211 nx_ctx->ap->sglen); in nx_xcbc_update()
213 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_xcbc_update()
216 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *)sctx->state, in nx_xcbc_update()
217 &len, nx_ctx->ap->sglen); in nx_xcbc_update()
224 nx_ctx->op.outlen = (nx_ctx->out_sg - out_sg) * sizeof(struct nx_sg); in nx_xcbc_update()
244 in_sg = nx_build_sg_list(nx_ctx->in_sg, in nx_xcbc_update()
265 nx_ctx->op.inlen = (nx_ctx->in_sg - in_sg) * in nx_xcbc_update()
277 if (!nx_ctx->op.inlen || !nx_ctx->op.outlen) { in nx_xcbc_update()
282 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op, in nx_xcbc_update()
287 atomic_inc(&(nx_ctx->stats->aes_ops)); in nx_xcbc_update()
295 in_sg = nx_ctx->in_sg; in nx_xcbc_update()
303 spin_unlock_irqrestore(&nx_ctx->lock, irq_flags); in nx_xcbc_update()
310 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_xcbc_final() local
311 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in nx_xcbc_final()
317 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in nx_xcbc_final()
339 in_sg = nx_build_sg_list(nx_ctx->in_sg, (u8 *)sctx->buffer, in nx_xcbc_final()
340 &len, nx_ctx->ap->sglen); in nx_xcbc_final()
348 out_sg = nx_build_sg_list(nx_ctx->out_sg, out, &len, in nx_xcbc_final()
349 nx_ctx->ap->sglen); in nx_xcbc_final()
356 nx_ctx->op.inlen = (nx_ctx->in_sg - in_sg) * sizeof(struct nx_sg); in nx_xcbc_final()
357 nx_ctx->op.outlen = (nx_ctx->out_sg - out_sg) * sizeof(struct nx_sg); in nx_xcbc_final()
359 if (!nx_ctx->op.outlen) { in nx_xcbc_final()
364 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op, in nx_xcbc_final()
369 atomic_inc(&(nx_ctx->stats->aes_ops)); in nx_xcbc_final()
373 spin_unlock_irqrestore(&nx_ctx->lock, irq_flags); in nx_xcbc_final()