Lines Matching refs:nx_ctx

38 	struct nx_crypto_ctx *nx_ctx = crypto_aead_ctx(tfm);  in gcm_aes_nx_set_key()  local
39 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in gcm_aes_nx_set_key()
40 struct nx_csbcpb *csbcpb_aead = nx_ctx->csbcpb_aead; in gcm_aes_nx_set_key()
42 nx_ctx_init(nx_ctx, HCOP_FC_AES); in gcm_aes_nx_set_key()
48 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in gcm_aes_nx_set_key()
53 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_192]; in gcm_aes_nx_set_key()
58 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_256]; in gcm_aes_nx_set_key()
77 struct nx_crypto_ctx *nx_ctx = crypto_aead_ctx(tfm); in gcm4106_aes_nx_set_key() local
78 char *nonce = nx_ctx->priv.gcm.nonce; in gcm4106_aes_nx_set_key()
110 static int nx_gca(struct nx_crypto_ctx *nx_ctx, in nx_gca() argument
116 struct nx_csbcpb *csbcpb_aead = nx_ctx->csbcpb_aead; in nx_gca()
118 struct nx_sg *nx_sg = nx_ctx->in_sg; in nx_gca()
134 nx_ctx->ap->sglen); in nx_gca()
136 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_gca()
144 nx_ctx->ap->databytelen); in nx_gca()
148 nx_sg = nx_walk_and_build(nx_ctx->in_sg, max_sg_len, in nx_gca()
156 nx_ctx->op_aead.inlen = (nx_ctx->in_sg - nx_sg) in nx_gca()
159 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op_aead, in nx_gca()
169 atomic_inc(&(nx_ctx->stats->aes_ops)); in nx_gca()
170 atomic64_add(assoclen, &(nx_ctx->stats->aes_bytes)); in nx_gca()
184 struct nx_crypto_ctx *nx_ctx = in gmac() local
186 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in gmac()
199 nx_ctx->ap->sglen); in gmac()
201 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in gmac()
212 nx_ctx->ap->databytelen); in gmac()
216 nx_sg = nx_walk_and_build(nx_ctx->in_sg, max_sg_len, in gmac()
224 nx_ctx->op.inlen = (nx_ctx->in_sg - nx_sg) in gmac()
230 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op, in gmac()
242 atomic_inc(&(nx_ctx->stats->aes_ops)); in gmac()
243 atomic64_add(assoclen, &(nx_ctx->stats->aes_bytes)); in gmac()
258 struct nx_crypto_ctx *nx_ctx = in gcm_empty() local
260 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in gcm_empty()
282 in_sg = nx_build_sg_list(nx_ctx->in_sg, (u8 *) desc->info, in gcm_empty()
283 &len, nx_ctx->ap->sglen); in gcm_empty()
289 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *) out, &len, in gcm_empty()
290 nx_ctx->ap->sglen); in gcm_empty()
295 nx_ctx->op.inlen = (nx_ctx->in_sg - in_sg) * sizeof(struct nx_sg); in gcm_empty()
296 nx_ctx->op.outlen = (nx_ctx->out_sg - out_sg) * sizeof(struct nx_sg); in gcm_empty()
298 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op, in gcm_empty()
302 atomic_inc(&(nx_ctx->stats->aes_ops)); in gcm_empty()
323 struct nx_crypto_ctx *nx_ctx = in gcm_aes_nx_crypt() local
326 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in gcm_aes_nx_crypt()
333 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in gcm_aes_nx_crypt()
353 rc = nx_gca(nx_ctx, req, csbcpb->cpb.aes_gcm.in_pat_or_aad, in gcm_aes_nx_crypt()
372 rc = nx_build_sg_lists(nx_ctx, &desc, req->dst, in gcm_aes_nx_crypt()
386 rc = nx_hcall_sync(nx_ctx, &nx_ctx->op, in gcm_aes_nx_crypt()
399 atomic_inc(&(nx_ctx->stats->aes_ops)); in gcm_aes_nx_crypt()
401 &(nx_ctx->stats->aes_bytes)); in gcm_aes_nx_crypt()
415 u8 *itag = nx_ctx->priv.gcm.iauth_tag; in gcm_aes_nx_crypt()
427 spin_unlock_irqrestore(&nx_ctx->lock, irq_flags); in gcm_aes_nx_crypt()
453 struct nx_crypto_ctx *nx_ctx = in gcm4106_aes_nx_encrypt() local
457 char *nonce = nx_ctx->priv.gcm.nonce; in gcm4106_aes_nx_encrypt()
470 struct nx_crypto_ctx *nx_ctx = in gcm4106_aes_nx_decrypt() local
474 char *nonce = nx_ctx->priv.gcm.nonce; in gcm4106_aes_nx_decrypt()