From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 95B3FA034F; Wed, 10 Nov 2021 14:05:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1606E4068B; Wed, 10 Nov 2021 14:05:21 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 1C82440683 for ; Wed, 10 Nov 2021 14:05:20 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1AAAI5Q8027251; Wed, 10 Nov 2021 05:05:19 -0800 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=XVo05hIymwfxYyWXAucwgnBKhrX4pHv6NEGeWokTrGo=; b=FzMW/sL2bxNvzrOBJ/jFEhxAYQTzPHJcTeRmKfPtG6vlASyAPCSniYY3E4GbtUwgMntb FTiiSj07MZhT0L+eSifJKzZaeb2LBA/zmeszoJ1GifPSKJehJKFFmADG6rqqKfVnaa5u QzYXmQvDyQfZIwRYeE5FfXtVf7ACc/aFGrUgeFqN1AcLX3I7KcF633MwHaqvNMM7BMp5 wG72i72sonFW1+2JjppsPtkd2Y8KpfMu1UKHfXOrcrexsOOvqGhoEZWTJhUUM+EF9BC6 ltW/paQYzkt2CvIAEIC4JWuN7JYzJN3s5OCu3gnUUTCaBMhBzZoqNPlx010xqVXpMMxQ 5w== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3c8c6wrj2h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 10 Nov 2021 05:05:19 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 05:05:17 -0800 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.18 via Frontend Transport; Wed, 10 Nov 2021 05:05:17 -0800 Received: from HY-LT1002.marvell.com (HY-LT1002.marvell.com [10.28.176.218]) by maili.marvell.com (Postfix) with ESMTP id 686D43F7072; Wed, 10 Nov 2021 05:05:11 -0800 (PST) From: Anoob Joseph To: Akhil Goyal , Declan Doherty , Fan Zhang , "Pablo de Lara" CC: Anoob Joseph , Jerin Jacob , Archana Muniganti , Tejasree Kondoj , Hemant Agrawal , "Radu Nicolau" , Ciara Power , Gagandeep Singh , Kai Ji , , Date: Wed, 10 Nov 2021 18:34:08 +0530 Message-ID: <1636549448-643-1-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1636384791-157-1-git-send-email-anoobj@marvell.com> References: <1636384791-157-1-git-send-email-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: fD7x_4Sby87Uw4va0CH1jccSD9Dbrpp6 X-Proofpoint-GUID: fD7x_4Sby87Uw4va0CH1jccSD9Dbrpp6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-10_04,2021-11-08_02,2020-04-07_01 Subject: [dpdk-dev] [PATCH v2] test/crypto: skip plain text compare for null cipher 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 Sender: "dev" NULL cipher is used for validating auth only cases. With NULL cipher, validating plain text should not be done as the PMD is only expected to update auth data. Fixes: e847fc512817 ("test/crypto: add encrypted digest case for AES-CTR-CMAC") Cc: adamx.dybkowski@intel.com Signed-off-by: Anoob Joseph --- Changes in v2: - Made the skip applicable for in place also (comment from Pablo) - Re-organized code as suggested by Pablo - Made same change in test_mixed_auth_cipher_sgl (comment from Pablo) app/test/test_cryptodev.c | 63 ++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 8137b8a..c223588 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -7343,27 +7343,30 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata, tdata->digest_enc.len); } - /* Validate obuf */ - if (verify) { - TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( - plaintext, - tdata->plaintext.data, - tdata->plaintext.len_bits >> 3, - "Plaintext data not as expected"); - } else { - TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( - ciphertext, - tdata->ciphertext.data, - tdata->validDataLen.len_bits, - "Ciphertext data not as expected"); - + if (!verify) { TEST_ASSERT_BUFFERS_ARE_EQUAL( ut_params->digest, tdata->digest_enc.data, - DIGEST_BYTE_LENGTH_SNOW3G_UIA2, + tdata->digest_enc.len, "Generated auth tag not as expected"); } + if (tdata->cipher_algo != RTE_CRYPTO_CIPHER_NULL) { + if (verify) { + TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( + plaintext, + tdata->plaintext.data, + tdata->plaintext.len_bits >> 3, + "Plaintext data not as expected"); + } else { + TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( + ciphertext, + tdata->ciphertext.data, + tdata->validDataLen.len_bits, + "Ciphertext data not as expected"); + } + } + TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, "crypto op processing failed"); @@ -7560,19 +7563,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata, tdata->digest_enc.data, tdata->digest_enc.len); } - /* Validate obuf */ - if (verify) { - TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( - plaintext, - tdata->plaintext.data, - tdata->plaintext.len_bits >> 3, - "Plaintext data not as expected"); - } else { - TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( - ciphertext, - tdata->ciphertext.data, - tdata->validDataLen.len_bits, - "Ciphertext data not as expected"); + if (!verify) { TEST_ASSERT_BUFFERS_ARE_EQUAL( digest, tdata->digest_enc.data, @@ -7580,6 +7571,22 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata, "Generated auth tag not as expected"); } + if (tdata->cipher_algo != RTE_CRYPTO_CIPHER_NULL) { + if (verify) { + TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( + plaintext, + tdata->plaintext.data, + tdata->plaintext.len_bits >> 3, + "Plaintext data not as expected"); + } else { + TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( + ciphertext, + tdata->ciphertext.data, + tdata->validDataLen.len_bits, + "Ciphertext data not as expected"); + } + } + TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, "crypto op processing failed"); -- 2.7.4