[v4,01/12] cryptodev: redefine ec group enum

Message ID 20220531040439.15862-2-arkadiuszx.kusztal@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: akhil goyal
Headers
Series cryptodev: rsa, dh, ecdh changes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing warning apply patch failure

Commit Message

Arkadiusz Kusztal May 31, 2022, 4:04 a.m. UTC
  - EC enum was renamed to rte_crypto_curve_id.
Elliptic curve enum name was incorrectly associated
with a group (it comes from the current tls registry name).
- Clarified comments about TLS deprecation.
Some curves included are deprecated with TLS 1.3.
Comments to address it were added.
- Clarified FFDH groups usage.
Elliptic curves IDs in TLS are placed in the same registry
as FFDH. Cryptodev does not assign specific groups, and
if specific groups would be assigned by DPDK, it cannot be
TLS SupportedGroups registry, as it would conflict with
other protocols like IPSec.
- Added IANA reference.
Only few selected curves are included in previously
referenced rfc8422. IANA reference is added instead.
- Removed UNKNOWN ec group.
There is no default value, and there is no UNKNOWN
elliptic curve.

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

Comments

Fan Zhang May 31, 2022, 7:32 a.m. UTC | #1
> -----Original Message-----
> From: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Sent: Tuesday, May 31, 2022 5:04 AM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; Zhang, Roy Fan <roy.fan.zhang@intel.com>; Kusztal,
> ArkadiuszX <arkadiuszx.kusztal@intel.com>
> Subject: [PATCH v4 01/12] cryptodev: redefine ec group enum
> 
> - EC enum was renamed to rte_crypto_curve_id.
> Elliptic curve enum name was incorrectly associated
> with a group (it comes from the current tls registry name).
> - Clarified comments about TLS deprecation.
> Some curves included are deprecated with TLS 1.3.
> Comments to address it were added.
> - Clarified FFDH groups usage.
> Elliptic curves IDs in TLS are placed in the same registry
> as FFDH. Cryptodev does not assign specific groups, and
> if specific groups would be assigned by DPDK, it cannot be
> TLS SupportedGroups registry, as it would conflict with
> other protocols like IPSec.
> - Added IANA reference.
> Only few selected curves are included in previously
> referenced rfc8422. IANA reference is added instead.
> - Removed UNKNOWN ec group.
> There is no default value, and there is no UNKNOWN
> elliptic curve.
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
  
Akhil Goyal May 31, 2022, 12:29 p.m. UTC | #2
> - EC enum was renamed to rte_crypto_curve_id.
> Elliptic curve enum name was incorrectly associated
> with a group (it comes from the current tls registry name).
> - Clarified comments about TLS deprecation.
> Some curves included are deprecated with TLS 1.3.
> Comments to address it were added.
> - Clarified FFDH groups usage.
> Elliptic curves IDs in TLS are placed in the same registry
> as FFDH. Cryptodev does not assign specific groups, and
> if specific groups would be assigned by DPDK, it cannot be
> TLS SupportedGroups registry, as it would conflict with
> other protocols like IPSec.
> - Added IANA reference.
> Only few selected curves are included in previously
> referenced rfc8422. IANA reference is added instead.
> - Removed UNKNOWN ec group.
> There is no default value, and there is no UNKNOWN
> elliptic curve.
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
The Patch do not apply cleanly. Please fix.
  

Patch

diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h
index cd24d4b07b..87df9b2ce3 100644
--- a/lib/cryptodev/rte_crypto_asym.h
+++ b/lib/cryptodev/rte_crypto_asym.h
@@ -38,16 +38,20 @@  extern const char *
 rte_crypto_asym_op_strings[];
 
 /**
- * TLS named curves
- * https://tools.ietf.org/html/rfc8422
+ * List of elliptic curves. This enum aligns with
+ * TLS "Supported Groups" registry (previously known  as
+ * NamedCurve registry). FFDH groups are not, and will not
+ * be included in this list.
+ * Deprecation a for selected curve in TLS does not deprecate
+ * the selected curve in Cryptodev.
+ * https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml
  */
-enum rte_crypto_ec_group {
-	RTE_CRYPTO_EC_GROUP_UNKNOWN  = 0,
+enum rte_crypto_curve_id {
 	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_SECP521R1 = 25
 };
 
 /**
@@ -294,7 +298,7 @@  struct rte_crypto_dsa_xform {
  *
  */
 struct rte_crypto_ec_xform {
-	enum rte_crypto_ec_group curve_id;
+	enum rte_crypto_curve_id curve_id;
 	/**< Pre-defined ec groups */
 };