[3/3] test: rework rsa test implementation
Checks
Commit Message
This commit reworks rsa test implementation to be conformant
to the RSA API.
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
app/test/test_cryptodev_asym.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
@@ -402,7 +402,7 @@ test_rsa_sign_verify(void)
asym_op->rsa.message.data = input_buf;
asym_op->rsa.message.length = rsaplaintext.len;
asym_op->rsa.sign.data = output_buf;
- asym_op->rsa.pad = RTE_CRYPTO_RSA_PKCS1_V1_5_BT1;
+ asym_op->rsa.padding.type = RTE_CRYPTO_RSA_PADDING_PKCS1;
debug_hexdump(stdout, "message", asym_op->rsa.message.data,
asym_op->rsa.message.length);
@@ -437,7 +437,7 @@ test_rsa_sign_verify(void)
/* Verify sign */
asym_op->rsa.op_type = RTE_CRYPTO_ASYM_OP_VERIFY;
- asym_op->rsa.pad = RTE_CRYPTO_RSA_PKCS1_V1_5_BT2;
+ asym_op->rsa.padding.type = RTE_CRYPTO_RSA_PADDING_PKCS1;
/* Process crypto operation */
if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) != 1) {
@@ -495,6 +495,7 @@ test_rsa_enc_dec(void)
struct rte_cryptodev_asym_session *sess = NULL;
int status = TEST_SUCCESS;
uint8_t input_buf[TEST_DATA_SIZE] = {0};
+ uint8_t cipher_buf[TEST_DATA_SIZE] = {0};
/* test case supports op with exponent key only,
* Check in PMD feature flag for RSA exponent key type support.
@@ -547,7 +548,9 @@ test_rsa_enc_dec(void)
rsaplaintext.len);
asym_op->rsa.message.data = input_buf;
asym_op->rsa.message.length = rsaplaintext.len;
- asym_op->rsa.pad = RTE_CRYPTO_RSA_PKCS1_V1_5_BT2;
+ asym_op->rsa.cipher.data = cipher_buf;
+ asym_op->rsa.cipher.length = 0;
+ asym_op->rsa.padding.type = RTE_CRYPTO_RSA_PADDING_PKCS1;
debug_hexdump(stdout, "message", asym_op->rsa.message.data,
asym_op->rsa.message.length);
@@ -581,7 +584,7 @@ test_rsa_enc_dec(void)
/* Use the resulted output as decryption Input vector*/
asym_op = result_op->asym;
asym_op->rsa.op_type = RTE_CRYPTO_ASYM_OP_DECRYPT;
- asym_op->rsa.pad = RTE_CRYPTO_RSA_PKCS1_V1_5_BT1;
+ asym_op->rsa.padding.type = RTE_CRYPTO_RSA_PADDING_PKCS1;
/* Process crypto operation */
if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) != 1) {