* [RFC PATCH] cryptodev: add basic asymmetric crypto capability structs
@ 2022-04-08 14:05 Arek Kusztal
2022-05-16 18:54 ` [EXT] " Akhil Goyal
0 siblings, 1 reply; 3+ messages in thread
From: Arek Kusztal @ 2022-04-08 14:05 UTC (permalink / raw)
To: dev; +Cc: gakhil, roy.fan.zhang, Arek Kusztal
This commit adds basic structs to handle asymmetric crypto capability.
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
lib/cryptodev/rte_crypto_asym.h | 47 +++++++++++++++++++++++++++++++++
lib/cryptodev/rte_cryptodev.h | 8 ++++++
2 files changed, 55 insertions(+)
diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h
index cd24d4b07b..2d58fffee5 100644
--- a/lib/cryptodev/rte_crypto_asym.h
+++ b/lib/cryptodev/rte_crypto_asym.h
@@ -386,6 +386,26 @@ struct rte_crypto_rsa_op_param {
*/
};
+struct rte_crypto_rsa_capability {
+ uint64_t padding_type;
+ /* Supported padding */
+ union {
+ uint64_t hash;
+ /* Supported hash functions, at least one
+ * shall be supported */
+ uint64_t mgf;
+ /* Supported masdk generation functions,
+ * at least one shall be supported */
+ } padding;
+ uint32_t max_key_len;
+ /* Maximum supported key length */
+ uint8_t sign_message;
+ /* If zero input should contain message digest,
+ * otherwise it should be plain message */
+ uint8_t pkcs_plain_padding;
+ /* PKCS1_5 padding without algorithm identifier */
+};
+
/**
* Diffie-Hellman Operations params.
* @note:
@@ -416,6 +436,19 @@ struct rte_crypto_dh_op_param {
*/
};
+struct rte_crypto_dh_capability {
+ union {
+ uint32_t group_size;
+ /**< Maximum size of underliying mod group */
+ uint64_t curves;
+ /**< Supported elliptic curve ids */
+ /* uint64_t fixed_groups; ? */
+ /**< Supported fixed groups */
+ /* uint8_t custom_curves; ? */
+ /**< Supported custom curves */
+ };
+};
+
/**
* DSA Operations params
*
@@ -484,6 +517,13 @@ struct rte_crypto_ecdsa_op_param {
*/
};
+struct rte_crypto_ecdsa_capability {
+ uint64_t curves;
+ /**< Supported elliptic curve ids */
+ /* uint8_t custom_curves; ? */
+ /**< Supported custom curves */
+};
+
/**
* Structure for EC point multiplication operation param
*/
@@ -498,6 +538,13 @@ struct rte_crypto_ecpm_op_param {
/**< Scalar to multiply the input point */
};
+struct rte_crypto_ecpm_capability {
+ uint64_t curves;
+ /**< Supported elliptic curve ids */
+ /* uint8_t custom_curves; ? */
+ /**< Supported custom curves */
+};
+
/**
* Asymmetric crypto transform data
*
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 45d33f4a50..79026dbb80 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -176,6 +176,14 @@ struct rte_cryptodev_asymmetric_xform_capability {
/**< Range of modulus length supported by modulus based xform.
* Value 0 mean implementation default
*/
+ struct rte_crypto_ecdsa_capability ecdsa;
+ /**< ECDSA capability */
+ struct rte_crypto_ecpm_capability ecpm;
+ /**< ECPM capability */
+ struct rte_crypto_rsa_capability rsa;
+ /**< RSA capability */
+ struct rte_crypto_dh_capability dh;
+ /**< DH capability */
};
};
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [EXT] [RFC PATCH] cryptodev: add basic asymmetric crypto capability structs
2022-04-08 14:05 [RFC PATCH] cryptodev: add basic asymmetric crypto capability structs Arek Kusztal
@ 2022-05-16 18:54 ` Akhil Goyal
2022-05-17 11:33 ` Kusztal, ArkadiuszX
0 siblings, 1 reply; 3+ messages in thread
From: Akhil Goyal @ 2022-05-16 18:54 UTC (permalink / raw)
To: Arek Kusztal, dev; +Cc: roy.fan.zhang
Hi Arek,
Are you planning for a formal patch for adding asym capabilities?
> This commit adds basic structs to handle asymmetric crypto capability.
>
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
> lib/cryptodev/rte_crypto_asym.h | 47 +++++++++++++++++++++++++++++++++
> lib/cryptodev/rte_cryptodev.h | 8 ++++++
> 2 files changed, 55 insertions(+)
>
> diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h
> index cd24d4b07b..2d58fffee5 100644
> --- a/lib/cryptodev/rte_crypto_asym.h
> +++ b/lib/cryptodev/rte_crypto_asym.h
> @@ -386,6 +386,26 @@ struct rte_crypto_rsa_op_param {
> */
> };
>
> +struct rte_crypto_rsa_capability {
> + uint64_t padding_type;
> + /* Supported padding */
> + union {
> + uint64_t hash;
> + /* Supported hash functions, at least one
> + * shall be supported */
> + uint64_t mgf;
> + /* Supported masdk generation functions,
> + * at least one shall be supported */
> + } padding;
> + uint32_t max_key_len;
> + /* Maximum supported key length */
> + uint8_t sign_message;
> + /* If zero input should contain message digest,
> + * otherwise it should be plain message */
> + uint8_t pkcs_plain_padding;
> + /* PKCS1_5 padding without algorithm identifier */
> +};
> +
> /**
> * Diffie-Hellman Operations params.
> * @note:
> @@ -416,6 +436,19 @@ struct rte_crypto_dh_op_param {
> */
> };
>
> +struct rte_crypto_dh_capability {
> + union {
> + uint32_t group_size;
> + /**< Maximum size of underliying mod group */
> + uint64_t curves;
> + /**< Supported elliptic curve ids */
> + /* uint64_t fixed_groups; ? */
> + /**< Supported fixed groups */
> + /* uint8_t custom_curves; ? */
> + /**< Supported custom curves */
> + };
> +};
> +
> /**
> * DSA Operations params
> *
> @@ -484,6 +517,13 @@ struct rte_crypto_ecdsa_op_param {
> */
> };
>
> +struct rte_crypto_ecdsa_capability {
> + uint64_t curves;
> + /**< Supported elliptic curve ids */
> + /* uint8_t custom_curves; ? */
> + /**< Supported custom curves */
> +};
> +
> /**
> * Structure for EC point multiplication operation param
> */
> @@ -498,6 +538,13 @@ struct rte_crypto_ecpm_op_param {
> /**< Scalar to multiply the input point */
> };
>
> +struct rte_crypto_ecpm_capability {
> + uint64_t curves;
> + /**< Supported elliptic curve ids */
> + /* uint8_t custom_curves; ? */
> + /**< Supported custom curves */
> +};
> +
> /**
> * Asymmetric crypto transform data
> *
> diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
> index 45d33f4a50..79026dbb80 100644
> --- a/lib/cryptodev/rte_cryptodev.h
> +++ b/lib/cryptodev/rte_cryptodev.h
> @@ -176,6 +176,14 @@ struct rte_cryptodev_asymmetric_xform_capability {
> /**< Range of modulus length supported by modulus based
> xform.
> * Value 0 mean implementation default
> */
> + struct rte_crypto_ecdsa_capability ecdsa;
> + /**< ECDSA capability */
> + struct rte_crypto_ecpm_capability ecpm;
> + /**< ECPM capability */
> + struct rte_crypto_rsa_capability rsa;
> + /**< RSA capability */
> + struct rte_crypto_dh_capability dh;
> + /**< DH capability */
> };
> };
>
> --
> 2.30.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [EXT] [RFC PATCH] cryptodev: add basic asymmetric crypto capability structs
2022-05-16 18:54 ` [EXT] " Akhil Goyal
@ 2022-05-17 11:33 ` Kusztal, ArkadiuszX
0 siblings, 0 replies; 3+ messages in thread
From: Kusztal, ArkadiuszX @ 2022-05-17 11:33 UTC (permalink / raw)
To: Akhil Goyal, dev; +Cc: Zhang, Roy Fan
> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Monday, May 16, 2022 8:55 PM
> To: Kusztal, ArkadiuszX <arkadiuszx.kusztal@intel.com>; dev@dpdk.org
> Cc: Zhang, Roy Fan <roy.fan.zhang@intel.com>
> Subject: RE: [EXT] [RFC PATCH] cryptodev: add basic asymmetric crypto
> capability structs
>
> Hi Arek,
>
> Are you planning for a formal patch for adding asym capabilities?
[Arek] - Yes, I will send one in next few days. But I wanted to have some part of patches initially accepted as I need to reflect API changes there.
>
> > This commit adds basic structs to handle asymmetric crypto capability.
> >
> > Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> > ---
> > lib/cryptodev/rte_crypto_asym.h | 47
> +++++++++++++++++++++++++++++++++
> > lib/cryptodev/rte_cryptodev.h | 8 ++++++
> > 2 files changed, 55 insertions(+)
> >
> > diff --git a/lib/cryptodev/rte_crypto_asym.h
> > b/lib/cryptodev/rte_crypto_asym.h index cd24d4b07b..2d58fffee5 100644
> > --- a/lib/cryptodev/rte_crypto_asym.h
> > +++ b/lib/cryptodev/rte_crypto_asym.h
> > @@ -386,6 +386,26 @@ struct rte_crypto_rsa_op_param {
> > */
> > };
> >
> > +struct rte_crypto_rsa_capability {
> > + uint64_t padding_type;
> > + /* Supported padding */
> > + union {
> > + uint64_t hash;
> > + /* Supported hash functions, at least one
> > + * shall be supported */
> > + uint64_t mgf;
> > + /* Supported masdk generation functions,
> > + * at least one shall be supported */
> > + } padding;
> > + uint32_t max_key_len;
> > + /* Maximum supported key length */
> > + uint8_t sign_message;
> > + /* If zero input should contain message digest,
> > + * otherwise it should be plain message */
> > + uint8_t pkcs_plain_padding;
> > + /* PKCS1_5 padding without algorithm identifier */ };
> > +
> > /**
> > * Diffie-Hellman Operations params.
> > * @note:
> > @@ -416,6 +436,19 @@ struct rte_crypto_dh_op_param {
> > */
> > };
> >
> > +struct rte_crypto_dh_capability {
> > + union {
> > + uint32_t group_size;
> > + /**< Maximum size of underliying mod group */
> > + uint64_t curves;
> > + /**< Supported elliptic curve ids */
> > + /* uint64_t fixed_groups; ? */
> > + /**< Supported fixed groups */
> > + /* uint8_t custom_curves; ? */
> > + /**< Supported custom curves */
> > + };
> > +};
> > +
> > /**
> > * DSA Operations params
> > *
> > @@ -484,6 +517,13 @@ struct rte_crypto_ecdsa_op_param {
> > */
> > };
> >
> > +struct rte_crypto_ecdsa_capability {
> > + uint64_t curves;
> > + /**< Supported elliptic curve ids */
> > + /* uint8_t custom_curves; ? */
> > + /**< Supported custom curves */
> > +};
> > +
> > /**
> > * Structure for EC point multiplication operation param
> > */
> > @@ -498,6 +538,13 @@ struct rte_crypto_ecpm_op_param {
> > /**< Scalar to multiply the input point */ };
> >
> > +struct rte_crypto_ecpm_capability {
> > + uint64_t curves;
> > + /**< Supported elliptic curve ids */
> > + /* uint8_t custom_curves; ? */
> > + /**< Supported custom curves */
> > +};
> > +
> > /**
> > * Asymmetric crypto transform data
> > *
> > diff --git a/lib/cryptodev/rte_cryptodev.h
> > b/lib/cryptodev/rte_cryptodev.h index 45d33f4a50..79026dbb80 100644
> > --- a/lib/cryptodev/rte_cryptodev.h
> > +++ b/lib/cryptodev/rte_cryptodev.h
> > @@ -176,6 +176,14 @@ struct rte_cryptodev_asymmetric_xform_capability {
> > /**< Range of modulus length supported by modulus based
> xform.
> > * Value 0 mean implementation default
> > */
> > + struct rte_crypto_ecdsa_capability ecdsa;
> > + /**< ECDSA capability */
> > + struct rte_crypto_ecpm_capability ecpm;
> > + /**< ECPM capability */
> > + struct rte_crypto_rsa_capability rsa;
> > + /**< RSA capability */
> > + struct rte_crypto_dh_capability dh;
> > + /**< DH capability */
> > };
> > };
> >
> > --
> > 2.30.2
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-17 11:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 14:05 [RFC PATCH] cryptodev: add basic asymmetric crypto capability structs Arek Kusztal
2022-05-16 18:54 ` [EXT] " Akhil Goyal
2022-05-17 11:33 ` Kusztal, ArkadiuszX
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.