1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Cavium Networks
5 #ifndef TEST_CRYPTODEV_ASYM_TEST_UTIL_H__
6 #define TEST_CRYPTODEV_ASYM_TEST_UTIL_H__
8 /* Below Apis compare resulted buffer to original test vector */
10 static inline int rsa_verify(struct rsa_test_data *rsa_param,
11 struct rte_crypto_op *result_op)
13 if (memcmp(rsa_param->data,
14 result_op->asym->rsa.message.data,
15 result_op->asym->rsa.message.length))
20 static inline int verify_modinv(uint8_t *mod_inv,
21 struct rte_crypto_op *result_op)
23 if (memcmp(mod_inv, result_op->asym->modinv.result.data,
24 result_op->asym->modinv.result.length))
29 static inline int verify_modexp(uint8_t *mod_exp,
30 struct rte_crypto_op *result_op)
32 if (memcmp(mod_exp, result_op->asym->modex.result.data,
33 result_op->asym->modex.result.length))
38 static inline int verify_ecdsa_sign(uint8_t *sign_r,
39 uint8_t *sign_s, struct rte_crypto_op *result_op)
41 if (memcmp(sign_r, result_op->asym->ecdsa.r.data,
42 result_op->asym->ecdsa.r.length) ||
43 memcmp(sign_s, result_op->asym->ecdsa.s.data,
44 result_op->asym->ecdsa.s.length))
49 static inline int verify_ecpm(uint8_t *result_x, uint8_t *result_y,
50 struct rte_crypto_op *result_op)
52 if (memcmp(result_x, result_op->asym->ecpm.r.x.data,
53 result_op->asym->ecpm.r.x.length) ||
54 memcmp(result_y, result_op->asym->ecpm.r.y.data,
55 result_op->asym->ecpm.r.y.length))
60 #endif /* TEST_CRYPTODEV_ASYM_TEST_UTIL_H__ */