summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorArek Kusztal <arkadiuszx.kusztal@intel.com>2019-02-08 12:13:38 +0100
committerAkhil Goyal <akhil.goyal@nxp.com>2019-03-22 14:27:46 +0100
commit5e4fb861f7e2d2f744859a889f194f03f8846c8d (patch)
tree4a6cbc54e42438821626ace5669ae2debbc4e31b /app
parentaeded1117ca7d95738a18a73655ac71f9eb0939e (diff)
downloaddpdk-next-eventdev-5e4fb861f7e2d2f744859a889f194f03f8846c8d.zip
dpdk-next-eventdev-5e4fb861f7e2d2f744859a889f194f03f8846c8d.tar.gz
dpdk-next-eventdev-5e4fb861f7e2d2f744859a889f194f03f8846c8d.tar.xz
test: add result field to mod exp and inv
This patch adds result field to modular exponentiation and modular multiplicative inverse tests Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com> Acked-by: Shally Verma <shallyv@marvell.com>
Diffstat (limited to 'app')
-rw-r--r--app/test/test_cryptodev_asym.c6
-rw-r--r--app/test/test_cryptodev_asym_util.h8
2 files changed, 10 insertions, 4 deletions
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 0f6fc57..a779e8f 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/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/app/test/test_cryptodev_asym_util.h b/app/test/test_cryptodev_asym_util.h
index dff0c2a..b3d9fb4 100644
--- a/app/test/test_cryptodev_asym_util.h
+++ b/app/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;
}