[v2,4/5] cryptodev: remove list ends from asymmetric crypto api

Message ID 20200930173226.770-5-arkadiuszx.kusztal@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: akhil goyal
Headers
Series cryptodev: remove list end enumerators |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Arkadiusz Kusztal Sept. 30, 2020, 5:32 p.m. UTC
  This patch removes RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END,
RTE_CRYPTO_ASYM_OP_LIST_END, RTE_CRYPTO_RSA_PADDING_TYPE_LIST_END
enumerators from asymmetric crypto API. When asymmetric API will
no more be experimental adding new entries will be possible without
ABI breakage.

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

Comments

Akhil Goyal Oct. 8, 2020, 7:51 p.m. UTC | #1
Hi Arek/Fiona,

> This patch removes RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END,
> RTE_CRYPTO_ASYM_OP_LIST_END,
> RTE_CRYPTO_RSA_PADDING_TYPE_LIST_END
> enumerators from asymmetric crypto API. When asymmetric API will
> no more be experimental adding new entries will be possible without
> ABI breakage.

I believe XFORM_TYPE, ASYM_OP, and PADDING_TYPE are not going to
Change in near future. Hence LIST_END should not be removed from these
Enums. Adding a LIST END has its own benefits and we should not remove
that until we have a solid reason for it. Moreover, these are experimental.
We should revisit these when we think ASYM is stable.

IMO, we should only remove list ends in algo types.

Regards,
Akhil
  
Arkadiusz Kusztal Oct. 9, 2020, 7:02 a.m. UTC | #2
Hi Akhil,

> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: czwartek, 8 października 2020 21:51
> To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; dev@dpdk.org
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; ruifeng.wang@arm.com;
> michaelsh@marvell.com
> Subject: RE: [PATCH v2 4/5] cryptodev: remove list ends from asymmetric crypto
> api
> 
> Hi Arek/Fiona,
> 
> > This patch removes RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END,
> > RTE_CRYPTO_ASYM_OP_LIST_END,
> > RTE_CRYPTO_RSA_PADDING_TYPE_LIST_END
> > enumerators from asymmetric crypto API. When asymmetric API will no
> > more be experimental adding new entries will be possible without ABI
> > breakage.
> 
> I believe XFORM_TYPE, ASYM_OP, and PADDING_TYPE are not going to Change
> in near future. Hence LIST_END should not be removed from these Enums.
> Adding a LIST END has its own benefits and we should not remove that until we
> have a solid reason for it. Moreover, these are experimental.
> We should revisit these when we think ASYM is stable.

As for XFORM_TYPE it could be extended by ECDH, even if ECPM is present (as we have DH op enums), I think EdDSA can have its own enum as well.
As for asym_op I don't know which way it will go as RTE_CRYPTO_ASYM_OP_PRIVATE_KEY_GENERATE is distinct case as it is more about generation than computation, this could be clarified in future.
As for rsa padding, I agree it fulfills today requirements.

Though yes, since it is experimental I will remove asym patch from v3 patchset.

> 
> IMO, we should only remove list ends in algo types.
> 
> Regards,
> Akhil
  

Patch

diff --git a/lib/librte_cryptodev/rte_crypto_asym.h b/lib/librte_cryptodev/rte_crypto_asym.h
index 9c866f553..915a586c1 100644
--- a/lib/librte_cryptodev/rte_crypto_asym.h
+++ b/lib/librte_cryptodev/rte_crypto_asym.h
@@ -92,10 +92,8 @@  enum rte_crypto_asym_xform_type {
 	/**< Elliptic Curve Digital Signature Algorithm
 	 * Perform Signature Generation and Verification.
 	 */
-	RTE_CRYPTO_ASYM_XFORM_ECPM,
+	RTE_CRYPTO_ASYM_XFORM_ECPM
 	/**< Elliptic Curve Point Multiplication */
-	RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
-	/**< End of list */
 };
 
 /**
@@ -114,9 +112,8 @@  enum rte_crypto_asym_op_type {
 	/**< DH Private Key generation operation */
 	RTE_CRYPTO_ASYM_OP_PUBLIC_KEY_GENERATE,
 	/**< DH Public Key generation operation */
-	RTE_CRYPTO_ASYM_OP_SHARED_SECRET_COMPUTE,
+	RTE_CRYPTO_ASYM_OP_SHARED_SECRET_COMPUTE
 	/**< DH Shared Secret compute operation */
-	RTE_CRYPTO_ASYM_OP_LIST_END
 };
 
 /**
@@ -131,9 +128,8 @@  enum rte_crypto_rsa_padding_type {
 	 */
 	RTE_CRYPTO_RSA_PADDING_OAEP,
 	/**< RSA PKCS#1 OAEP padding scheme */
-	RTE_CRYPTO_RSA_PADDING_PSS,
+	RTE_CRYPTO_RSA_PADDING_PSS
 	/**< RSA PKCS#1 PSS padding scheme */
-	RTE_CRYPTO_RSA_PADDING_TYPE_LIST_END
 };
 
 /**