[v3,12/12] cryptodev: add salt length and optional label

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

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-aarch64-unit-testing warning Testing issues
ci/iol-aarch64-compile-testing fail Testing issues
ci/iol-x86_64-unit-testing success Testing PASS
ci/Intel-compilation fail Compilation issues
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing warning Testing issues

Commit Message

Arkadiusz Kusztal May 30, 2022, 2:31 p.m. UTC
  - Added salt length and optional label.
Common parameters to PSS and OAEP padding for RSA.
- Changed RSA hash padding fields names.
Now it corresponds to the RSA documents.

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

Patch

diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.h
index d31642680f..a755eaff7b 100644
--- a/lib/cryptodev/rte_crypto_asym.h
+++ b/lib/cryptodev/rte_crypto_asym.h
@@ -241,7 +241,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 algorithm
 	 * Valid hash algorithms are:
@@ -266,7 +266,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 the
 	 * padding scheme is either OAEP or PSS. If the padding
@@ -274,6 +274,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.
+	 */
 };
 
 /**