/drivers/crypto/nx/ |
D | nx-aes-xcbc.c | 32 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 …]
|
D | nx-aes-ccm.c | 27 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() 155 struct nx_crypto_ctx *nx_ctx, in generate_pat() argument 161 struct nx_sg *nx_insg = nx_ctx->in_sg; in generate_pat() 162 struct nx_sg *nx_outsg = nx_ctx->out_sg; in generate_pat() [all …]
|
D | nx-aes-gcm.c | 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 [all …]
|
D | nx-sha256.c | 27 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in nx_crypto_ctx_sha256_init() local 34 nx_ctx_init(nx_ctx, HCOP_FC_SHA); in nx_crypto_ctx_sha256_init() 36 nx_ctx->ap = &nx_ctx->props[NX_PROPS_SHA256]; in nx_crypto_ctx_sha256_init() 38 NX_CPB_SET_DIGEST_SIZE(nx_ctx->csbcpb, NX_DS_SHA256); in nx_crypto_ctx_sha256_init() 65 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_sha256_update() local 66 struct nx_csbcpb *csbcpb = (struct nx_csbcpb *)nx_ctx->csbcpb; in nx_sha256_update() 75 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in nx_sha256_update() 92 max_sg_len = min_t(u64, nx_ctx->ap->sglen, in nx_sha256_update() 95 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_sha256_update() 98 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *)sctx->state, in nx_sha256_update() [all …]
|
D | nx-sha512.c | 26 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(tfm); in nx_crypto_ctx_sha512_init() local 33 nx_ctx_init(nx_ctx, HCOP_FC_SHA); in nx_crypto_ctx_sha512_init() 35 nx_ctx->ap = &nx_ctx->props[NX_PROPS_SHA512]; in nx_crypto_ctx_sha512_init() 37 NX_CPB_SET_DIGEST_SIZE(nx_ctx->csbcpb, NX_DS_SHA512); in nx_crypto_ctx_sha512_init() 65 struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(&desc->tfm->base); in nx_sha512_update() local 66 struct nx_csbcpb *csbcpb = (struct nx_csbcpb *)nx_ctx->csbcpb; in nx_sha512_update() 75 spin_lock_irqsave(&nx_ctx->lock, irq_flags); in nx_sha512_update() 92 max_sg_len = min_t(u64, nx_ctx->ap->sglen, in nx_sha512_update() 95 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_sha512_update() 98 out_sg = nx_build_sg_list(nx_ctx->out_sg, (u8 *)sctx->state, in nx_sha512_update() [all …]
|
D | nx-aes-ctr.c | 26 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 …]
|
D | nx-aes-ecb.c | 25 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 …]
|
D | nx.c | 40 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() 259 int nx_build_sg_lists(struct nx_crypto_ctx *nx_ctx, in nx_build_sg_lists() argument 269 struct nx_sg *nx_insg = nx_ctx->in_sg; in nx_build_sg_lists() 270 struct nx_sg *nx_outsg = nx_ctx->out_sg; in nx_build_sg_lists() 273 max_sg_len = min_t(u64, nx_ctx->ap->sglen, in nx_build_sg_lists() 276 nx_ctx->ap->databytelen/NX_PAGE_SIZE); in nx_build_sg_lists() [all …]
|
D | nx-aes-cbc.c | 25 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 …]
|
D | nx.h | 155 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,
|