From patchwork Fri May 12 05:33:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 126828 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 E637F42ADD; Fri, 12 May 2023 07:34:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF72842686; Fri, 12 May 2023 07:34:47 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id ECAE0406B7 for ; Fri, 12 May 2023 07:34:45 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34C4ueVe022823; Thu, 11 May 2023 22:34:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=imM4TlycCtkkAPsvH9QFz+j8lWviNEreZyvyCmET/G8=; b=gynVKAb809OrDBZa3j5tab4o4Ugh5VYQtnlKM3cV8ekRYkP/xnN/4LOlDWnDsdLosfEL LGhfIogQYvw+UZHFg6ZDSdG9fu+4tJ05IOjinuQBq6V23O+0+7QOxHj7haVnF0v4R1qk ICEKLL3j9v4jJ6ap6r9J59Wdg7tw+/07uSpA61G/zIvEvLKpRxQReEo6muC/dabF6uTq tSAW2C7f+zW6ugjFH18MKPmffEeO4joKc0c5M2vgEFJqp3fP+mth/0SmYax12KyTcqtj cBY2fNaQxmK0hSiDAfCaMy2rLRrxFp3c+bWlObWXNKTLQeXronzLPdwsI9tjM9m53Ree xg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3qgwy3ba2p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 11 May 2023 22:34:45 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 11 May 2023 22:34:42 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Thu, 11 May 2023 22:34:42 -0700 Received: from BG-LT92004.corp.innovium.com (unknown [10.193.78.238]) by maili.marvell.com (Postfix) with ESMTP id DC7343F7062; Thu, 11 May 2023 22:33:54 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal , Fan Zhang , Ciara Power CC: Hemant Agrawal , Jerin Jacob , Tejasree Kondoj , Subject: [PATCH 1/2] test/crypto: use separate keys for auth and cipher Date: Fri, 12 May 2023 11:03:52 +0530 Message-ID: <20230512053353.68-1-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: Vu7Hp36x7861g-ybvInCOQTWORA9SRI1 X-Proofpoint-ORIG-GUID: Vu7Hp36x7861g-ybvInCOQTWORA9SRI1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-12_02,2023-05-05_01,2023-02-09_01 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 The mixed test cases can have keys with different key lengths. The routine which prepares the session parameters uses same key length for both cipher & auth keys. Instead allow the caller to use same keys as required. Signed-off-by: Anoob Joseph Acked-by: Akhil Goyal Acked-by: Ciara Power --- app/test/test_cryptodev.c | 48 +++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 31f4cb2cd5..5fdbe11094 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -2554,27 +2554,23 @@ create_wireless_algo_cipher_auth_session(uint8_t dev_id, enum rte_crypto_auth_operation auth_op, enum rte_crypto_auth_algorithm auth_algo, enum rte_crypto_cipher_algorithm cipher_algo, - const uint8_t *key, uint8_t key_len, + const uint8_t *a_key, uint8_t a_key_len, + const uint8_t *c_key, uint8_t c_key_len, uint8_t auth_iv_len, uint8_t auth_len, uint8_t cipher_iv_len) { - uint8_t cipher_auth_key[key_len]; - struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; - memcpy(cipher_auth_key, key, key_len); - /* Setup Authentication Parameters */ ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; ut_params->auth_xform.next = NULL; ut_params->auth_xform.auth.op = auth_op; ut_params->auth_xform.auth.algo = auth_algo; - ut_params->auth_xform.auth.key.length = key_len; - /* Hash key = cipher key */ - ut_params->auth_xform.auth.key.data = cipher_auth_key; + ut_params->auth_xform.auth.key.length = a_key_len; + ut_params->auth_xform.auth.key.data = a_key; ut_params->auth_xform.auth.digest_length = auth_len; /* Auth IV will be after cipher IV */ ut_params->auth_xform.auth.iv.offset = IV_OFFSET + cipher_iv_len; @@ -2586,12 +2582,13 @@ create_wireless_algo_cipher_auth_session(uint8_t dev_id, ut_params->cipher_xform.cipher.algo = cipher_algo; ut_params->cipher_xform.cipher.op = cipher_op; - ut_params->cipher_xform.cipher.key.data = cipher_auth_key; - ut_params->cipher_xform.cipher.key.length = key_len; + ut_params->cipher_xform.cipher.key.data = c_key; + ut_params->cipher_xform.cipher.key.length = c_key_len; ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; ut_params->cipher_xform.cipher.iv.length = cipher_iv_len; - debug_hexdump(stdout, "key:", key, key_len); + debug_hexdump(stdout, "Auth key:", a_key, c_key_len); + debug_hexdump(stdout, "Cipher key:", c_key, c_key_len); /* Create Crypto session*/ ut_params->sess = rte_cryptodev_sym_session_create(dev_id, @@ -2677,23 +2674,21 @@ create_wireless_algo_auth_cipher_session(uint8_t dev_id, enum rte_crypto_auth_operation auth_op, enum rte_crypto_auth_algorithm auth_algo, enum rte_crypto_cipher_algorithm cipher_algo, - const uint8_t *key, const uint8_t key_len, + const uint8_t *a_key, const uint8_t a_key_len, + const uint8_t *c_key, const uint8_t c_key_len, uint8_t auth_iv_len, uint8_t auth_len, uint8_t cipher_iv_len) { - uint8_t auth_cipher_key[key_len]; struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; - memcpy(auth_cipher_key, key, key_len); - /* Setup Authentication Parameters */ ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; ut_params->auth_xform.auth.op = auth_op; ut_params->auth_xform.next = &ut_params->cipher_xform; ut_params->auth_xform.auth.algo = auth_algo; - ut_params->auth_xform.auth.key.length = key_len; - ut_params->auth_xform.auth.key.data = auth_cipher_key; + ut_params->auth_xform.auth.key.length = a_key_len; + ut_params->auth_xform.auth.key.data = a_key; ut_params->auth_xform.auth.digest_length = auth_len; /* Auth IV will be after cipher IV */ ut_params->auth_xform.auth.iv.offset = IV_OFFSET + cipher_iv_len; @@ -2704,12 +2699,13 @@ create_wireless_algo_auth_cipher_session(uint8_t dev_id, ut_params->cipher_xform.next = NULL; ut_params->cipher_xform.cipher.algo = cipher_algo; ut_params->cipher_xform.cipher.op = cipher_op; - ut_params->cipher_xform.cipher.key.data = auth_cipher_key; - ut_params->cipher_xform.cipher.key.length = key_len; + ut_params->cipher_xform.cipher.key.data = c_key; + ut_params->cipher_xform.cipher.key.length = c_key_len; ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; ut_params->cipher_xform.cipher.iv.length = cipher_iv_len; - debug_hexdump(stdout, "key:", key, key_len); + debug_hexdump(stdout, "Auth key:", a_key, a_key_len); + debug_hexdump(stdout, "Cipher key:", c_key, c_key_len); /* Create Crypto session*/ if (cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT) { @@ -4908,6 +4904,7 @@ test_snow3g_cipher_auth(const struct snow3g_test_data *tdata) RTE_CRYPTO_AUTH_SNOW3G_UIA2, RTE_CRYPTO_CIPHER_SNOW3G_UEA2, tdata->key.data, tdata->key.len, + tdata->key.data, tdata->key.len, tdata->auth_iv.len, tdata->digest.len, tdata->cipher_iv.len); if (retval != 0) @@ -5037,6 +5034,7 @@ test_snow3g_auth_cipher(const struct snow3g_test_data *tdata, RTE_CRYPTO_AUTH_SNOW3G_UIA2, RTE_CRYPTO_CIPHER_SNOW3G_UEA2, tdata->key.data, tdata->key.len, + tdata->key.data, tdata->key.len, tdata->auth_iv.len, tdata->digest.len, tdata->cipher_iv.len); if (retval != 0) @@ -5242,6 +5240,7 @@ test_snow3g_auth_cipher_sgl(const struct snow3g_test_data *tdata, RTE_CRYPTO_AUTH_SNOW3G_UIA2, RTE_CRYPTO_CIPHER_SNOW3G_UEA2, tdata->key.data, tdata->key.len, + tdata->key.data, tdata->key.len, tdata->auth_iv.len, tdata->digest.len, tdata->cipher_iv.len); @@ -5443,6 +5442,7 @@ test_kasumi_auth_cipher(const struct kasumi_test_data *tdata, RTE_CRYPTO_AUTH_KASUMI_F9, RTE_CRYPTO_CIPHER_KASUMI_F8, tdata->key.data, tdata->key.len, + tdata->key.data, tdata->key.len, 0, tdata->digest.len, tdata->cipher_iv.len); @@ -5647,6 +5647,7 @@ test_kasumi_auth_cipher_sgl(const struct kasumi_test_data *tdata, RTE_CRYPTO_AUTH_KASUMI_F9, RTE_CRYPTO_CIPHER_KASUMI_F8, tdata->key.data, tdata->key.len, + tdata->key.data, tdata->key.len, 0, tdata->digest.len, tdata->cipher_iv.len); @@ -5828,6 +5829,7 @@ test_kasumi_cipher_auth(const struct kasumi_test_data *tdata) RTE_CRYPTO_AUTH_KASUMI_F9, RTE_CRYPTO_CIPHER_KASUMI_F8, tdata->key.data, tdata->key.len, + tdata->key.data, tdata->key.len, 0, tdata->digest.len, tdata->cipher_iv.len); if (retval != 0) @@ -6382,6 +6384,7 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata, RTE_CRYPTO_AUTH_ZUC_EIA3, RTE_CRYPTO_CIPHER_ZUC_EEA3, tdata->key.data, tdata->key.len, + tdata->key.data, tdata->key.len, tdata->auth_iv.len, tdata->digest.len, tdata->cipher_iv.len); @@ -6585,6 +6588,7 @@ test_zuc_auth_cipher_sgl(const struct wireless_test_data *tdata, RTE_CRYPTO_AUTH_ZUC_EIA3, RTE_CRYPTO_CIPHER_ZUC_EEA3, tdata->key.data, tdata->key.len, + tdata->key.data, tdata->key.len, tdata->auth_iv.len, tdata->digest.len, tdata->cipher_iv.len); @@ -7858,6 +7862,7 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata, tdata->auth_algo, tdata->cipher_algo, tdata->auth_key.data, tdata->auth_key.len, + tdata->cipher_key.data, tdata->cipher_key.len, tdata->auth_iv.len, tdata->digest_enc.len, tdata->cipher_iv.len); else @@ -7868,6 +7873,7 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata, tdata->auth_algo, tdata->cipher_algo, tdata->auth_key.data, tdata->auth_key.len, + tdata->cipher_key.data, tdata->cipher_key.len, tdata->auth_iv.len, tdata->digest_enc.len, tdata->cipher_iv.len); if (retval != 0) @@ -8071,6 +8077,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata, tdata->auth_algo, tdata->cipher_algo, tdata->auth_key.data, tdata->auth_key.len, + tdata->cipher_key.data, tdata->cipher_key.len, tdata->auth_iv.len, tdata->digest_enc.len, tdata->cipher_iv.len); else @@ -8081,6 +8088,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata, tdata->auth_algo, tdata->cipher_algo, tdata->auth_key.data, tdata->auth_key.len, + tdata->cipher_key.data, tdata->cipher_key.len, tdata->auth_iv.len, tdata->digest_enc.len, tdata->cipher_iv.len); if (retval != 0) From patchwork Fri May 12 05:33:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 126829 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 2A90F42ADD; Fri, 12 May 2023 07:34:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E837042F86; Fri, 12 May 2023 07:34:48 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id A220F406B7 for ; Fri, 12 May 2023 07:34:46 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34C4ueVf022823; Thu, 11 May 2023 22:34:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=uuQWxPVCYxV5H1+t/m+wByCdxRmAg6tScaCbXhX9XWQ=; b=B5FKZT3T43/0VhSwpr6Q+lK4srsZB72dCI/pL1xc8PxZmreI9IU9IioB5WRbc/oamfkb QBfc5qRRuJDCaK7U+74d8NVLsZROkCmWTwWDmFItwP52+YX/2lb7WeejcWd9g5lspuF5 w/BuW+weVSb/QDKRa7aYOq8tc7qZxoQHN0RK3jNJs16znxuOioTUdzkKr2aVmYCwpIID QBGZbjZqCBM0e/zXYpZi3Aq200hsqp6P5mRgW1lxJCxzQBsqV1+fIeJULcyQPN//vxUe gKFUU0+irDzY5GSzDN79iCAs9DAlThRbUwtMjT52sdJ90J2ZrXTQ5JfbhnWwvGzcjIg5 SQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3qgwy3ba2q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 11 May 2023 22:34:45 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 11 May 2023 22:34:43 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Thu, 11 May 2023 22:34:43 -0700 Received: from BG-LT92004.corp.innovium.com (unknown [10.193.78.238]) by maili.marvell.com (Postfix) with ESMTP id 15EE23F7210; Thu, 11 May 2023 22:33:57 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal , Fan Zhang , Ciara Power CC: Hemant Agrawal , Jerin Jacob , Tejasree Kondoj , Subject: [PATCH 2/2] test/crypto: specify correct parameters with null algos Date: Fri, 12 May 2023 11:03:53 +0530 Message-ID: <20230512053353.68-2-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230512053353.68-1-anoobj@marvell.com> References: <20230512053353.68-1-anoobj@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: RcDZ99coyMcuqwykePDis5ZchjtC7SUU X-Proofpoint-ORIG-GUID: RcDZ99coyMcuqwykePDis5ZchjtC7SUU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-12_02,2023-05-05_01,2023-02-09_01 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 Keys are not required for NULL algorithms. Same way IV, digest lengths should also be set to 0. The values are invalid and any PMD which validates such parameters would return "-ENOTSUP" for such cases which would result in false skipping of tests. Signed-off-by: Anoob Joseph Acked-by: Akhil Goyal --- app/test/test_cryptodev_aes_test_vectors.h | 114 ++++++------------- app/test/test_cryptodev_hash_test_vectors.h | 19 +--- app/test/test_cryptodev_mixed_test_vectors.h | 92 +++++---------- 3 files changed, 71 insertions(+), 154 deletions(-) diff --git a/app/test/test_cryptodev_aes_test_vectors.h b/app/test/test_cryptodev_aes_test_vectors.h index f3686beeb5..7127156cc4 100644 --- a/app/test/test_cryptodev_aes_test_vectors.h +++ b/app/test/test_cryptodev_aes_test_vectors.h @@ -894,19 +894,13 @@ static const struct blockcipher_test_data aes_test_data_21 = { /* NULL cipher NULL auth 8-byte multiple test vector */ static const struct blockcipher_test_data null_test_data_chain_x8_multiple = { .crypto_algo = RTE_CRYPTO_CIPHER_NULL, - .cipher_key = { /* arbitrary data - shouldn't be used */ - .data = { - 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, - 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C - }, - .len = 16 + .cipher_key = { + .data = { 0x0 }, + .len = 0 }, - .iv = { /* arbitrary data - shouldn't be used */ - .data = { - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, - 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF - }, - .len = 16 + .iv = { + .data = { 0x0 }, + .len = 0 }, .plaintext = { .data = plaintext_aes_common, @@ -917,41 +911,27 @@ static const struct blockcipher_test_data null_test_data_chain_x8_multiple = { .len = 512 }, .auth_algo = RTE_CRYPTO_AUTH_NULL, - .auth_key = { /* arbitrary data - shouldn't be used */ - .data = { - 0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA, - 0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD, - 0xDE, 0xF4, 0xDE, 0xAD - }, - .len = 20 + .auth_key = { + .data = { 0x0 }, + .len = 0 }, .digest = { - .data = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 - }, - .len = 20, - .truncated_len = 12 + .data = { 0x0 }, + .len = 0, + .truncated_len = 0 } }; /* NULL cipher NULL auth 4-byte multiple test vector */ static const struct blockcipher_test_data null_test_data_chain_x4_multiple = { .crypto_algo = RTE_CRYPTO_CIPHER_NULL, - .cipher_key = { /* arbitrary data - shouldn't be used */ - .data = { - 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, - 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C - }, - .len = 16 + .cipher_key = { + .data = { 0x0 }, + .len = 0 }, - .iv = { /* arbitrary data - shouldn't be used */ - .data = { - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, - 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF - }, - .len = 16 + .iv = { + .data = { 0x0 }, + .len = 0 }, .plaintext = { .data = plaintext_aes128ctr, @@ -962,41 +942,27 @@ static const struct blockcipher_test_data null_test_data_chain_x4_multiple = { .len = 20 }, .auth_algo = RTE_CRYPTO_AUTH_NULL, - .auth_key = { /* arbitrary data - shouldn't be used */ - .data = { - 0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA, - 0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD, - 0xDE, 0xF4, 0xDE, 0xAD - }, - .len = 20 + .auth_key = { + .data = { 0x0 }, + .len = 0 }, .digest = { - .data = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 - }, - .len = 20, - .truncated_len = 12 + .data = { 0x0 }, + .len = 0, + .truncated_len = 0 } }; /* NULL cipher NULL auth 1-byte multiple test vector */ static const struct blockcipher_test_data null_test_data_chain_x1_multiple = { .crypto_algo = RTE_CRYPTO_CIPHER_NULL, - .cipher_key = { /* arbitrary data - shouldn't be used */ - .data = { - 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, - 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C - }, - .len = 16 + .cipher_key = { + .data = { 0x0 }, + .len = 0 }, - .iv = { /* arbitrary data - shouldn't be used */ - .data = { - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, - 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF - }, - .len = 16 + .iv = { + .data = { 0x0 }, + .len = 0 }, .plaintext = { .data = plaintext_aes128ctr, @@ -1007,22 +973,14 @@ static const struct blockcipher_test_data null_test_data_chain_x1_multiple = { .len = 21 }, .auth_algo = RTE_CRYPTO_AUTH_NULL, - .auth_key = { /* arbitrary data - shouldn't be used */ - .data = { - 0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA, - 0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD, - 0xDE, 0xF4, 0xDE, 0xAD - }, - .len = 20 + .auth_key = { + .data = { 0x0 }, + .len = 0 }, .digest = { - .data = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 - }, - .len = 20, - .truncated_len = 12 + .data = { 0x0 }, + .len = 0, + .truncated_len = 0 } }; diff --git a/app/test/test_cryptodev_hash_test_vectors.h b/app/test/test_cryptodev_hash_test_vectors.h index fa9986a4da..06db248831 100644 --- a/app/test/test_cryptodev_hash_test_vectors.h +++ b/app/test/test_cryptodev_hash_test_vectors.h @@ -640,21 +640,14 @@ null_auth_test_vector = { .data = plaintext_hash, .len = 512 }, - .auth_key = { /* arbitrary data - shouldn't be used */ - .data = { - 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, - 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C - }, - .len = 16 + .auth_key = { + .data = { 0x0 }, + .len = 0 }, .digest = { - .data = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 - }, - .len = 20, - .truncated_len = 12 + .data = { 0x0 }, + .len = 0, + .truncated_len = 0 } }; diff --git a/app/test/test_cryptodev_mixed_test_vectors.h b/app/test/test_cryptodev_mixed_test_vectors.h index 2816ecc6a4..161e2d905f 100644 --- a/app/test/test_cryptodev_mixed_test_vectors.h +++ b/app/test/test_cryptodev_mixed_test_vectors.h @@ -1084,21 +1084,15 @@ struct mixed_cipher_auth_test_data auth_aes_cmac_cipher_zuc_test_case_1 = { struct mixed_cipher_auth_test_data auth_null_cipher_snow_test_case_1 = { .auth_algo = RTE_CRYPTO_AUTH_NULL, .auth_key = { - .data = { - 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, - 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E - }, - .len = 16, + .data = { 0x0 }, + .len = 0, }, .auth_iv = { - .data = { - 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, - 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD - }, - .len = 16, + .data = { 0x0 }, + .len = 0, }, .auth = { - .len_bits = 44 << 3, + .len_bits = 0, .offset_bits = 0, }, .cipher_algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, @@ -1163,21 +1157,15 @@ struct mixed_cipher_auth_test_data auth_null_cipher_snow_test_case_1 = { struct mixed_cipher_auth_test_data auth_null_cipher_zuc_test_case_1 = { .auth_algo = RTE_CRYPTO_AUTH_NULL, .auth_key = { - .data = { - 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, - 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E - }, - .len = 16, + .data = { 0x0 }, + .len = 0, }, .auth_iv = { - .data = { - 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, - 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD - }, - .len = 16, + .data = { 0x0 }, + .len = 0, }, .auth = { - .len_bits = 48 << 3, + .len_bits = 0, .offset_bits = 0, }, .cipher_algo = RTE_CRYPTO_CIPHER_ZUC_EEA3, @@ -1262,21 +1250,15 @@ struct mixed_cipher_auth_test_data auth_snow_cipher_null_test_case_1 = { }, .cipher_algo = RTE_CRYPTO_CIPHER_NULL, .cipher_key = { - .data = { - 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, - 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E - }, - .len = 16, + .data = { 0x0 }, + .len = 0, }, .cipher_iv = { - .data = { - 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, - 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD - }, - .len = 16, + .data = { 0x0 }, + .len = 0, }, .cipher = { - .len_bits = 52 << 3, + .len_bits = 0, .offset_bits = 0, }, .plaintext = { @@ -1342,21 +1324,15 @@ struct mixed_cipher_auth_test_data auth_zuc_cipher_null_test_case_1 = { }, .cipher_algo = RTE_CRYPTO_CIPHER_NULL, .cipher_key = { - .data = { - 0xc9, 0xe6, 0xce, 0xc4, 0x60, 0x7c, 0x72, 0xdb, - 0x00, 0x0a, 0xef, 0xa8, 0x83, 0x85, 0xab, 0x0a - }, - .len = 16, + .data = { 0x0 }, + .len = 0, }, .cipher_iv = { - .data = { - 0xa9, 0x40, 0x59, 0xda, 0x50, 0x00, 0x00, 0x00, - 0x29, 0x40, 0x59, 0xda, 0x50, 0x00, 0x80, 0x00 - }, - .len = 16, + .data = { 0x0 }, + .len = 0, }, .cipher = { - .len_bits = 77 << 3, + .len_bits = 0, .offset_bits = 0, }, .plaintext = { @@ -1410,21 +1386,15 @@ struct mixed_cipher_auth_test_data auth_zuc_cipher_null_test_case_1 = { struct mixed_cipher_auth_test_data auth_null_cipher_aes_ctr_test_case_1 = { .auth_algo = RTE_CRYPTO_AUTH_NULL, .auth_key = { - .data = { - 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, - 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E - }, - .len = 16, + .data = { 0x0 }, + .len = 0, }, .auth_iv = { - .data = { - 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, - 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD - }, - .len = 16, + .data = { 0x0 }, + .len = 0, }, .auth = { - .len_bits = 48 << 3, + .len_bits = 0, .offset_bits = 0, }, .cipher_algo = RTE_CRYPTO_CIPHER_AES_CTR, @@ -1507,19 +1477,15 @@ struct mixed_cipher_auth_test_data auth_aes_cmac_cipher_null_test_case_1 = { }, .cipher_algo = RTE_CRYPTO_CIPHER_NULL, .cipher_key = { - .data = { - 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, - 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C - }, - .len = 16, + .data = { 0x0 }, + .len = 0, }, .cipher_iv = { - .data = { - }, + .data = { 0x0 }, .len = 0, }, .cipher = { - .len_bits = 516 << 3, + .len_bits = 0, .offset_bits = 0, }, .plaintext = {