/Linux-v4.19/drivers/crypto/nx/ |
D | nx-aes-xcbc.c | 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() [all …]
|
D | nx-aes-ccm.c | 39 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&tfm->base); in ccm_aes_nx_set_key() local 40 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in ccm_aes_nx_set_key() 41 struct nx_csbcpb *csbcpb_aead = nx_ctx->csbcpb_aead; in ccm_aes_nx_set_key() 43 nx_ctx_init(nx_ctx, HCOP_FC_AES); in ccm_aes_nx_set_key() 49 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in ccm_aes_nx_set_key() 69 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&tfm->base); in ccm4309_aes_nx_set_key() local 76 memcpy(nx_ctx->priv.ccm.nonce, in_key + key_len, 3); in ccm4309_aes_nx_set_key() 170 struct nx_crypto_ctx *nx_ctx, in generate_pat() argument 176 struct nx_sg *nx_insg = nx_ctx->in_sg; in generate_pat() 177 struct nx_sg *nx_outsg = nx_ctx->out_sg; in generate_pat() [all …]
|
D | nx-aes-gcm.c | 39 struct nx_crypto_ctx *nx_ctx = crypto_aead_ctx(tfm); in gcm_aes_nx_set_key() local 40 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in gcm_aes_nx_set_key() 41 struct nx_csbcpb *csbcpb_aead = nx_ctx->csbcpb_aead; in gcm_aes_nx_set_key() 43 nx_ctx_init(nx_ctx, HCOP_FC_AES); in gcm_aes_nx_set_key() 49 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in gcm_aes_nx_set_key() 54 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_192]; in gcm_aes_nx_set_key() 59 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_256]; in gcm_aes_nx_set_key() 78 struct nx_crypto_ctx *nx_ctx = crypto_aead_ctx(tfm); in gcm4106_aes_nx_set_key() local 79 char *nonce = nx_ctx->priv.gcm.nonce; in gcm4106_aes_nx_set_key() 111 static int nx_gca(struct nx_crypto_ctx *nx_ctx, in nx_gca() argument [all …]
|
D | nx-sha512.c | 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() [all …]
|
D | nx-sha256.c | 34 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in nx_crypto_ctx_sha256_init() local 41 nx_ctx_init(nx_ctx, HCOP_FC_SHA); in nx_crypto_ctx_sha256_init() 43 nx_ctx->ap = &nx_ctx->props[NX_PROPS_SHA256]; in nx_crypto_ctx_sha256_init() 45 NX_CPB_SET_DIGEST_SIZE(nx_ctx->csbcpb, NX_DS_SHA256); in nx_crypto_ctx_sha256_init() 72 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_sha256_update() local 73 struct nx_csbcpb *csbcpb = (struct nx_csbcpb *)nx_ctx->csbcpb; in nx_sha256_update() 82 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in nx_sha256_update() 99 max_sg_len = min_t(u64, nx_ctx->ap->sglen, in nx_sha256_update() 102 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_sha256_update() 105 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *)sctx->state, in nx_sha256_update() [all …]
|
D | nx-aes-ctr.c | 38 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in ctr_aes_nx_set_key() local 39 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in ctr_aes_nx_set_key() 41 nx_ctx_init(nx_ctx, HCOP_FC_AES); in ctr_aes_nx_set_key() 46 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in ctr_aes_nx_set_key() 50 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_192]; in ctr_aes_nx_set_key() 54 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_256]; in ctr_aes_nx_set_key() 70 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in ctr3686_aes_nx_set_key() local 75 memcpy(nx_ctx->priv.ctr.nonce, in ctr3686_aes_nx_set_key() 89 struct nx_crypto_ctx *nx_ctx = crypto_blkcipher_ctx(desc->tfm); in ctr_aes_nx_crypt() local 90 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in ctr_aes_nx_crypt() [all …]
|
D | nx-aes-ecb.c | 37 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in ecb_aes_nx_set_key() local 38 struct nx_csbcpb *csbcpb = (struct nx_csbcpb *)nx_ctx->csbcpb; in ecb_aes_nx_set_key() 40 nx_ctx_init(nx_ctx, HCOP_FC_AES); in ecb_aes_nx_set_key() 45 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in ecb_aes_nx_set_key() 49 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_192]; in ecb_aes_nx_set_key() 53 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_256]; in ecb_aes_nx_set_key() 71 struct nx_crypto_ctx *nx_ctx = crypto_blkcipher_ctx(desc->tfm); in ecb_aes_nx_crypt() local 72 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in ecb_aes_nx_crypt() 77 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in ecb_aes_nx_crypt() 87 rc = nx_build_sg_lists(nx_ctx, desc, dst, src, &to_process, in ecb_aes_nx_crypt() [all …]
|
D | nx-aes-cbc.c | 37 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in cbc_aes_nx_set_key() local 38 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in cbc_aes_nx_set_key() 40 nx_ctx_init(nx_ctx, HCOP_FC_AES); in cbc_aes_nx_set_key() 45 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_128]; in cbc_aes_nx_set_key() 49 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_192]; in cbc_aes_nx_set_key() 53 nx_ctx->ap = &nx_ctx->props[NX_PROPS_AES_256]; in cbc_aes_nx_set_key() 71 struct nx_crypto_ctx *nx_ctx = crypto_blkcipher_ctx(desc->tfm); in cbc_aes_nx_crypt() local 72 struct nx_csbcpb *csbcpb = nx_ctx->csbcpb; in cbc_aes_nx_crypt() 77 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in cbc_aes_nx_crypt() 87 rc = nx_build_sg_lists(nx_ctx, desc, dst, src, &to_process, in cbc_aes_nx_crypt() [all …]
|
D | nx.c | 52 int nx_hcall_sync(struct nx_crypto_ctx *nx_ctx, in nx_hcall_sync() argument 59 atomic_inc(&(nx_ctx->stats->sync_ops)); in nx_hcall_sync() 68 atomic_inc(&(nx_ctx->stats->errors)); in nx_hcall_sync() 69 atomic_set(&(nx_ctx->stats->last_error), op->hcall_err); in nx_hcall_sync() 70 atomic_set(&(nx_ctx->stats->last_error_pid), current->pid); in nx_hcall_sync() 270 int nx_build_sg_lists(struct nx_crypto_ctx *nx_ctx, in nx_build_sg_lists() argument 280 struct nx_sg *nx_insg = nx_ctx->in_sg; in nx_build_sg_lists() 281 struct nx_sg *nx_outsg = nx_ctx->out_sg; in nx_build_sg_lists() 284 max_sg_len = min_t(u64, nx_ctx->ap->sglen, in nx_build_sg_lists() 287 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_build_sg_lists() [all …]
|
D | nx.h | 165 void nx_ctx_init(struct nx_crypto_ctx *nx_ctx, unsigned int function);
|