From patchwork Fri May 31 13:52:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 53956 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 351A61B95A; Fri, 31 May 2019 15:54:05 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 63A201B953 for ; Fri, 31 May 2019 15:54:02 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 May 2019 06:54:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,535,1549958400"; d="scan'208";a="180330601" Received: from akusztax-mobl.ger.corp.intel.com ([10.104.14.178]) by fmsmga002.fm.intel.com with ESMTP; 31 May 2019 06:54:00 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: akhil.goyal@nxp.com, fiona.trahe@intel.com, shally.verma@caviumnetworks.com, Arek Kusztal Date: Fri, 31 May 2019 15:52:31 +0200 Message-Id: <20190531135231.10836-4-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.19.1.windows.1 In-Reply-To: <20190531135231.10836-1-arkadiuszx.kusztal@intel.com> References: <20190531135231.10836-1-arkadiuszx.kusztal@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 3/3] test: rework rsa test implementation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This commit reworks rsa test implementation to be conformant to the RSA API. Signed-off-by: Arek Kusztal --- app/test/test_cryptodev_asym.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c index fc92d3d..ea786ba 100644 --- a/app/test/test_cryptodev_asym.c +++ b/app/test/test_cryptodev_asym.c @@ -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) {