From: Sachin Yaligar <syaligar@marvell.com>
To: <dev@dpdk.org>
Cc: <jerinj@marvell.com>, <pathreya@marvell.com>,
<ukartha@marvell.com>, <anoobj@marvell.com>, <gakhil@marvell.com>,
Sachin Yaligar <syaligar@marvell.com>
Subject: [PATCH v1 1/1] cryptodev: support EDDSA
Date: Tue, 28 Mar 2023 10:20:52 +0000 [thread overview]
Message-ID: <20230328102052.30465-1-syaligar@marvell.com> (raw)
Asymmetric crypto library is extended to add EDDSA. Edwards curve
operation params are introduced.
Signed-off-by: Sachin Yaligar <syaligar@marvell.com>
Change-Id: I939d7646f95723113fa9f3bdbc01c0aeb4620e74
---
.mailmap | 1 +
doc/guides/cryptodevs/features/default.ini | 1 +
doc/guides/prog_guide/cryptodev_lib.rst | 2 +-
lib/cryptodev/rte_crypto_asym.h | 39 +++++++++++++++++++++-
4 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/.mailmap b/.mailmap
index cac02a6f48..6d92b56560 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1169,6 +1169,7 @@ Rushil Gupta <rushilg@google.com>
Ryan E Hall <ryan.e.hall@intel.com>
Sabyasachi Sengupta <sabyasg@hpe.com>
Sachin Saxena <sachin.saxena@nxp.com> <sachin.saxena@oss.nxp.com>
+Sachin Yaligar <syaligar@marvell.com>
Sagar Abhang <sabhang@brocade.com>
Sagi Grimberg <sagi@grimberg.me>
Saikrishna Edupuganti <saikrishna.edupuganti@intel.com>
diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini
index 523da0cfa8..247a56be6e 100644
--- a/doc/guides/cryptodevs/features/default.ini
+++ b/doc/guides/cryptodevs/features/default.ini
@@ -125,6 +125,7 @@ Diffie-hellman =
ECDSA =
ECPM =
ECDH =
+EDDSA =
;
; Supported Operating systems of a default crypto driver.
diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 2b513bbf82..358dbbc768 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -927,7 +927,7 @@ Asymmetric Cryptography
The cryptodev library currently provides support for the following asymmetric
Crypto operations; RSA, Modular exponentiation and inversion, Diffie-Hellman and
Elliptic Curve Diffie-Hellman public and/or private key generation and shared
-secret compute, DSA Signature generation and verification.
+secret compute, DSA and Edward's curve DSA Signature generation and verification.
Session and Session Management
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h
index 989f38323f..fc7172b070 100644
--- a/lib/cryptodev/rte_crypto_asym.h
+++ b/lib/cryptodev/rte_crypto_asym.h
@@ -69,7 +69,9 @@ enum rte_crypto_curve_id {
RTE_CRYPTO_EC_GROUP_SECP224R1 = 21,
RTE_CRYPTO_EC_GROUP_SECP256R1 = 23,
RTE_CRYPTO_EC_GROUP_SECP384R1 = 24,
- RTE_CRYPTO_EC_GROUP_SECP521R1 = 25
+ RTE_CRYPTO_EC_GROUP_SECP521R1 = 25,
+ RTE_CRYPTO_EC_GROUP_ED25519 = 29,
+ RTE_CRYPTO_EC_GROUP_ED448 = 30
};
/**
@@ -113,6 +115,10 @@ enum rte_crypto_asym_xform_type {
/**< Elliptic Curve Digital Signature Algorithm
* Perform Signature Generation and Verification.
*/
+ RTE_CRYPTO_ASYM_XFORM_EDDSA,
+ /**< Edwards Curve Digital Signature Algorithm
+ * Perform Signature Generation and Verification.
+ */
RTE_CRYPTO_ASYM_XFORM_ECDH,
/**< Elliptic Curve Diffie Hellman */
RTE_CRYPTO_ASYM_XFORM_ECPM,
@@ -591,6 +597,36 @@ struct rte_crypto_ecdsa_op_param {
*/
};
+/**
+ * EDDSA operation params
+ */
+struct rte_crypto_eddsa_op_param {
+ enum rte_crypto_asym_op_type op_type;
+ /**< Signature generation or verification */
+
+ rte_crypto_uint pkey;
+ /**< Private key of the signer for signature generation */
+
+ struct rte_crypto_ec_point q;
+ /**< Public key of the signer derived from private key
+ * h = hash(pkey), q = (h[0-31] * B)
+ */
+
+ rte_crypto_param message;
+ /**< Input message digest to be signed or verified */
+
+ rte_crypto_uint r;
+ /**< r component of edward curve signature
+ * output : for signature generation
+ * input : for signature verification
+ */
+ rte_crypto_uint s;
+ /**< s component of edward curve signature
+ * output : for signature generation
+ * input : for signature verification
+ */
+};
+
/**
* Structure for EC point multiplication operation param
*/
@@ -664,6 +700,7 @@ struct rte_crypto_asym_op {
struct rte_crypto_ecdh_op_param ecdh;
struct rte_crypto_dsa_op_param dsa;
struct rte_crypto_ecdsa_op_param ecdsa;
+ struct rte_crypto_eddsa_op_param eddsa;
struct rte_crypto_ecpm_op_param ecpm;
};
uint16_t flags;
--
2.40.0
next reply other threads:[~2023-03-28 10:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-28 10:20 Sachin Yaligar [this message]
2023-05-16 11:08 ` 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=20230328102052.30465-1-syaligar@marvell.com \
--to=syaligar@marvell.com \
--cc=anoobj@marvell.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=jerinj@marvell.com \
--cc=pathreya@marvell.com \
--cc=ukartha@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).