]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/dpdk/app/test/test_cryptodev_asym_util.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / dpdk / app / test / test_cryptodev_asym_util.h
index b3d9fb4688da1cb0f5603ef06a952bd39929e1d0..83dc265dd75bb15866dc6b86dfc55b63de767bcf 100644 (file)
@@ -35,8 +35,26 @@ static inline int verify_modexp(uint8_t *mod_exp,
        return 0;
 }
 
-#endif /* TEST_CRYPTODEV_ASYM_TEST_UTIL_H__ */
-
-
+static inline int verify_ecdsa_sign(uint8_t *sign_r,
+               uint8_t *sign_s, struct rte_crypto_op *result_op)
+{
+       if (memcmp(sign_r, result_op->asym->ecdsa.r.data,
+                  result_op->asym->ecdsa.r.length) ||
+                  memcmp(sign_s, result_op->asym->ecdsa.s.data,
+                  result_op->asym->ecdsa.s.length))
+               return -1;
+       return 0;
+}
 
+static inline int verify_ecpm(uint8_t *result_x, uint8_t *result_y,
+                             struct rte_crypto_op *result_op)
+{
+       if (memcmp(result_x, result_op->asym->ecpm.r.x.data,
+                  result_op->asym->ecpm.r.x.length) ||
+                  memcmp(result_y, result_op->asym->ecpm.r.y.data,
+                  result_op->asym->ecpm.r.y.length))
+               return -1;
 
+       return 0;
+}
+#endif /* TEST_CRYPTODEV_ASYM_TEST_UTIL_H__ */