[v3,1/4] cryptodev: add partial sm2 feature flag

Message ID 20241008062845.11071-1-arkadiuszx.kusztal@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series [v3,1/4] cryptodev: add partial sm2 feature flag |

Checks

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

Commit Message

Kusztal, ArkadiuszX Oct. 8, 2024, 6:28 a.m. UTC
Due to complex ways of handling asymmetric cryptography algorithms,
capabilities may differ between hardware and software PMDs,
or even between hardware PMDs. One of the examples are algorithms that
need an additional round of hashing, like SM2.

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
---
 lib/cryptodev/rte_cryptodev.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Akhil Goyal Oct. 8, 2024, 11:46 a.m. UTC | #1
> Due to complex ways of handling asymmetric cryptography algorithms,
> capabilities may differ between hardware and software PMDs,
> or even between hardware PMDs. One of the examples are algorithms that
> need an additional round of hashing, like SM2.
> 
> Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
> ---
>  lib/cryptodev/rte_cryptodev.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
> index bec947f6d5..c0e816b17f 100644
> --- a/lib/cryptodev/rte_cryptodev.h
> +++ b/lib/cryptodev/rte_cryptodev.h
> @@ -554,6 +554,8 @@ rte_cryptodev_asym_get_xform_string(enum
> rte_crypto_asym_xform_type xform_enum);
>  /**< Support inner checksum computation/verification */
>  #define RTE_CRYPTODEV_FF_SECURITY_RX_INJECT		(1ULL << 28)
>  /**< Support Rx injection after security processing */
> +#define RTE_CRYPTODEV_FF_ASYM_PARTIAL_SM2		(1ULL << 29)
> +/**< Support the elliptic curve part only in SM2 */
> 
This would need an update in doc/guides/cryptodevs/features/default.ini as well.

However, it would be better to use the capability thing.
https://patches.dpdk.org/project/dpdk/patch/20241004181255.916-1-gmuthukrishn@marvell.com/

This patch add SM2 op specific capability.
It would be better to add this partial SM2 in the enum rte_crypto_sm2_op_capa defined in the above patch.
  
Kusztal, ArkadiuszX Oct. 8, 2024, 11:48 a.m. UTC | #2
> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Tuesday, October 8, 2024 1:47 PM
> To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; dev@dpdk.org
> Cc: Dooley, Brian <brian.dooley@intel.com>
> Subject: RE: [EXTERNAL] [PATCH v3 1/4] cryptodev: add partial sm2 feature flag
> 
> > Due to complex ways of handling asymmetric cryptography algorithms,
> > capabilities may differ between hardware and software PMDs, or even
> > between hardware PMDs. One of the examples are algorithms that need an
> > additional round of hashing, like SM2.
> >
> > Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
> > ---
> >  lib/cryptodev/rte_cryptodev.h | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/lib/cryptodev/rte_cryptodev.h
> > b/lib/cryptodev/rte_cryptodev.h index bec947f6d5..c0e816b17f 100644
> > --- a/lib/cryptodev/rte_cryptodev.h
> > +++ b/lib/cryptodev/rte_cryptodev.h
> > @@ -554,6 +554,8 @@ rte_cryptodev_asym_get_xform_string(enum
> > rte_crypto_asym_xform_type xform_enum);  /**< Support inner checksum
> > computation/verification */
> >  #define RTE_CRYPTODEV_FF_SECURITY_RX_INJECT		(1ULL << 28)
> >  /**< Support Rx injection after security processing */
> > +#define RTE_CRYPTODEV_FF_ASYM_PARTIAL_SM2		(1ULL << 29)
> > +/**< Support the elliptic curve part only in SM2 */
> >
> This would need an update in doc/guides/cryptodevs/features/default.ini as
> well.
> 
> However, it would be better to use the capability thing.
> https://patches.dpdk.org/project/dpdk/patch/20241004181255.916-1-
> gmuthukrishn@marvell.com/
> 
> This patch add SM2 op specific capability.
> It would be better to add this partial SM2 in the enum rte_crypto_sm2_op_capa
> defined in the above patch.
+1.
  

Patch

diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index bec947f6d5..c0e816b17f 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -554,6 +554,8 @@  rte_cryptodev_asym_get_xform_string(enum rte_crypto_asym_xform_type xform_enum);
 /**< Support inner checksum computation/verification */
 #define RTE_CRYPTODEV_FF_SECURITY_RX_INJECT		(1ULL << 28)
 /**< Support Rx injection after security processing */
+#define RTE_CRYPTODEV_FF_ASYM_PARTIAL_SM2		(1ULL << 29)
+/**< Support the elliptic curve part only in SM2 */
 
 /**
  * Get the name of a crypto device feature flag