aboutsummaryrefslogtreecommitdiffstats
path: root/test/test/test_cryptodev_asym_util.h
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2018-08-14 18:55:37 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2018-08-14 18:57:39 +0100
commitae1479de3027a4a0f68d90bf65ac6ff2b862b837 (patch)
tree5dbca675b6717b6b61abbe1a9583d5166fed942b /test/test/test_cryptodev_asym_util.h
parent8cee230dd1f0f9f31f4b0339c671d0b1ee14e111 (diff)
parentb63264c8342e6a1b6971c79550d2af2024b6a4de (diff)
Merge branch 'upstream' into 18.08.x
Change-Id: Ifbda2d554199dd4d11e01f0090881b5f0103ae12 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'test/test/test_cryptodev_asym_util.h')
-rw-r--r--test/test/test_cryptodev_asym_util.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/test/test_cryptodev_asym_util.h b/test/test/test_cryptodev_asym_util.h
new file mode 100644
index 00000000..dff0c2ad
--- /dev/null
+++ b/test/test/test_cryptodev_asym_util.h
@@ -0,0 +1,42 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Cavium Networks
+ */
+
+#ifndef TEST_CRYPTODEV_ASYM_TEST_UTIL_H__
+#define TEST_CRYPTODEV_ASYM_TEST_UTIL_H__
+
+/* Below Apis compare resulted buffer to original test vector */
+
+static inline int rsa_verify(struct rsa_test_data *rsa_param,
+ struct rte_crypto_op *result_op)
+{
+ if (memcmp(rsa_param->data,
+ result_op->asym->rsa.message.data,
+ result_op->asym->rsa.message.length))
+ return -1;
+ return 0;
+}
+
+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))
+ return -1;
+ return 0;
+}
+
+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))
+ return -1;
+ return 0;
+}
+
+#endif /* TEST_CRYPTODEV_ASYM_TEST_UTIL_H__ */
+
+
+
+