Lines Matching refs:nx_ctx
27 struct nx_crypto_ctx *nx_ctx = crypto_aead_ctx(tfm); in gcm_aes_nx_set_key() local
28 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in gcm_aes_nx_set_key()
29 struct nx_csbcpb *csbcpb_aead = nx_ctx->csbcpb_aead; in gcm_aes_nx_set_key()
31 nx_ctx_init(nx_ctx, HCOP_FC_AES); in gcm_aes_nx_set_key()
37 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in gcm_aes_nx_set_key()
42 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_192]; in gcm_aes_nx_set_key()
47 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_256]; in gcm_aes_nx_set_key()
66 struct nx_crypto_ctx *nx_ctx = crypto_aead_ctx(tfm); in gcm4106_aes_nx_set_key() local
67 char *nonce = nx_ctx->priv.gcm.nonce; in gcm4106_aes_nx_set_key()
99 static int nx_gca(struct nx_crypto_ctx *nx_ctx, in nx_gca() argument
105 struct nx_csbcpb *csbcpb_aead = nx_ctx->csbcpb_aead; in nx_gca()
107 struct nx_sg *nx_sg = nx_ctx->in_sg; in nx_gca()
123 nx_ctx->ap->sglen); in nx_gca()
125 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_gca()
133 nx_ctx->ap->databytelen); in nx_gca()
137 nx_sg = nx_walk_and_build(nx_ctx->in_sg, max_sg_len, in nx_gca()
145 nx_ctx->op_aead.inlen = (nx_ctx->in_sg - nx_sg) in nx_gca()
148 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op_aead, in nx_gca()
158 atomic_inc(&(nx_ctx->stats->aes_ops)); in nx_gca()
159 atomic64_add(assoclen, &(nx_ctx->stats->aes_bytes)); in nx_gca()
172 struct nx_crypto_ctx *nx_ctx = in gmac() local
174 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in gmac()
187 nx_ctx->ap->sglen); in gmac()
189 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in gmac()
200 nx_ctx->ap->databytelen); in gmac()
204 nx_sg = nx_walk_and_build(nx_ctx->in_sg, max_sg_len, in gmac()
212 nx_ctx->op.inlen = (nx_ctx->in_sg - nx_sg) in gmac()
218 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op, in gmac()
230 atomic_inc(&(nx_ctx->stats->aes_ops)); in gmac()
231 atomic64_add(assoclen, &(nx_ctx->stats->aes_bytes)); in gmac()
245 struct nx_crypto_ctx *nx_ctx = in gcm_empty() local
247 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in gcm_empty()
269 in_sg = nx_build_sg_list(nx_ctx->in_sg, (u8 *) iv, in gcm_empty()
270 &len, nx_ctx->ap->sglen); in gcm_empty()
276 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *) out, &len, in gcm_empty()
277 nx_ctx->ap->sglen); in gcm_empty()
282 nx_ctx->op.inlen = (nx_ctx->in_sg - in_sg) * sizeof(struct nx_sg); in gcm_empty()
283 nx_ctx->op.outlen = (nx_ctx->out_sg - out_sg) * sizeof(struct nx_sg); in gcm_empty()
285 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op, in gcm_empty()
289 atomic_inc(&(nx_ctx->stats->aes_ops)); in gcm_empty()
310 struct nx_crypto_ctx *nx_ctx = in gcm_aes_nx_crypt() local
313 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in gcm_aes_nx_crypt()
319 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in gcm_aes_nx_crypt()
338 rc = nx_gca(nx_ctx, req, csbcpb->cpb.aes_gcm.in_pat_or_aad, in gcm_aes_nx_crypt()
357 rc = nx_build_sg_lists(nx_ctx, rctx->iv, req->dst, in gcm_aes_nx_crypt()
371 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op, in gcm_aes_nx_crypt()
384 atomic_inc(&(nx_ctx->stats->aes_ops)); in gcm_aes_nx_crypt()
386 &(nx_ctx->stats->aes_bytes)); in gcm_aes_nx_crypt()
400 u8 *itag = nx_ctx->priv.gcm.iauth_tag; in gcm_aes_nx_crypt()
412 spin_unlock_irqrestore(&nx_ctx->lock, irq_flags); in gcm_aes_nx_crypt()
438 struct nx_crypto_ctx *nx_ctx = in gcm4106_aes_nx_encrypt() local
442 char *nonce = nx_ctx->priv.gcm.nonce; in gcm4106_aes_nx_encrypt()
455 struct nx_crypto_ctx *nx_ctx = in gcm4106_aes_nx_decrypt() local
459 char *nonce = nx_ctx->priv.gcm.nonce; in gcm4106_aes_nx_decrypt()