DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1 1/3] cryptodev: add EDDSA asymmetric crypto algorithm
@ 2023-11-29 16:10 Gowrishankar Muthukrishnan
  2023-11-29 16:10 ` [PATCH v1 2/3] crypto/openssl: add EDDSA support Gowrishankar Muthukrishnan
                   ` (3 more replies)
  0 siblings, 4 replies; 47+ messages in thread
From: Gowrishankar Muthukrishnan @ 2023-11-29 16:10 UTC (permalink / raw)
  To: dev; +Cc: anoobj, Akhil Goyal, Fan Zhang, Kai Ji, Gowrishankar Muthukrishnan

Add support for asymmetric EDDSA in cryptodev, as referenced in RFC:
https://datatracker.ietf.org/doc/html/rfc8032

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 doc/guides/cryptodevs/features/default.ini |  1 +
 doc/guides/prog_guide/cryptodev_lib.rst    |  2 +-
 lib/cryptodev/rte_crypto_asym.h            | 51 +++++++++++++++++++++-
 3 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini
index f411d4bab7..3073753911 100644
--- a/doc/guides/cryptodevs/features/default.ini
+++ b/doc/guides/cryptodevs/features/default.ini
@@ -130,6 +130,7 @@ ECDSA                   =
 ECPM                    =
 ECDH                    =
 SM2                     =
+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..dd636ba5ef 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 EdDSA 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 39d3da3952..7813d28b7a 100644
--- a/lib/cryptodev/rte_crypto_asym.h
+++ b/lib/cryptodev/rte_crypto_asym.h
@@ -65,9 +65,22 @@ enum rte_crypto_curve_id {
 	RTE_CRYPTO_EC_GROUP_SECP256R1 = 23,
 	RTE_CRYPTO_EC_GROUP_SECP384R1 = 24,
 	RTE_CRYPTO_EC_GROUP_SECP521R1 = 25,
+	RTE_CRYPTO_EC_GROUP_ED25519   = 29,
+	RTE_CRYPTO_EC_GROUP_ED448     = 30,
 	RTE_CRYPTO_EC_GROUP_SM2       = 41,
 };
 
+/**
+ * List of Edwards curve instances as per RFC 8032 (Section 5).
+ */
+enum rte_crypto_edward_instance {
+	RTE_CRYPTO_EDCURVE_25519,
+	RTE_CRYPTO_EDCURVE_25519CTX,
+	RTE_CRYPTO_EDCURVE_25519PH,
+	RTE_CRYPTO_EDCURVE_448,
+	RTE_CRYPTO_EDCURVE_448PH
+};
+
 /**
  * Asymmetric crypto transformation types.
  * Each xform type maps to one asymmetric algorithm
@@ -108,6 +121,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,
@@ -376,7 +393,13 @@ struct rte_crypto_ec_xform {
 	rte_crypto_uint pkey;
 	/**< Private key */
 
-	struct rte_crypto_ec_point q;
+	union {
+		struct rte_crypto_ec_point q;
+		/**< Elliptic curve point */
+
+		rte_crypto_uint qcomp;
+		/**< Elliptic curve point compressed */
+	};
 	/**< Public key */
 };
 
@@ -585,6 +608,31 @@ 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_param message;
+	/**< Input message digest to be signed or verified */
+
+	rte_crypto_param context;
+	/**< Context value for the sign op.
+	 *   Must not be empty for Ed25519ctx instance.
+	 */
+
+	enum rte_crypto_edward_instance instance;
+	/**< Type of Edwards curve. */
+
+	rte_crypto_uint sign;
+	/**< Edward curve signature
+	 *     output : for signature generation
+	 *     input  : for signature verification
+	 */
+};
+
 /**
  * Structure for EC point multiplication operation param
  */
@@ -718,6 +766,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;
 		struct rte_crypto_sm2_op_param sm2;
 	};
-- 
2.25.1


^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2024-10-09 19:44 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-29 16:10 [PATCH v1 1/3] cryptodev: add EDDSA asymmetric crypto algorithm Gowrishankar Muthukrishnan
2023-11-29 16:10 ` [PATCH v1 2/3] crypto/openssl: add EDDSA support Gowrishankar Muthukrishnan
2023-11-29 16:10 ` [PATCH v1 3/3] test/crypto: add asymmetric EDDSA test cases Gowrishankar Muthukrishnan
2024-09-05 13:36 ` [PATCH v2 1/6] cryptodev: add EDDSA asymmetric crypto algorithm Gowrishankar Muthukrishnan
2024-09-05 13:39 ` Gowrishankar Muthukrishnan
2024-09-05 13:39   ` [PATCH v2 2/6] crypto/openssl: support EDDSA Gowrishankar Muthukrishnan
2024-09-09  9:56     ` Jack Bond-Preston
2024-09-05 13:39   ` [PATCH v2 3/6] crypto/cnxk: " Gowrishankar Muthukrishnan
2024-09-20 13:09     ` [PATCH v3 1/6] cryptodev: add EDDSA asymmetric crypto algorithm Gowrishankar Muthukrishnan
2024-09-20 13:09       ` [PATCH v3 2/6] crypto/openssl: support EDDSA Gowrishankar Muthukrishnan
2024-09-20 14:36         ` Akhil Goyal
2024-09-20 13:09       ` [PATCH v3 3/6] crypto/cnxk: " Gowrishankar Muthukrishnan
2024-09-20 13:09       ` [PATCH v3 4/6] test/crypto: add asymmetric EDDSA test cases Gowrishankar Muthukrishnan
2024-09-20 13:09       ` [PATCH v3 5/6] examples/fips_validation: support EDDSA Gowrishankar Muthukrishnan
2024-09-20 13:09       ` [PATCH v3 6/6] app/crypto-perf: " Gowrishankar Muthukrishnan
2024-10-03  6:42         ` Akhil Goyal
2024-10-03 17:56       ` [PATCH v4 1/6] cryptodev: add EDDSA asymmetric crypto algorithm Gowrishankar Muthukrishnan
2024-10-03 17:56         ` [PATCH v4 2/6] crypto/openssl: support EDDSA Gowrishankar Muthukrishnan
2024-10-03 17:56         ` [PATCH v4 3/6] crypto/cnxk: " Gowrishankar Muthukrishnan
2024-10-03 17:56         ` [PATCH v4 4/6] test/crypto: add asymmetric EDDSA test cases Gowrishankar Muthukrishnan
2024-10-03 17:56         ` [PATCH v4 5/6] examples/fips_validation: support EDDSA Gowrishankar Muthukrishnan
2024-10-03 17:56         ` [PATCH v4 6/6] app/crypto-perf: " Gowrishankar Muthukrishnan
2024-10-04  5:30         ` [PATCH v5 1/6] cryptodev: add EDDSA asymmetric crypto algorithm Gowrishankar Muthukrishnan
2024-10-04  5:30           ` [PATCH v5 2/6] crypto/openssl: support EDDSA Gowrishankar Muthukrishnan
2024-10-04  5:30           ` [PATCH v5 3/6] crypto/cnxk: " Gowrishankar Muthukrishnan
2024-10-04  5:30           ` [PATCH v5 4/6] test/crypto: add asymmetric EDDSA test cases Gowrishankar Muthukrishnan
2024-10-04  5:30           ` [PATCH v5 5/6] examples/fips_validation: support EDDSA Gowrishankar Muthukrishnan
2024-10-04  5:30           ` [PATCH v5 6/6] app/crypto-perf: " Gowrishankar Muthukrishnan
2024-10-04  8:26           ` [PATCH v6 1/6] cryptodev: add EDDSA asymmetric crypto algorithm Gowrishankar Muthukrishnan
2024-10-04  8:26             ` [PATCH v6 2/6] crypto/openssl: support EDDSA Gowrishankar Muthukrishnan
2024-10-07  9:50               ` Ji, Kai
2024-10-07 16:27               ` Kusztal, ArkadiuszX
2024-10-04  8:26             ` [PATCH v6 3/6] crypto/cnxk: " Gowrishankar Muthukrishnan
2024-10-04  8:26             ` [PATCH v6 4/6] test/crypto: add asymmetric EDDSA test cases Gowrishankar Muthukrishnan
2024-10-04  8:26             ` [PATCH v6 5/6] examples/fips_validation: support EDDSA Gowrishankar Muthukrishnan
2024-10-04 16:19               ` Dooley, Brian
2024-10-04  8:26             ` [PATCH v6 6/6] app/crypto-perf: " Gowrishankar Muthukrishnan
2024-10-04 16:20               ` Dooley, Brian
2024-10-07 16:03             ` [PATCH v6 1/6] cryptodev: add EDDSA asymmetric crypto algorithm Kusztal, ArkadiuszX
2024-10-08  7:40               ` Kusztal, ArkadiuszX
2024-10-08  9:31                 ` Gowrishankar Muthukrishnan
2024-10-08 11:37                   ` Kusztal, ArkadiuszX
2024-10-09  3:43                     ` Gowrishankar Muthukrishnan
2024-10-09 19:43                     ` Akhil Goyal
2024-09-05 13:39   ` [PATCH v2 4/6] test/crypto: add asymmetric EDDSA test cases Gowrishankar Muthukrishnan
2024-09-05 13:39   ` [PATCH v2 5/6] examples/fips_validation: support EDDSA Gowrishankar Muthukrishnan
2024-09-05 13:39   ` [PATCH v2 6/6] app/crypto-perf: " Gowrishankar Muthukrishnan

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).