From: Anoob Joseph <anoobj@marvell.com>
To: Akhil Goyal <akhil.goyal@nxp.com>,
Declan Doherty <declan.doherty@intel.com>,
Pablo de Lara <pablo.de.lara.guarch@intel.com>
Cc: Sunila Sahu <ssahu@marvell.com>,
Fiona Trahe <fiona.trahe@intel.com>,
"Arek Kusztal" <arkadiuszx.kusztal@intel.com>,
Jerin Jacob <jerinj@marvell.com>,
Narayana Prasad <pathreya@marvell.com>,
Shally Verma <shallyv@marvell.com>,
Ankur Dwivedi <adwivedi@marvell.com>, <dev@dpdk.org>,
Anoob Joseph <anoobj@marvell.com>,
Balakrishna Bhamidipati <bbhamidipati@marvell.com>
Subject: [dpdk-dev] [PATCH v2 3/4] crypto/octeontx2: add ECPM support
Date: Wed, 15 Jan 2020 18:26:33 +0530 [thread overview]
Message-ID: <1579092994-15978-4-git-send-email-anoobj@marvell.com> (raw)
In-Reply-To: <1579092994-15978-1-git-send-email-anoobj@marvell.com>
From: Sunila Sahu <ssahu@marvell.com>
Add support asymmetric operation EC Point MUltiplication,
in crypto_octeontx2 PMD.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Balakrishna Bhamidipati <bbhamidipati@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
---
doc/guides/cryptodevs/features/octeontx2.ini | 1 +
.../crypto/octeontx2/otx2_cryptodev_capabilities.c | 10 ++++++++++
drivers/crypto/octeontx2/otx2_cryptodev_ops.c | 22 ++++++++++++++++++++++
3 files changed, 33 insertions(+)
diff --git a/doc/guides/cryptodevs/features/octeontx2.ini b/doc/guides/cryptodevs/features/octeontx2.ini
index dd6369b..4693458 100644
--- a/doc/guides/cryptodevs/features/octeontx2.ini
+++ b/doc/guides/cryptodevs/features/octeontx2.ini
@@ -73,3 +73,4 @@ Modular Exponentiation = Y
Modular Inversion =
Diffie-hellman =
ECDSA = Y
+ECPM = Y
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
index f2079e2..83f885c 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
@@ -639,6 +639,16 @@ rte_cryptodev_capabilities otx2_cpt_capabilities[] = {
},
}
},
+ { /* ECPM */
+ .op = RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
+ {.asym = {
+ .xform_capa = {
+ .xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM,
+ .op_types = 0
+ }
+ },
+ }
+ },
/* End of asymmetric capabilities */
RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
};
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
index 17c755d..ec0e58d 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
@@ -447,6 +447,12 @@ otx2_cpt_enqueue_asym(struct otx2_cpt_qp *qp,
if (unlikely(ret))
goto req_fail;
break;
+ case RTE_CRYPTO_ASYM_XFORM_ECPM:
+ ret = cpt_ecpm_prep(&asym_op->ecpm, ¶ms,
+ sess->ec_ctx.curveid);
+ if (unlikely(ret))
+ goto req_fail;
+ break;
default:
op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
ret = -EINVAL;
@@ -665,6 +671,19 @@ otx2_cpt_asym_dequeue_ecdsa_op(struct rte_crypto_ecdsa_op_param *ecdsa,
ecdsa->s.length = prime_len;
}
+static __rte_always_inline void
+otx2_cpt_asym_dequeue_ecpm_op(struct rte_crypto_ecpm_op_param *ecpm,
+ struct cpt_request_info *req,
+ struct cpt_asym_ec_ctx *ec)
+{
+ int prime_len = ec_grp[ec->curveid].prime.length;
+
+ memcpy(ecpm->r.x.data, req->rptr, prime_len);
+ memcpy(ecpm->r.y.data, req->rptr + ROUNDUP8(prime_len), prime_len);
+ ecpm->r.x.length = prime_len;
+ ecpm->r.y.length = prime_len;
+}
+
static void
otx2_cpt_asym_post_process(struct rte_crypto_op *cop,
struct cpt_request_info *req)
@@ -687,6 +706,9 @@ otx2_cpt_asym_post_process(struct rte_crypto_op *cop,
case RTE_CRYPTO_ASYM_XFORM_ECDSA:
otx2_cpt_asym_dequeue_ecdsa_op(&op->ecdsa, req, &sess->ec_ctx);
break;
+ case RTE_CRYPTO_ASYM_XFORM_ECPM:
+ otx2_cpt_asym_dequeue_ecpm_op(&op->ecpm, req, &sess->ec_ctx);
+ break;
default:
CPT_LOG_DP_DEBUG("Invalid crypto xform type");
cop->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
--
2.7.4
next prev parent reply other threads:[~2020-01-15 12:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-05 15:37 [dpdk-dev] [PATCH 0/4] " Anoob Joseph
2019-12-05 15:37 ` [dpdk-dev] [PATCH 1/4] lib/crypto: add support for EC Point Multiplication Anoob Joseph
2020-01-13 12:43 ` Akhil Goyal
2020-01-14 6:44 ` Anoob Joseph
2019-12-05 15:37 ` [dpdk-dev] [PATCH 2/4] crypto/octeontx: add EC Point Mul support Anoob Joseph
2019-12-05 15:37 ` [dpdk-dev] [PATCH 3/4] crypto/octeontx2: " Anoob Joseph
2019-12-05 15:38 ` [dpdk-dev] [PATCH 4/4] app/test: add EC point multiplication test Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Anoob Joseph
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 1/4] cryptodev: support ECPM Anoob Joseph
2020-01-15 15:49 ` Akhil Goyal
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 2/4] crypto/octeontx: add ECPM support Anoob Joseph
2020-01-15 12:56 ` Anoob Joseph [this message]
2020-01-15 12:56 ` [dpdk-dev] [PATCH v2 4/4] app/test: add ECPM tests Anoob Joseph
2020-01-15 15:49 ` [dpdk-dev] [PATCH v2 0/4] add ECPM support Akhil Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1579092994-15978-4-git-send-email-anoobj@marvell.com \
--to=anoobj@marvell.com \
--cc=adwivedi@marvell.com \
--cc=akhil.goyal@nxp.com \
--cc=arkadiuszx.kusztal@intel.com \
--cc=bbhamidipati@marvell.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=fiona.trahe@intel.com \
--cc=jerinj@marvell.com \
--cc=pablo.de.lara.guarch@intel.com \
--cc=pathreya@marvell.com \
--cc=shallyv@marvell.com \
--cc=ssahu@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).