Home
last modified time | relevance | path

Searched refs:nx_ctx (Results 1 – 10 of 10) sorted by relevance

/kernel/linux/linux-5.10/drivers/crypto/nx/
Dnx-aes-xcbc.c32 struct nx_crypto_ctx *nx_ctx = crypto_shash_ctx(desc); in nx_xcbc_set_key() local
33 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in nx_xcbc_set_key()
37 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in nx_xcbc_set_key()
61 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_xcbc_empty() local
62 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in nx_xcbc_empty()
81 in_sg = nx_build_sg_list(nx_ctx->in_sg, (u8 *) keys, &len, in nx_xcbc_empty()
82 nx_ctx->ap->sglen); in nx_xcbc_empty()
87 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *) keys, &len, in nx_xcbc_empty()
88 nx_ctx->ap->sglen); in nx_xcbc_empty()
93 nx_ctx->op.inlen = (nx_ctx->in_sg - in_sg) * sizeof(struct nx_sg); in nx_xcbc_empty()
[all …]
Dnx-aes-ccm.c27 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&tfm->base); in ccm_aes_nx_set_key() local
28 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in ccm_aes_nx_set_key()
29 struct nx_csbcpb *csbcpb_aead = nx_ctx->csbcpb_aead; in ccm_aes_nx_set_key()
31 nx_ctx_init(nx_ctx, HCOP_FC_AES); in ccm_aes_nx_set_key()
37 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in ccm_aes_nx_set_key()
57 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&tfm->base); in ccm4309_aes_nx_set_key() local
64 memcpy(nx_ctx->priv.ccm.nonce, in_key + key_len, 3); in ccm4309_aes_nx_set_key()
158 struct nx_crypto_ctx *nx_ctx, in generate_pat() argument
164 struct nx_sg *nx_insg = nx_ctx->in_sg; in generate_pat()
165 struct nx_sg *nx_outsg = nx_ctx->out_sg; in generate_pat()
[all …]
Dnx-aes-gcm.c27 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
[all …]
Dnx-sha512.c21 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in nx_crypto_ctx_sha512_init() local
28 nx_ctx_init(nx_ctx, HCOP_FC_SHA); in nx_crypto_ctx_sha512_init()
30 nx_ctx->ap = &nx_ctx->props[NX_PROPS_SHA512]; in nx_crypto_ctx_sha512_init()
32 NX_CPB_SET_DIGEST_SIZE(nx_ctx->csbcpb, NX_DS_SHA512); in nx_crypto_ctx_sha512_init()
60 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_sha512_update() local
61 struct nx_csbcpb *csbcpb = (struct nx_csbcpb *)nx_ctx->csbcpb; in nx_sha512_update()
70 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in nx_sha512_update()
87 max_sg_len = min_t(u64, nx_ctx->ap->sglen, in nx_sha512_update()
90 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_sha512_update()
93 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *)sctx->state, in nx_sha512_update()
[all …]
Dnx-sha256.c22 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in nx_crypto_ctx_sha256_init() local
29 nx_ctx_init(nx_ctx, HCOP_FC_SHA); in nx_crypto_ctx_sha256_init()
31 nx_ctx->ap = &nx_ctx->props[NX_PROPS_SHA256]; in nx_crypto_ctx_sha256_init()
33 NX_CPB_SET_DIGEST_SIZE(nx_ctx->csbcpb, NX_DS_SHA256); in nx_crypto_ctx_sha256_init()
60 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_sha256_update() local
61 struct nx_csbcpb *csbcpb = (struct nx_csbcpb *)nx_ctx->csbcpb; in nx_sha256_update()
70 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in nx_sha256_update()
87 max_sg_len = min_t(u64, nx_ctx->ap->sglen, in nx_sha256_update()
90 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_sha256_update()
93 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *)sctx->state, in nx_sha256_update()
[all …]
Dnx-aes-ctr.c26 struct nx_crypto_ctx *nx_ctx = crypto_skcipher_ctx(tfm); in ctr_aes_nx_set_key() local
27 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in ctr_aes_nx_set_key()
29 nx_ctx_init(nx_ctx, HCOP_FC_AES); in ctr_aes_nx_set_key()
34 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in ctr_aes_nx_set_key()
38 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_192]; in ctr_aes_nx_set_key()
42 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_256]; in ctr_aes_nx_set_key()
58 struct nx_crypto_ctx *nx_ctx = crypto_skcipher_ctx(tfm); in ctr3686_aes_nx_set_key() local
63 memcpy(nx_ctx->priv.ctr.nonce, in ctr3686_aes_nx_set_key()
75 struct nx_crypto_ctx *nx_ctx = crypto_skcipher_ctx(tfm); in ctr_aes_nx_crypt() local
76 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in ctr_aes_nx_crypt()
[all …]
Dnx-aes-ecb.c25 struct nx_crypto_ctx *nx_ctx = crypto_skcipher_ctx(tfm); in ecb_aes_nx_set_key() local
26 struct nx_csbcpb *csbcpb = (struct nx_csbcpb *)nx_ctx->csbcpb; in ecb_aes_nx_set_key()
28 nx_ctx_init(nx_ctx, HCOP_FC_AES); in ecb_aes_nx_set_key()
33 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in ecb_aes_nx_set_key()
37 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_192]; in ecb_aes_nx_set_key()
41 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_256]; in ecb_aes_nx_set_key()
57 struct nx_crypto_ctx *nx_ctx = crypto_skcipher_ctx(tfm); in ecb_aes_nx_crypt() local
58 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in ecb_aes_nx_crypt()
63 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in ecb_aes_nx_crypt()
73 rc = nx_build_sg_lists(nx_ctx, NULL, req->dst, req->src, in ecb_aes_nx_crypt()
[all …]
Dnx-aes-cbc.c25 struct nx_crypto_ctx *nx_ctx = crypto_skcipher_ctx(tfm); in cbc_aes_nx_set_key() local
26 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in cbc_aes_nx_set_key()
28 nx_ctx_init(nx_ctx, HCOP_FC_AES); in cbc_aes_nx_set_key()
33 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in cbc_aes_nx_set_key()
37 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_192]; in cbc_aes_nx_set_key()
41 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_256]; in cbc_aes_nx_set_key()
57 struct nx_crypto_ctx *nx_ctx = crypto_skcipher_ctx(tfm); in cbc_aes_nx_crypt() local
58 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in cbc_aes_nx_crypt()
63 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in cbc_aes_nx_crypt()
73 rc = nx_build_sg_lists(nx_ctx, req->iv, req->dst, req->src, in cbc_aes_nx_crypt()
[all …]
Dnx.c40 int nx_hcall_sync(struct nx_crypto_ctx *nx_ctx, in nx_hcall_sync() argument
47 atomic_inc(&(nx_ctx->stats->sync_ops)); in nx_hcall_sync()
56 atomic_inc(&(nx_ctx->stats->errors)); in nx_hcall_sync()
57 atomic_set(&(nx_ctx->stats->last_error), op->hcall_err); in nx_hcall_sync()
58 atomic_set(&(nx_ctx->stats->last_error_pid), current->pid); in nx_hcall_sync()
258 int nx_build_sg_lists(struct nx_crypto_ctx *nx_ctx, in nx_build_sg_lists() argument
268 struct nx_sg *nx_insg = nx_ctx->in_sg; in nx_build_sg_lists()
269 struct nx_sg *nx_outsg = nx_ctx->out_sg; in nx_build_sg_lists()
272 max_sg_len = min_t(u64, nx_ctx->ap->sglen, in nx_build_sg_lists()
275 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_build_sg_lists()
[all …]
Dnx.h155 void nx_ctx_init(struct nx_crypto_ctx *nx_ctx, unsigned int function);
159 int nx_build_sg_lists(struct nx_crypto_ctx *nx_ctx, const u8 *iv,