DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Ji, Kai" <kai.ji@intel.com>
To: "Nicolau, Radu" <radu.nicolau@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Akhil Goyal <gakhil@marvell.com>, Fan Zhang <fanzhang.oss@gmail.com>
Subject: Re: [PATCH 2/3] test/crypto: add QAT EC tests
Date: Wed, 27 Aug 2025 14:31:03 +0000	[thread overview]
Message-ID: <DS0PR11MB74580123ED0D3A10642F8B3C8138A@DS0PR11MB7458.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20250827092358.765222-2-radu.nicolau@intel.com>

[-- Attachment #1: Type: text/plain, Size: 5981 bytes --]

Acked-by: Kai Ji <kai.ji@intel.com>
________________________________
From: Radu Nicolau <radu.nicolau@intel.com>
Sent: 27 August 2025 10:23
To: dev@dpdk.org <dev@dpdk.org>
Cc: Nicolau, Radu <radu.nicolau@intel.com>; Akhil Goyal <gakhil@marvell.com>; Fan Zhang <fanzhang.oss@gmail.com>
Subject: [PATCH 2/3] test/crypto: add QAT EC tests

Add ECDH, ECPM and ECDSA tests for QAT

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 app/test/test_cryptodev_asym.c | 109 +++++++++++++++++++++++++++++++++
 1 file changed, 109 insertions(+)

diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 20afb5e98b..c62329edff 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -1715,6 +1715,29 @@ test_ecdsa_sign_verify_all_curve(void)
         return overall_status;
 }

+static int
+test_ecdsa_sign_verify_qat_curves(void)
+{
+       int status, overall_status = TEST_SUCCESS;
+       enum curve curve_id;
+       int test_index = 0;
+       const char *msg;
+
+       for (curve_id = SECP256R1; curve_id <= SECP521R1; curve_id++) {
+
+               status = test_ecdsa_sign_verify(curve_id);
+               if (status == TEST_SUCCESS) {
+                       msg = "succeeded";
+               } else {
+                       msg = "failed";
+                       overall_status = status;
+               }
+               printf("  %u) TestCase Sign/Veriy Curve %s  %s\n",
+                      test_index ++, curve[curve_id], msg);
+       }
+       return overall_status;
+}
+
 static int
 test_ecpm(enum curve curve_id)
 {
@@ -1881,6 +1904,28 @@ test_ecpm_all_curve(void)
         return overall_status;
 }

+static int
+test_ecpm_qat_curves(void)
+{
+       int status, overall_status = TEST_SUCCESS;
+       enum curve curve_id;
+       int test_index = 0;
+       const char *msg;
+
+       for (curve_id = SECP256R1; curve_id <= SECP521R1; curve_id++) {
+               status = test_ecpm(curve_id);
+               if (status == TEST_SUCCESS) {
+                       msg = "succeeded";
+               } else {
+                       msg = "failed";
+                       overall_status = status;
+               }
+               printf("  %u) TestCase EC Point Mul Curve %s  %s\n",
+                      test_index ++, curve[curve_id], msg);
+       }
+       return overall_status;
+}
+
 static int
 test_ecdh_priv_key_generate(enum curve curve_id)
 {
@@ -2674,6 +2719,56 @@ test_ecdh_all_curve(void)
         return overall_status;
 }

+static int
+test_ecdh_qat_curves(void)
+{
+       int status, overall_status = TEST_SUCCESS;
+       enum curve curve_id;
+       int test_index = 0;
+       const char *msg;
+
+       for (curve_id = SECP256R1; curve_id <= SECP521R1; curve_id++) {
+               status = test_ecdh_pub_key_generate(curve_id);
+               if (status == TEST_SUCCESS) {
+                       msg = "succeeded";
+               } else if (status == TEST_SKIPPED) {
+                       msg = "skipped";
+               } else {
+                       msg = "failed";
+                       overall_status = status;
+               }
+               printf("  %u) TestCase ECDH public key generation for Curve %s %s\n",
+                      test_index ++, curve[curve_id], msg);
+       }
+
+       for (curve_id = SECP256R1; curve_id <= SECP521R1; curve_id++) {
+               status = test_ecdh_pub_key_verify(curve_id);
+               if (status == TEST_SUCCESS) {
+                       msg = "succeeded";
+               } else {
+                       msg = "failed";
+                       overall_status = status;
+               }
+               printf("  %u) TestCase ECDH public key verification for Curve %s %s\n",
+                      test_index ++, curve[curve_id], msg);
+       }
+
+       for (curve_id = SECP256R1; curve_id <= SECP521R1; curve_id++) {
+               status = test_ecdh_shared_secret(curve_id);
+               if (status == TEST_SUCCESS) {
+                       msg = "succeeded";
+               } else {
+                       msg = "failed";
+                       overall_status = status;
+               }
+               printf("  %u) TestCase ECDH shared secret compute for Curve %s %s\n",
+                      test_index ++, curve[curve_id], msg);
+       }
+
+       return overall_status;
+}
+
+
 static int
 test_sm2_sign(void)
 {
@@ -3987,6 +4082,7 @@ static struct unit_test_suite cryptodev_openssl_asym_testsuite  = {
                         ut_setup_asym, ut_teardown_asym,
                         modular_exponentiation, &modex_group_test_cases[7]),
                 TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_eddsa_sign_verify_all_curve),
+
                 TEST_CASES_END() /**< NULL terminate unit test array */
         }
 };
@@ -4023,6 +4119,19 @@ static struct unit_test_suite cryptodev_qat_asym_testsuite  = {
                         "RSA Decryption (n=128, pt=20, e=3) CRT, Padding: NONE",
                         ut_setup_asym, ut_teardown_asym,
                         kat_rsa_decrypt_crt, &rsa_vector_128_20_3_none),
+               TEST_CASE_NAMED_ST(
+                       "ECDH Eliptic Curve tests",
+                       ut_setup_asym, ut_teardown_asym,
+                       test_ecdh_qat_curves),
+               TEST_CASE_NAMED_ST(
+                       "ECPM Eliptic Curve tests",
+                       ut_setup_asym, ut_teardown_asym,
+                       test_ecpm_qat_curves),
+               TEST_CASE_NAMED_ST(
+                       "ECDSA Eliptic Curve tests",
+                       ut_setup_asym, ut_teardown_asym,
+                       test_ecdsa_sign_verify_qat_curves),
+
                 TEST_CASES_END() /**< NULL terminate unit test array */
         }
 };
--
2.50.1


[-- Attachment #2: Type: text/html, Size: 14839 bytes --]

  reply	other threads:[~2025-08-27 14:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27  9:23 [PATCH 1/3] crypto/qat: Add ECDH, ECDSA and ECPM capabilities Radu Nicolau
2025-08-27  9:23 ` [PATCH 2/3] test/crypto: add QAT EC tests Radu Nicolau
2025-08-27 14:31   ` Ji, Kai [this message]
2025-08-27  9:23 ` [PATCH 3/3] crypto/qat: fix ECDH implementation Radu Nicolau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DS0PR11MB74580123ED0D3A10642F8B3C8138A@DS0PR11MB7458.namprd11.prod.outlook.com \
    --to=kai.ji@intel.com \
    --cc=dev@dpdk.org \
    --cc=fanzhang.oss@gmail.com \
    --cc=gakhil@marvell.com \
    --cc=radu.nicolau@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).