diff mbox series

[32/40] crypto/openssl: reduce rsa struct to only necessary fields

Message ID 20220520055445.40063-33-arkadiuszx.kusztal@intel.com (mailing list archive)
State Changes Requested
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 20, 2022, 5:54 a.m. UTC
- reduced rsa struct to only necessary fields.
This commit reflects changes to the asymmetric crypto API.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/crypto/openssl/rte_openssl_pmd.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
diff mbox series

Patch

diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 6b3cf7a6aa..f5eb82ac2a 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -1915,47 +1915,47 @@  process_openssl_rsa_op(struct rte_crypto_op *cop,
 
 	switch (op->rsa.op_type) {
 	case RTE_CRYPTO_ASYM_OP_ENCRYPT:
-		ret = RSA_public_encrypt(op->rsa.message.length,
-				op->rsa.message.data,
-				op->rsa.cipher.data,
+		ret = RSA_public_encrypt(op->rsa.input.length,
+				op->rsa.input.data,
+				op->rsa.output.data,
 				rsa,
 				pad);
 
 		if (ret > 0)
-			op->rsa.cipher.length = ret;
+			op->rsa.output.length = ret;
 		OPENSSL_LOG(DEBUG,
 				"length of encrypted text %d\n", ret);
 		break;
 
 	case RTE_CRYPTO_ASYM_OP_DECRYPT:
-		ret = RSA_private_decrypt(op->rsa.cipher.length,
-				op->rsa.cipher.data,
-				op->rsa.message.data,
+		ret = RSA_private_decrypt(op->rsa.input.length,
+				op->rsa.input.data,
+				op->rsa.output.data,
 				rsa,
 				pad);
 		if (ret > 0)
-			op->rsa.message.length = ret;
+			op->rsa.output.length = ret;
 		break;
 
 	case RTE_CRYPTO_ASYM_OP_SIGN:
-		ret = RSA_private_encrypt(op->rsa.message.length,
-				op->rsa.message.data,
-				op->rsa.sign.data,
+		ret = RSA_private_encrypt(op->rsa.input.length,
+				op->rsa.input.data,
+				op->rsa.output.data,
 				rsa,
 				pad);
 		if (ret > 0)
-			op->rsa.sign.length = ret;
+			op->rsa.output.length = ret;
 		break;
 
 	case RTE_CRYPTO_ASYM_OP_VERIFY:
-		tmp = rte_malloc(NULL, op->rsa.sign.length, 0);
+		tmp = rte_malloc(NULL, op->rsa.input.length, 0);
 		if (tmp == NULL) {
 			OPENSSL_LOG(ERR, "Memory allocation failed");
 			cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
 			break;
 		}
-		ret = RSA_public_decrypt(op->rsa.sign.length,
-				op->rsa.sign.data,
+		ret = RSA_public_decrypt(op->rsa.input.length,
+				op->rsa.input.data,
 				tmp,
 				rsa,
 				pad);