]> git.droids-corp.org - dpdk.git/commitdiff
cryptodev: redefine elliptic curve group enum
authorArek Kusztal <arkadiuszx.kusztal@intel.com>
Wed, 1 Jun 2022 09:02:38 +0000 (10:02 +0100)
committerAkhil Goyal <gakhil@marvell.com>
Wed, 1 Jun 2022 16:53:31 +0000 (18:53 +0200)
- 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>
Acked-by: Akhil Goyal <gakhil@marvell.com>
lib/cryptodev/rte_crypto_asym.h

index cd24d4b07bdc4923f09136e90f4fdc73c2e863fd..62e0b8bacaf3c3da09ee4d68aa8f96ae715753dd 100644 (file)
@@ -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 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 */
 };