From patchwork Fri May 20 05:54:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arkadiusz Kusztal X-Patchwork-Id: 111497 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8A4F0A0503; Fri, 20 May 2022 09:03:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2184242BB3; Fri, 20 May 2022 09:03:08 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id BF41142BB3 for ; Fri, 20 May 2022 09:03:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653030185; x=1684566185; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=6i2OIIidb4DrV+/c92HcDwwsJs5xpwOeRSgGyuHbQVw=; b=ZoeKlm2CV2FfWjuQwj9eyV/keqYx2qQaOK+DRJcW5mzyUKBH9GtZ53lY +StHCrrwW8KUvvAL4XIK1K8cgy2cTVU7y5Naa0eHdwjBmBNdEWQaPmqtc YY1ef9WzZc+LPmo9uqim3oItZ/POI9PWvY/9R1Ew1/HiRVSnFuBksi9IM lFAIUJMO3YoxRmH78k0ZpQNT48NxG3uPWbgnqMxdwM3G6boOuLGPnePcd DBqN+F+LlyMtZ3Khsw1HH/gV52d1QC1//iNv0UNMb7mpSr34JUTWRS+TL NU1xSdYUNcqv6GWtC957s4kWesR5cgQ+O/mOx+c9O30BBPC9Nnf7qoLoz A==; X-IronPort-AV: E=McAfee;i="6400,9594,10352"; a="333140318" X-IronPort-AV: E=Sophos;i="5.91,238,1647327600"; d="scan'208";a="333140318" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2022 00:03:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,238,1647327600"; d="scan'208";a="599058231" Received: from silpixa00399302.ir.intel.com ([10.237.214.136]) by orsmga008.jf.intel.com with ESMTP; 20 May 2022 00:03:03 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, anoobj@marvell.com, roy.fan.zhang@intel.com, Arek Kusztal Subject: [PATCH 13/40] test/crypto: remove asym crypto next xform Date: Fri, 20 May 2022 06:54:18 +0100 Message-Id: <20220520055445.40063-14-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20220520055445.40063-1-arkadiuszx.kusztal@intel.com> References: <20220520055445.40063-1-arkadiuszx.kusztal@intel.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org - removed asymnetric crypto xform next field. This commit reflects changes to the asymmetric crypto API. Signed-off-by: Arek Kusztal --- app/test/test_cryptodev_asym.c | 100 ----------------------------- app/test/test_cryptodev_dh_test_vectors.h | 1 - app/test/test_cryptodev_dsa_test_vectors.h | 1 - app/test/test_cryptodev_mod_test_vectors.h | 2 - app/test/test_cryptodev_rsa_test_vectors.h | 2 - app/test/test_event_crypto_adapter.c | 4 -- 6 files changed, 110 deletions(-) diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c index 0098b6bf65..9e5d5e4f27 100644 --- a/app/test/test_cryptodev_asym.c +++ b/app/test/test_cryptodev_asym.c @@ -318,7 +318,6 @@ test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params, int ret, status = TEST_SUCCESS; - xform_tc.next = NULL; xform_tc.xform_type = data_tc->modex.xform_type; cap_idx.type = xform_tc.xform_type; @@ -1063,7 +1062,6 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm) /* Setup a xform and op to generate private key only */ xform.dh.type = RTE_CRYPTO_ASYM_KE_SHARED_SECRET_COMPUTE; - xform.next = NULL; asym_op->dh.priv_key.data = dh_test_params.priv_key.data; asym_op->dh.priv_key.length = dh_test_params.priv_key.length; asym_op->dh.pub_key.data = (uint8_t *)peer; @@ -1145,7 +1143,6 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm) /* Setup a xform and op to generate private key only */ xform.dh.type = RTE_CRYPTO_ASYM_KE_PRIVATE_KEY_GENERATE; - xform.next = NULL; asym_op->dh.priv_key.data = output; asym_op->dh.priv_key.length = sizeof(output); @@ -1228,7 +1225,6 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm) * */ xform.dh.type = RTE_CRYPTO_ASYM_KE_PUBLIC_KEY_GENERATE; - xform.next = NULL; asym_op->dh.pub_key.data = output; asym_op->dh.pub_key.length = sizeof(output); @@ -1288,94 +1284,6 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm) } static int -test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm) -{ - struct crypto_testsuite_params_asym *ts_params = &testsuite_params; - struct rte_mempool *op_mpool = ts_params->op_mpool; - struct rte_mempool *sess_mpool = ts_params->session_mpool; - uint8_t dev_id = ts_params->valid_devs[0]; - struct rte_crypto_asym_op *asym_op = NULL; - struct rte_crypto_op *op = NULL, *result_op = NULL; - void *sess = NULL; - int ret, status = TEST_SUCCESS; - uint8_t out_pub_key[TEST_DH_MOD_LEN]; - uint8_t out_prv_key[TEST_DH_MOD_LEN]; - struct rte_crypto_asym_xform pub_key_xform; - struct rte_crypto_asym_xform xform = *xfrm; - - /* set up crypto op data structure */ - op = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC); - if (!op) { - RTE_LOG(ERR, USER1, - "line %u FAILED: %s", - __LINE__, "Failed to allocate asymmetric crypto " - "operation struct"); - status = TEST_FAILED; - goto error_exit; - } - asym_op = op->asym; - /* Setup a xform chain to generate - * private key first followed by - * public key - */ - xform.dh.type = RTE_CRYPTO_ASYM_KE_PRIVATE_KEY_GENERATE; - pub_key_xform.xform_type = RTE_CRYPTO_ASYM_XFORM_DH; - pub_key_xform.dh.type = RTE_CRYPTO_ASYM_KE_PUBLIC_KEY_GENERATE; - xform.next = &pub_key_xform; - - asym_op->dh.pub_key.data = out_pub_key; - asym_op->dh.pub_key.length = sizeof(out_pub_key); - asym_op->dh.priv_key.data = out_prv_key; - asym_op->dh.priv_key.length = sizeof(out_prv_key); - - ret = rte_cryptodev_asym_session_create(dev_id, &xform, sess_mpool, &sess); - if (ret < 0) { - RTE_LOG(ERR, USER1, - "line %u FAILED: %s", __LINE__, - "Session creation failed"); - status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED; - goto error_exit; - } - - /* attach asymmetric crypto session to crypto operations */ - rte_crypto_op_attach_asym_session(op, sess); - - RTE_LOG(DEBUG, USER1, "Process ASYM operation"); - - /* Process crypto operation */ - if (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) != 1) { - RTE_LOG(ERR, USER1, - "line %u FAILED: %s", - __LINE__, "Error sending packet for operation"); - status = TEST_FAILED; - goto error_exit; - } - - while (rte_cryptodev_dequeue_burst(dev_id, 0, &result_op, 1) == 0) - rte_pause(); - - if (result_op == NULL) { - RTE_LOG(ERR, USER1, - "line %u FAILED: %s", - __LINE__, "Failed to process asym crypto op"); - status = TEST_FAILED; - goto error_exit; - } - debug_hexdump(stdout, "priv key:", - out_prv_key, asym_op->dh.priv_key.length); - debug_hexdump(stdout, "pub key:", - out_pub_key, asym_op->dh.pub_key.length); - -error_exit: - if (sess != NULL) - rte_cryptodev_asym_session_free(dev_id, sess); - if (op != NULL) - rte_crypto_op_free(op); - - return status; -} - -static int test_mod_inv(void) { struct crypto_testsuite_params_asym *ts_params = &testsuite_params; @@ -1611,12 +1519,6 @@ test_dh_keygenration(void) dh_test_params.priv_key.length); RTE_LOG(INFO, USER1, - "Test Public and Private key pair generation\n"); - - status = test_dh_gen_kp(&dh_xform); - TEST_ASSERT_EQUAL(status, 0, "Test failed"); - - RTE_LOG(INFO, USER1, "Test Public Key Generation using pre-defined priv key\n"); status = test_dh_gen_pub_key(&dh_xform); @@ -1828,7 +1730,6 @@ test_ecdsa_sign_verify(enum curve curve_id) asym_op = op->asym; /* Setup asym xform */ - xform.next = NULL; xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA; xform.ec.curve_id = input_params.curve; @@ -2030,7 +1931,6 @@ test_ecpm(enum curve curve_id) asym_op = op->asym; /* Setup asym xform */ - xform.next = NULL; xform.xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM; xform.ec.curve_id = input_params.curve; diff --git a/app/test/test_cryptodev_dh_test_vectors.h b/app/test/test_cryptodev_dh_test_vectors.h index fe7510dcd3..078719072d 100644 --- a/app/test/test_cryptodev_dh_test_vectors.h +++ b/app/test/test_cryptodev_dh_test_vectors.h @@ -63,7 +63,6 @@ struct dh_test_param dh_test_params = { }; struct rte_crypto_asym_xform dh_xform = { - .next = NULL, .xform_type = RTE_CRYPTO_ASYM_XFORM_DH, .dh = { .p = { diff --git a/app/test/test_cryptodev_dsa_test_vectors.h b/app/test/test_cryptodev_dsa_test_vectors.h index bbcb0d7297..cc60f50b5c 100644 --- a/app/test/test_cryptodev_dsa_test_vectors.h +++ b/app/test/test_cryptodev_dsa_test_vectors.h @@ -91,7 +91,6 @@ struct dsa_test_param dsa_test_params = { }; struct rte_crypto_asym_xform dsa_xform = { - .next = NULL, .xform_type = RTE_CRYPTO_ASYM_XFORM_DSA, .dsa = { .p = { diff --git a/app/test/test_cryptodev_mod_test_vectors.h b/app/test/test_cryptodev_mod_test_vectors.h index 807ca7a47e..bcd4d5248b 100644 --- a/app/test/test_cryptodev_mod_test_vectors.h +++ b/app/test/test_cryptodev_mod_test_vectors.h @@ -1045,7 +1045,6 @@ uint8_t mod_inv[] = { /* MODEX vector. 8< */ struct rte_crypto_asym_xform modex_xform = { - .next = NULL, .xform_type = RTE_CRYPTO_ASYM_XFORM_MODEX, .modex = { .modulus = { @@ -1061,7 +1060,6 @@ struct rte_crypto_asym_xform modex_xform = { /* >8 End of MODEX vector. */ struct rte_crypto_asym_xform modinv_xform = { - .next = NULL, .xform_type = RTE_CRYPTO_ASYM_XFORM_MODINV, .modinv = { .modulus = { diff --git a/app/test/test_cryptodev_rsa_test_vectors.h b/app/test/test_cryptodev_rsa_test_vectors.h index 04539a1ecf..e769dec1f4 100644 --- a/app/test/test_cryptodev_rsa_test_vectors.h +++ b/app/test/test_cryptodev_rsa_test_vectors.h @@ -346,7 +346,6 @@ uint8_t rsa_qInv[] = { /** rsa xform using exponent key */ struct rte_crypto_asym_xform rsa_xform = { - .next = NULL, .xform_type = RTE_CRYPTO_ASYM_XFORM_RSA, .rsa = { .n = { @@ -367,7 +366,6 @@ struct rte_crypto_asym_xform rsa_xform = { /** rsa xform using quintuple key */ struct rte_crypto_asym_xform rsa_xform_crt = { - .next = NULL, .xform_type = RTE_CRYPTO_ASYM_XFORM_RSA, .rsa = { .n = { diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c index 2ecc7e2cea..feb1d86c00 100644 --- a/app/test/test_event_crypto_adapter.c +++ b/app/test/test_event_crypto_adapter.c @@ -295,7 +295,6 @@ test_op_forward_mode(uint8_t session_less) #endif /* Setup Cipher Parameters */ cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; - cipher_xform.next = NULL; cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL; cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; @@ -474,7 +473,6 @@ test_asym_op_forward_mode(uint8_t session_less) return TEST_SKIPPED; } /* Setup Cipher Parameters */ - xform_tc.next = NULL; xform_tc.xform_type = RTE_CRYPTO_ASYM_XFORM_MODEX; cap_idx.type = xform_tc.xform_type; capability = rte_cryptodev_asym_capability_get(TEST_CDEV_ID, &cap_idx); @@ -672,7 +670,6 @@ test_op_new_mode(uint8_t session_less) #endif /* Setup Cipher Parameters */ cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; - cipher_xform.next = NULL; cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL; cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; @@ -807,7 +804,6 @@ test_asym_op_new_mode(uint8_t session_less) return TEST_SKIPPED; } /* Setup Cipher Parameters */ - xform_tc.next = NULL; xform_tc.xform_type = RTE_CRYPTO_ASYM_XFORM_MODEX; cap_idx.type = xform_tc.xform_type; capability = rte_cryptodev_asym_capability_get(TEST_CDEV_ID, &cap_idx);