DPDK patches and discussions
 help / color / mirror / Atom feed
* [RFC PATCH] cryptodev: add diffie hellman verify, change ec enum
@ 2022-04-07 13:42 Arek Kusztal
  2022-04-07 14:05 ` Kusztal, ArkadiuszX
  0 siblings, 1 reply; 2+ messages in thread
From: Arek Kusztal @ 2022-04-07 13:42 UTC (permalink / raw)
  To: dev; +Cc: gakhil, roy.fan.zhang, Arek Kusztal

This commit:
1) adds Diffie-Hellman verify operation.
2) splits asym_op_type with dh op_type
3) removes next pointer from asym_xform
4) changes enumeration of elliptic curves

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 lib/cryptodev/rte_crypto_asym.h | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h
index cd24d4b07b..6fbc7b7708 100644
--- a/lib/cryptodev/rte_crypto_asym.h
+++ b/lib/cryptodev/rte_crypto_asym.h
@@ -43,11 +43,11 @@ rte_crypto_asym_op_strings[];
  */
 enum rte_crypto_ec_group {
 	RTE_CRYPTO_EC_GROUP_UNKNOWN  = 0,
-	RTE_CRYPTO_EC_GROUP_SECP192R1 = 19,
-	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_SECP192R1 = 1,
+	RTE_CRYPTO_EC_GROUP_SECP224R1 = 2,
+	RTE_CRYPTO_EC_GROUP_SECP256R1 = 3,
+	RTE_CRYPTO_EC_GROUP_SECP384R1 = 4,
+	RTE_CRYPTO_EC_GROUP_SECP521R1 = 5,
 };
 
 /**
@@ -109,13 +109,19 @@ enum rte_crypto_asym_op_type {
 	/**< Signature Generation operation */
 	RTE_CRYPTO_ASYM_OP_VERIFY,
 	/**< Signature Verification operation */
-	RTE_CRYPTO_ASYM_OP_PRIVATE_KEY_GENERATE,
+	RTE_CRYPTO_ASYM_OP_LIST_END
+};
+
+enum rte_crypto_dh_op_type {
+	RTE_CRYPTO_DH_OP_INVALID,
+	RTE_CRYPTO_DH_OP_PRIVATE_KEY_GENERATE,
 	/**< DH Private Key generation operation */
-	RTE_CRYPTO_ASYM_OP_PUBLIC_KEY_GENERATE,
+	RTE_CRYPTO_DH_OP_PUBLIC_KEY_GENERATE,
 	/**< DH Public Key generation operation */
-	RTE_CRYPTO_ASYM_OP_SHARED_SECRET_COMPUTE,
+	RTE_CRYPTO_DH_OP_SHARED_SECRET_COMPUTE,
 	/**< DH Shared Secret compute operation */
-	RTE_CRYPTO_ASYM_OP_LIST_END
+	RTE_CRYPTO_DH_OP_PUBLIC_KEY_VERIFY,
+	/**< DH verify correctness of public key */
 };
 
 /**
@@ -256,7 +262,7 @@ struct rte_crypto_modinv_xform {
  *
  */
 struct rte_crypto_dh_xform {
-	enum rte_crypto_asym_op_type type;
+	enum rte_crypto_dh_op_type type;
 	/**< Setup xform for key generate or shared secret compute */
 	rte_crypto_uint p;
 	/**< Prime modulus data */
@@ -278,13 +284,7 @@ struct rte_crypto_dsa_xform {
 	rte_crypto_uint g;
 	/**< Generator of the subgroup */
 	rte_crypto_uint x;
-	/**< x: Private key of the signer in octet-string network
-	 * byte order format.
-	 * Used when app has pre-defined private key.
-	 * Valid only when xform chain is DSA ONLY.
-	 * if xform chain is DH private key generate + DSA, then DSA sign
-	 * compute will use internally generated key.
-	 */
+	/**< x: Private key */
 };
 
 /**
@@ -504,8 +504,6 @@ struct rte_crypto_ecpm_op_param {
  * Structure describing asym xforms.
  */
 struct rte_crypto_asym_xform {
-	struct rte_crypto_asym_xform *next;
-	/**< Pointer to next xform to set up xform chain.*/
 	enum rte_crypto_asym_xform_type xform_type;
 	/**< Asymmetric crypto transform */
 
-- 
2.13.6


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

end of thread, other threads:[~2022-04-07 14:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 13:42 [RFC PATCH] cryptodev: add diffie hellman verify, change ec enum Arek Kusztal
2022-04-07 14:05 ` Kusztal, ArkadiuszX

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