[v2,1/3] lib/cryptodev: add rsa priv key feature flag

Message ID 20190227133258.8962-2-ayverma@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series adding rsa priv key feature flag |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ayuj Verma Feb. 27, 2019, 1:33 p.m. UTC
  Add feature flag to reflect RSA private key
operation support using quintuple (crt) or
exponent type key. if PMD support both,
then it should set both.

App should query cryptodev feature flag to check
if Sign and Decryt with CRT keys or exponent is
supported, thus call operation with relevant
key type.

Signed-off-by: Ayuj Verma <ayverma@marvell.com>
Signed-off-by: Shally Verma <shallyv@marvell.com>
---
 lib/librte_cryptodev/rte_cryptodev.c | 4 ++++
 lib/librte_cryptodev/rte_cryptodev.h | 4 ++++
 2 files changed, 8 insertions(+)
  

Comments

Akhil Goyal March 17, 2019, 5:46 p.m. UTC | #1
Hi Ayuj,

On 2/27/2019 7:03 PM, Ayuj Verma wrote:
> Add feature flag to reflect RSA private key
> operation support using quintuple (crt) or
> exponent type key. if PMD support both,
> then it should set both.
>
> App should query cryptodev feature flag to check
> if Sign and Decryt with CRT keys or exponent is
> supported, thus call operation with relevant
> key type.
>
> Signed-off-by: Ayuj Verma <ayverma@marvell.com>
> Signed-off-by: Shally Verma <shallyv@marvell.com>
> ---
>   lib/librte_cryptodev/rte_cryptodev.c | 4 ++++
>   lib/librte_cryptodev/rte_cryptodev.h | 4 ++++
>   2 files changed, 8 insertions(+)
>
> diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
> index 700973530..bb90ac939 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.c
> +++ b/lib/librte_cryptodev/rte_cryptodev.c
> @@ -486,6 +486,10 @@ rte_cryptodev_get_feature_name(uint64_t flag)
>   		return "CPU_ARM_CE";
>   	case RTE_CRYPTODEV_FF_SECURITY:
>   		return "SECURITY_PROTOCOL";
> +	case RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP:
> +		return "RSA_PRIV_OP_KEY_EXP";
> +	case RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT:
> +		return "RSA_PRIV_OP_KEY_QT";
>   	default:
>   		return NULL;
>   	}
> diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
> index a0bbcf932..298b35217 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.h
> +++ b/lib/librte_cryptodev/rte_cryptodev.h
> @@ -438,6 +438,10 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum,
>   /**< Utilises ARM CPU Cryptographic Extensions */
>   #define	RTE_CRYPTODEV_FF_SECURITY			(1ULL << 16)
>   /**< Support Security Protocol Processing */
> +#define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP		(1ULL << 17)
> +/**< Support RSA Private Key OP with exponent */
> +#define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT		(1ULL << 18)
> +/**< Support RSA Private Key OP with CRT (quintuple) Keys */
I believe these feature flags should be explained a bit in the 
documentation(doc/guides/cryptodevs/)
>   
>   
>   /**
  
Ayuj Verma March 18, 2019, 6:05 p.m. UTC | #2
Hi Akhil, Arek,

Sure, I'll rebase the patch and will send v3 along with doc changes.

Thanks and regards
Ayuj Verma

-----Original Message-----
From: Akhil Goyal <akhil.goyal@nxp.com> 
Sent: Sunday, March 17, 2019 11:17 PM
To: Ayuj Verma <ayverma@marvell.com>
Cc: arkadiuszx.kusztal@intel.com; fiona.trahe@intel.com; Shally Verma <shallyv@marvell.com>; Sunila Sahu <ssahu@marvell.com>; Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>; Arvind Desai <adesai@marvell.com>; dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2 1/3] lib/cryptodev: add rsa priv key feature flag

Hi Ayuj,

On 2/27/2019 7:03 PM, Ayuj Verma wrote:
> Add feature flag to reflect RSA private key operation support using 
> quintuple (crt) or exponent type key. if PMD support both, then it 
> should set both.
>
> App should query cryptodev feature flag to check if Sign and Decryt 
> with CRT keys or exponent is supported, thus call operation with 
> relevant key type.
>
> Signed-off-by: Ayuj Verma <ayverma@marvell.com>
> Signed-off-by: Shally Verma <shallyv@marvell.com>
> ---
>   lib/librte_cryptodev/rte_cryptodev.c | 4 ++++
>   lib/librte_cryptodev/rte_cryptodev.h | 4 ++++
>   2 files changed, 8 insertions(+)
>
> diff --git a/lib/librte_cryptodev/rte_cryptodev.c 
> b/lib/librte_cryptodev/rte_cryptodev.c
> index 700973530..bb90ac939 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.c
> +++ b/lib/librte_cryptodev/rte_cryptodev.c
> @@ -486,6 +486,10 @@ rte_cryptodev_get_feature_name(uint64_t flag)
>   		return "CPU_ARM_CE";
>   	case RTE_CRYPTODEV_FF_SECURITY:
>   		return "SECURITY_PROTOCOL";
> +	case RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP:
> +		return "RSA_PRIV_OP_KEY_EXP";
> +	case RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT:
> +		return "RSA_PRIV_OP_KEY_QT";
>   	default:
>   		return NULL;
>   	}
> diff --git a/lib/librte_cryptodev/rte_cryptodev.h 
> b/lib/librte_cryptodev/rte_cryptodev.h
> index a0bbcf932..298b35217 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.h
> +++ b/lib/librte_cryptodev/rte_cryptodev.h
> @@ -438,6 +438,10 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum,
>   /**< Utilises ARM CPU Cryptographic Extensions */
>   #define	RTE_CRYPTODEV_FF_SECURITY			(1ULL << 16)
>   /**< Support Security Protocol Processing */
> +#define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP		(1ULL << 17)
> +/**< Support RSA Private Key OP with exponent */
> +#define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT		(1ULL << 18)
> +/**< Support RSA Private Key OP with CRT (quintuple) Keys */
I believe these feature flags should be explained a bit in the
documentation(doc/guides/cryptodevs/)
>   
>   
>   /**
  

Patch

diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 700973530..bb90ac939 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -486,6 +486,10 @@  rte_cryptodev_get_feature_name(uint64_t flag)
 		return "CPU_ARM_CE";
 	case RTE_CRYPTODEV_FF_SECURITY:
 		return "SECURITY_PROTOCOL";
+	case RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP:
+		return "RSA_PRIV_OP_KEY_EXP";
+	case RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT:
+		return "RSA_PRIV_OP_KEY_QT";
 	default:
 		return NULL;
 	}
diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index a0bbcf932..298b35217 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -438,6 +438,10 @@  rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum,
 /**< Utilises ARM CPU Cryptographic Extensions */
 #define	RTE_CRYPTODEV_FF_SECURITY			(1ULL << 16)
 /**< Support Security Protocol Processing */
+#define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP		(1ULL << 17)
+/**< Support RSA Private Key OP with exponent */
+#define RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT		(1ULL << 18)
+/**< Support RSA Private Key OP with CRT (quintuple) Keys */
 
 
 /**