DPDK patches and discussions
 help / color / mirror / Atom feed
From: Arek Kusztal <arkadiuszx.kusztal@intel.com>
To: dev@dpdk.org
Cc: akhil.goyal@nxp.com, fiona.trahe@intel.com,
	shally.verma@caviumnetworks.com,
	Arek Kusztal <arkadiuszx.kusztal@intel.com>
Subject: [dpdk-dev] [PATCH v2 3/3] test: add result field to mod exp and mod inv
Date: Fri,  8 Feb 2019 12:13:38 +0100	[thread overview]
Message-ID: <20190208111338.4544-4-arkadiuszx.kusztal@intel.com> (raw)
In-Reply-To: <20190208111338.4544-1-arkadiuszx.kusztal@intel.com>

This patch adds result field to modular exponentiation and
modular multiplicative inverse tests

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 test/test/test_cryptodev_asym.c      | 6 ++++++
 test/test/test_cryptodev_asym_util.h | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/test/test/test_cryptodev_asym.c b/test/test/test_cryptodev_asym.c
index 0f6fc57..a779e8f 100644
--- a/test/test/test_cryptodev_asym.c
+++ b/test/test/test_cryptodev_asym.c
@@ -940,6 +940,7 @@ test_mod_inv(void)
 	const struct rte_cryptodev_asymmetric_xform_capability *capability;
 	uint8_t input[TEST_DATA_SIZE] = {0};
 	int ret = 0;
+	uint8_t result[sizeof(mod_p)] = { 0 };
 
 	if (rte_cryptodev_asym_get_xform_enum(
 		&modinv_xform.xform_type, "modinv") < 0) {
@@ -993,6 +994,8 @@ test_mod_inv(void)
 	memcpy(input, base, sizeof(base));
 	asym_op->modinv.base.data = input;
 	asym_op->modinv.base.length = sizeof(base);
+	asym_op->modinv.result.data = result;
+	asym_op->modinv.result.length = sizeof(result);
 
 	/* attach asymmetric crypto session to crypto operations */
 	rte_crypto_op_attach_asym_session(op, sess);
@@ -1055,6 +1058,7 @@ test_mod_exp(void)
 	const struct rte_cryptodev_asymmetric_xform_capability *capability;
 	uint8_t input[TEST_DATA_SIZE] = {0};
 	int ret = 0;
+	uint8_t result[sizeof(mod_p)] = { 0 };
 
 	if (rte_cryptodev_asym_get_xform_enum(&modex_xform.xform_type,
 		"modexp")
@@ -1109,6 +1113,8 @@ test_mod_exp(void)
 	memcpy(input, base, sizeof(base));
 	asym_op->modex.base.data = input;
 	asym_op->modex.base.length = sizeof(base);
+	asym_op->modex.result.data = result;
+	asym_op->modex.result.length = sizeof(result);
 	/* attach asymmetric crypto session to crypto operations */
 	rte_crypto_op_attach_asym_session(op, sess);
 
diff --git a/test/test/test_cryptodev_asym_util.h b/test/test/test_cryptodev_asym_util.h
index dff0c2a..b3d9fb4 100644
--- a/test/test/test_cryptodev_asym_util.h
+++ b/test/test/test_cryptodev_asym_util.h
@@ -20,8 +20,8 @@ static inline int rsa_verify(struct rsa_test_data *rsa_param,
 static inline int verify_modinv(uint8_t *mod_inv,
 		struct rte_crypto_op *result_op)
 {
-	if (memcmp(mod_inv, result_op->asym->modinv.base.data,
-				result_op->asym->modinv.base.length))
+	if (memcmp(mod_inv, result_op->asym->modinv.result.data,
+				result_op->asym->modinv.result.length))
 		return -1;
 	return 0;
 }
@@ -29,8 +29,8 @@ static inline int verify_modinv(uint8_t *mod_inv,
 static inline int verify_modexp(uint8_t *mod_exp,
 		struct rte_crypto_op *result_op)
 {
-	if (memcmp(mod_exp, result_op->asym->modex.base.data,
-				result_op->asym->modex.base.length))
+	if (memcmp(mod_exp, result_op->asym->modex.result.data,
+				result_op->asym->modex.result.length))
 		return -1;
 	return 0;
 }
-- 
2.1.0

  parent reply	other threads:[~2019-02-08 11:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08 11:13 [dpdk-dev] [PATCH v2 0/3] crypotodev: add result field to modular operations Arek Kusztal
2019-02-08 11:13 ` [dpdk-dev] [PATCH v2 1/3] cryptodev: add result field to mod exp and inverse operations Arek Kusztal
2019-02-12 10:55   ` Shally Verma
2019-02-28  9:59     ` Akhil Goyal
2019-02-28 10:44       ` Kusztal, ArkadiuszX
2019-02-28 10:52         ` Akhil Goyal
2019-02-08 11:13 ` [dpdk-dev] [PATCH v2 2/3] openssl: add result field to mod exp and mod inv operations Arek Kusztal
2019-02-08 11:13 ` Arek Kusztal [this message]
2019-02-12 11:00   ` [dpdk-dev] [PATCH v2 3/3] test: add result field to mod exp and mod inv Shally Verma
2019-02-08 12:31 ` [dpdk-dev] [PATCH v2 0/3] crypotodev: add result field to modular operations Trahe, Fiona
2019-03-19 14:02 ` Akhil Goyal
2019-03-19 14:02   ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190208111338.4544-4-arkadiuszx.kusztal@intel.com \
    --to=arkadiuszx.kusztal@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=shally.verma@caviumnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).