diff mbox series

[v2,13/14] cryptodev: add salt length and optional label

Message ID 20220525155324.9288-14-arkadiuszx.kusztal@intel.com (mailing list archive)
State Superseded
Delegated to: akhil goyal
Headers show
Series cryptodev: rsa, dh, ecdh changes | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Kusztal, ArkadiuszX May 25, 2022, 3:53 p.m. UTC
- Added salt length and optional label.
Common parameters to PSS and OAEP padding for RSA.
- Fixed hash API in RSA padding.
Now it is specified how hash should be used with
particular RSA padding modes.

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

Comments

Akhil Goyal May 26, 2022, 12:08 p.m. UTC | #1
> - Added salt length and optional label.
> Common parameters to PSS and OAEP padding for RSA.
> - Fixed hash API in RSA padding.
> Now it is specified how hash should be used with
> particular RSA padding modes.
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
Acked-by: Akhil Goyal <gakhil@marvell.com>
diff mbox series

Patch

diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h
index 9f7fba3758..d90a7a1957 100644
--- a/lib/cryptodev/rte_crypto_asym.h
+++ b/lib/cryptodev/rte_crypto_asym.h
@@ -217,7 +217,7 @@  struct rte_crypto_rsa_priv_key_qt {
 struct rte_crypto_rsa_padding {
 	enum rte_crypto_rsa_padding_type type;
 	/**< RSA padding scheme to be used for transform */
-	enum rte_crypto_auth_algorithm md;
+	enum rte_crypto_auth_algorithm hash;
 	/**<
 	 * RSA padding hash function
 	 *
@@ -240,7 +240,7 @@  struct rte_crypto_rsa_padding {
 	 * This field shall be set with the hash algorithm used
 	 * in the padding scheme (and to create the input message digest)
 	 */
-	enum rte_crypto_auth_algorithm mgf1md;
+	enum rte_crypto_auth_algorithm mgf1hash;
 	/**<
 	 * Hash algorithm to be used for mask generation if
 	 * padding scheme is either OAEP or PSS. If padding
@@ -248,6 +248,21 @@  struct rte_crypto_rsa_padding {
 	 * for mask generation. Valid hash algorithms are:
 	 * MD5, SHA1, SHA224, SHA256, SHA384, SHA512
 	 */
+	uint16_t pss_saltlen;
+	/**<
+	 * RSA PSS padding salt length
+	 *
+	 * Used only when RTE_CRYPTO_RSA_PADDING_PSS padding is selected,
+	 * otherwise ignored.
+	 */
+	rte_crypto_param oaep_label;
+	/**<
+	 * RSA OAEP padding optional label
+	 *
+	 * Used only when RTE_CRYPTO_RSA_PADDING_OAEP padding is selected,
+	 * otherwise ignored. If label.data == NULL, a default
+	 * label (empty string) is used.
+	 */
 };
 
 /**