* [dpdk-dev] [PATCH 0/3] crypotodev: add result field to modular operations
@ 2019-02-08 8:19 Arek Kusztal
2019-02-08 8:19 ` [dpdk-dev] [PATCH 1/3] cryptodev: add result field to mod exp and inverse operations Arek Kusztal
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Arek Kusztal @ 2019-02-08 8:19 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, fiona.trahe, shally.verma, Arek Kusztal
This patchset adds result field to modular exponentiation and modular
inverse operations
This patchset depends on following patches:
[1] - "[v3] cryptodev: rework mod exp and mod inv comments"
(http://patchwork.dpdk.org/patch/50139/)
[2] - "openssl: fix bad reference of modinv"
(http://patchwork.dpdk.org/patch/50131/)
Arek Kusztal (3):
cryptodev: add result field to mod exp and inverse operations
openssl: add result field to mod exp and mod inv operations
test: add result field to mod exp and mod inv
drivers/crypto/openssl/rte_openssl_pmd.c | 4 ++--
lib/librte_cryptodev/rte_crypto_asym.h | 10 ++++++++++
test/test/test_cryptodev_asym.c | 6 ++++++
test/test/test_cryptodev_asym_util.h | 8 ++++----
4 files changed, 22 insertions(+), 6 deletions(-)
--
2.1.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 1/3] cryptodev: add result field to mod exp and inverse operations
2019-02-08 8:19 [dpdk-dev] [PATCH 0/3] crypotodev: add result field to modular operations Arek Kusztal
@ 2019-02-08 8:19 ` Arek Kusztal
2019-02-08 8:19 ` [dpdk-dev] [PATCH 2/3] openssl: add result field to mod exp and mod inv operations Arek Kusztal
2019-02-08 8:19 ` [dpdk-dev] [PATCH 3/3] test: add result field to mod exp and mod inv Arek Kusztal
2 siblings, 0 replies; 4+ messages in thread
From: Arek Kusztal @ 2019-02-08 8:19 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, fiona.trahe, shally.verma, Arek Kusztal
This commit adds result field to be used when modular exponentiation or
modular multiplicative inverse operation is used
This patch depends on "cryptodev: rework mod exp and mod inv comments"
(http://patchwork.dpdk.org/patch/50132/)
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
lib/librte_cryptodev/rte_crypto_asym.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lib/librte_cryptodev/rte_crypto_asym.h b/lib/librte_cryptodev/rte_crypto_asym.h
index 0a50cd5..f5375bd 100644
--- a/lib/librte_cryptodev/rte_crypto_asym.h
+++ b/lib/librte_cryptodev/rte_crypto_asym.h
@@ -339,6 +339,16 @@ struct rte_crypto_mod_op_param {
* be relatively prime to modulus in corresponding Modular
* Multiplicative Inverse rte_crypto_modinv_xform
*/
+
+ rte_crypto_param result;
+ /**<
+ * Pointer to the result of modular exponentiation/multiplicative inverse
+ * data in octet-string network byte order format.
+ *
+ * This field shall be big enough to hold the result of Modular
+ * Exponentiation or Modular Multplicative Inverse
+ * (bigger or equal to length of modulus)
+ */
};
/**
--
2.1.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 2/3] openssl: add result field to mod exp and mod inv operations
2019-02-08 8:19 [dpdk-dev] [PATCH 0/3] crypotodev: add result field to modular operations Arek Kusztal
2019-02-08 8:19 ` [dpdk-dev] [PATCH 1/3] cryptodev: add result field to mod exp and inverse operations Arek Kusztal
@ 2019-02-08 8:19 ` Arek Kusztal
2019-02-08 8:19 ` [dpdk-dev] [PATCH 3/3] test: add result field to mod exp and mod inv Arek Kusztal
2 siblings, 0 replies; 4+ messages in thread
From: Arek Kusztal @ 2019-02-08 8:19 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, fiona.trahe, shally.verma, Arek Kusztal
This patch adds result field to modular exponentiation and modular
multiplicative inverse operations in openssl pmd functions
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
drivers/crypto/openssl/rte_openssl_pmd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 0230050..5096ca1 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -1790,7 +1790,7 @@ process_openssl_modinv_op(struct rte_crypto_op *cop,
if (BN_mod_inverse(res, base, sess->u.m.modulus, sess->u.m.ctx)) {
cop->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
- op->modinv.base.length = BN_bn2bin(res, op->modinv.base.data);
+ op->modinv.result.length = BN_bn2bin(res, op->modinv.result.data);
} else {
cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
}
@@ -1819,7 +1819,7 @@ process_openssl_modexp_op(struct rte_crypto_op *cop,
if (BN_mod_exp(res, base, sess->u.e.exp,
sess->u.e.mod, sess->u.e.ctx)) {
- op->modex.base.length = BN_bn2bin(res, op->modex.base.data);
+ op->modex.result.length = BN_bn2bin(res, op->modex.result.data);
cop->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
} else {
cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
--
2.1.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 3/3] test: add result field to mod exp and mod inv
2019-02-08 8:19 [dpdk-dev] [PATCH 0/3] crypotodev: add result field to modular operations Arek Kusztal
2019-02-08 8:19 ` [dpdk-dev] [PATCH 1/3] cryptodev: add result field to mod exp and inverse operations Arek Kusztal
2019-02-08 8:19 ` [dpdk-dev] [PATCH 2/3] openssl: add result field to mod exp and mod inv operations Arek Kusztal
@ 2019-02-08 8:19 ` Arek Kusztal
2 siblings, 0 replies; 4+ messages in thread
From: Arek Kusztal @ 2019-02-08 8:19 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, fiona.trahe, shally.verma, Arek Kusztal
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-02-08 8:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-08 8:19 [dpdk-dev] [PATCH 0/3] crypotodev: add result field to modular operations Arek Kusztal
2019-02-08 8:19 ` [dpdk-dev] [PATCH 1/3] cryptodev: add result field to mod exp and inverse operations Arek Kusztal
2019-02-08 8:19 ` [dpdk-dev] [PATCH 2/3] openssl: add result field to mod exp and mod inv operations Arek Kusztal
2019-02-08 8:19 ` [dpdk-dev] [PATCH 3/3] test: add result field to mod exp and mod inv Arek Kusztal
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).