* [RFC PATCH] crypto: add RSA-specific capability parameters
@ 2026-07-31 9:11 Sucharitha Sarananaga
2026-08-11 14:02 ` Radu Nicolau
2026-08-19 7:16 ` [PATCH v2] " Sucharitha Sarananaga
0 siblings, 2 replies; 3+ messages in thread
From: Sucharitha Sarananaga @ 2026-07-31 9:11 UTC (permalink / raw)
To: dev; +Cc: anoobj, gakhil, gmuthukrishn, fanzhang.oss, Sucharitha Sarananaga
The existing asymmetric capability structure reports generic
modulus length and hash algorithm support, but it cannot
describe RSA-specific parameters required by OAEP and PSS.
RSA operations may support different padding schemes and MGF1
hash algorithms independent of the primary hash algorithm.
Applications currently have no standard way to discover these
capabilities from a PMD.
Add rsa_capa to report RSA modulus length, supported padding
schemes, and MGF1 hash algorithms. Keep hash_algos for reporting
primary digest support.
Also clarify that the generic modlen field applies to other
modulus-based transforms such as MODEXP, MODINV, DH, and DSA.
Signed-off-by: Sucharitha Sarananaga <ssarananaga@marvell.com>
---
lib/cryptodev/rte_cryptodev.h | 42 +++++++++++++++++++++++++++++++++--
1 file changed, 40 insertions(+), 2 deletions(-)
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 37a6a5e49b..e577dd8553 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -157,6 +157,40 @@ struct rte_cryptodev_symmetric_capability {
};
};
+/**
+ * RSA transform capability parameters.
+ *
+ * Used when rte_cryptodev_asymmetric_xform_capability::xform_type is
+ * RTE_CRYPTO_ASYM_XFORM_RSA. Advertises supported modulus lengths,
+ * MGF1 hash algorithms, and padding schemes.
+ *
+ * Primary hash algorithms for RSA operations (e.g. OAEP, PSS) are
+ * reported separately via hash_algos in
+ * rte_cryptodev_asymmetric_xform_capability.
+ */
+struct rte_crypto_rsa_capa {
+ struct rte_crypto_param_range modlen;
+ /**< Supported RSA modulus length range, in bits.
+ * A min, max, or increment value of 0 means no limit is
+ * imposed for that field and the PMD default applies.
+ */
+
+ uint8_t pad_types;
+ /**< Bitmask of supported RSA padding schemes.
+ * Each bit corresponds to enum rte_crypto_rsa_padding_type.
+ * A value of 0 means padding capability is not reported.
+ */
+
+ uint64_t mgf1_hash_algos;
+ /**< Bitmask of hash algorithms supported for MGF1 mask generation.
+ * Each bit corresponds to enum rte_crypto_auth_algorithm.
+ * Used for RSA-OAEP and RSA-PSS when MGF1 may use a digest
+ * different from the primary hash.
+ * A value of 0 means MGF1 capability is not reported.
+ */
+};
+
+
/**
* Asymmetric Xform Crypto Capability
*/
@@ -179,8 +213,9 @@ struct rte_cryptodev_asymmetric_xform_capability {
__extension__
union {
struct rte_crypto_param_range modlen;
- /**< Range of modulus length supported by modulus based xform.
- * Value 0 mean implementation default
+ /**< Range of modulus length supported by modulus based xform
+ * such as MODEXP, MODINV, DH, and DSA.
+ * Value 0 means implementation default.
*/
uint8_t internal_rng;
@@ -197,6 +232,9 @@ struct rte_cryptodev_asymmetric_xform_capability {
uint32_t mldsa_capa[RTE_CRYPTO_ML_DSA_OP_END];
/**< Bitmask of supported ML-DSA parameter sets. */
+
+ struct rte_crypto_rsa_capa rsa_capa;
+ /**< RSA modulus length, MGF1 hash, and padding capabilities. */
};
uint64_t hash_algos;
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [RFC PATCH] crypto: add RSA-specific capability parameters
2026-07-31 9:11 [RFC PATCH] crypto: add RSA-specific capability parameters Sucharitha Sarananaga
@ 2026-08-11 14:02 ` Radu Nicolau
2026-08-19 7:16 ` [PATCH v2] " Sucharitha Sarananaga
1 sibling, 0 replies; 3+ messages in thread
From: Radu Nicolau @ 2026-08-11 14:02 UTC (permalink / raw)
To: Sucharitha Sarananaga, dev; +Cc: anoobj, gakhil, gmuthukrishn, fanzhang.oss
On 31-Jul-26 10:11 AM, Sucharitha Sarananaga wrote:
> The existing asymmetric capability structure reports generic
> modulus length and hash algorithm support, but it cannot
> describe RSA-specific parameters required by OAEP and PSS.
>
> RSA operations may support different padding schemes and MGF1
> hash algorithms independent of the primary hash algorithm.
> Applications currently have no standard way to discover these
> capabilities from a PMD.
>
> Add rsa_capa to report RSA modulus length, supported padding
> schemes, and MGF1 hash algorithms. Keep hash_algos for reporting
> primary digest support.
>
> Also clarify that the generic modlen field applies to other
> modulus-based transforms such as MODEXP, MODINV, DH, and DSA.
>
> Signed-off-by: Sucharitha Sarananaga <ssarananaga@marvell.com>
> ---
> lib/cryptodev/rte_cryptodev.h | 42 +++++++++++++++++++++++++++++++++--
> 1 file changed, 40 insertions(+), 2 deletions(-)
>
> diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
> index 37a6a5e49b..e577dd8553 100644
> --- a/lib/cryptodev/rte_cryptodev.h
> +++ b/lib/cryptodev/rte_cryptodev.h
> @@ -157,6 +157,40 @@ struct rte_cryptodev_symmetric_capability {
> };
> };
>
> +/**
> + * RSA transform capability parameters.
> + *
> + * Used when rte_cryptodev_asymmetric_xform_capability::xform_type is
> + * RTE_CRYPTO_ASYM_XFORM_RSA. Advertises supported modulus lengths,
> + * MGF1 hash algorithms, and padding schemes.
> + *
> + * Primary hash algorithms for RSA operations (e.g. OAEP, PSS) are
> + * reported separately via hash_algos in
> + * rte_cryptodev_asymmetric_xform_capability.
> + */
> +struct rte_crypto_rsa_capa {
> + struct rte_crypto_param_range modlen;
> + /**< Supported RSA modulus length range, in bits.
> + * A min, max, or increment value of 0 means no limit is
> + * imposed for that field and the PMD default applies.
> + */
> +
> + uint8_t pad_types;
> + /**< Bitmask of supported RSA padding schemes.
> + * Each bit corresponds to enum rte_crypto_rsa_padding_type.
> + * A value of 0 means padding capability is not reported.
Here and below, would it make sense to add something like " and the PMD
default may apply"?
Apart from that,
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH v2] crypto: add RSA-specific capability parameters
2026-07-31 9:11 [RFC PATCH] crypto: add RSA-specific capability parameters Sucharitha Sarananaga
2026-08-11 14:02 ` Radu Nicolau
@ 2026-08-19 7:16 ` Sucharitha Sarananaga
1 sibling, 0 replies; 3+ messages in thread
From: Sucharitha Sarananaga @ 2026-08-19 7:16 UTC (permalink / raw)
To: dev
Cc: gakhil, fanzhang.oss, radu.nicolau, gmuthukrishn, anoobj,
Sucharitha Sarananaga
The existing asymmetric capability structure reports generic
modulus length and hash algorithm support, but it cannot
describe RSA-specific parameters required by OAEP and PSS.
RSA operations may support different padding schemes and MGF1
hash algorithms independent of the primary hash algorithm.
Applications currently have no standard way to discover these
capabilities from a PMD.
Add rsa_capa to report RSA modulus length, supported padding
schemes, and MGF1 hash algorithms. Keep hash_algos for reporting
primary digest support.
Also clarify that the generic modlen field applies to other
modulus-based transforms such as MODEXP, MODINV, DH, and DSA.
v2:
* Document zero-value semantics for pad_types and mgf1_hash_algos.
* Clarify that a zero capability value indicates the PMD does not
report the capability and PMD defaults may apply.
Signed-off-by: Sucharitha Sarananaga <ssarananaga@marvell.com>
---
lib/cryptodev/rte_cryptodev.h | 43 +++++++++++++++++++++++++++++++++--
1 file changed, 41 insertions(+), 2 deletions(-)
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 37a6a5e49b..98f54c1184 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -157,6 +157,41 @@ struct rte_cryptodev_symmetric_capability {
};
};
+/**
+ * RSA transform capability parameters.
+ *
+ * Used when rte_cryptodev_asymmetric_xform_capability::xform_type is
+ * RTE_CRYPTO_ASYM_XFORM_RSA. Advertises supported modulus lengths,
+ * MGF1 hash algorithms, and padding schemes.
+ *
+ * Primary hash algorithms for RSA operations (e.g. OAEP, PSS) are
+ * reported separately via hash_algos in
+ * rte_cryptodev_asymmetric_xform_capability.
+ */
+struct rte_crypto_rsa_capa {
+ struct rte_crypto_param_range modlen;
+ /**< Supported RSA modulus length range, in bits.
+ * A min, max, or increment value of 0 means no limit is
+ * imposed for that field and the PMD default applies.
+ */
+
+ uint8_t pad_types;
+ /**< Bitmask of supported RSA padding schemes.
+ * Each bit corresponds to enum rte_crypto_rsa_padding_type.
+ * A value of 0 means padding capability is not reported and the PMD
+ * default may apply.
+ */
+
+ uint64_t mgf1_hash_algos;
+ /**< Bitmask of hash algorithms supported for MGF1 mask generation.
+ * Each bit corresponds to enum rte_crypto_auth_algorithm.
+ * Used for RSA-OAEP and RSA-PSS when MGF1 may use a digest
+ * different from the primary hash.
+ * A value of 0 means MGF1 capability is not reported and the PMD
+ * default may apply.
+ */
+};
+
/**
* Asymmetric Xform Crypto Capability
*/
@@ -179,8 +214,9 @@ struct rte_cryptodev_asymmetric_xform_capability {
__extension__
union {
struct rte_crypto_param_range modlen;
- /**< Range of modulus length supported by modulus based xform.
- * Value 0 mean implementation default
+ /**< Range of modulus length supported by modulus based xform
+ * such as MODEXP, MODINV, DH, and DSA.
+ * Value 0 means implementation default.
*/
uint8_t internal_rng;
@@ -197,6 +233,9 @@ struct rte_cryptodev_asymmetric_xform_capability {
uint32_t mldsa_capa[RTE_CRYPTO_ML_DSA_OP_END];
/**< Bitmask of supported ML-DSA parameter sets. */
+
+ struct rte_crypto_rsa_capa rsa_capa;
+ /**< RSA modulus length, MGF1 hash, and padding capabilities. */
};
uint64_t hash_algos;
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-19 7:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31 9:11 [RFC PATCH] crypto: add RSA-specific capability parameters Sucharitha Sarananaga
2026-08-11 14:02 ` Radu Nicolau
2026-08-19 7:16 ` [PATCH v2] " Sucharitha Sarananaga
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox