From patchwork Mon Feb 6 14:45:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar Muthukrishnan X-Patchwork-Id: 123144 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 B18B841C12; Mon, 6 Feb 2023 15:46:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA8B242D12; Mon, 6 Feb 2023 15:46:16 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 98C5A40FAE for ; Mon, 6 Feb 2023 15:46:15 +0100 (CET) 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 31688kg6015844; Mon, 6 Feb 2023 06:46:15 -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=QK6+en4WVSOmcq49zdQux3hyhsB2/4OjX0h6aMr9KWE=; b=R6xp3X+SgcZsAtf2fvJcbmMdGwq2cd8VSV0MlPnTQlOiDiceHSpxx9N2yx79Cde6NTmw ULpoB+zinaL/SPsvd0SJ3LJilgyOapCCqpDsOyufSQiiFLX6I/fttWdd3HvRPAdrkpO9 zM3SRI3ta6OltXMTtaDTpJldoWAkcl62GPKqM523NhGUSWFLje8ja7H4XcOUo+Exu2vN 1cwp7B8C0yNUUj1JtKOiluNAWxPe1buy+VRLfvh43e8L+GXvrFvUwzAD3cDUXWrQIV6o nA71LKZy2v0J6qFB66z5E0P3ndHZRemUCbYAbjknDhuCIOuUijNntuncfi7bRMh9w/hn JA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3nhqrtbkc8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 06 Feb 2023 06:46:14 -0800 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.42; Mon, 6 Feb 2023 06:46:12 -0800 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.42 via Frontend Transport; Mon, 6 Feb 2023 06:46:12 -0800 Received: from localhost.localdomain (unknown [10.28.34.38]) by maili.marvell.com (Postfix) with ESMTP id D40603F7050; Mon, 6 Feb 2023 06:46:10 -0800 (PST) From: Gowrishankar Muthukrishnan To: CC: Anoob Joseph , , Akhil Goyal , Brian Dooley , "Gowrishankar Muthukrishnan" Subject: [v1, 01/10] examples/fips_validation: fix MCT output for SHA Date: Mon, 6 Feb 2023 20:15:53 +0530 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Proofpoint-GUID: BV07pj1tBvqWkH-0bIh5AEoS5soQlVz3 X-Proofpoint-ORIG-GUID: BV07pj1tBvqWkH-0bIh5AEoS5soQlVz3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_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 MCT test for SHA need not print message string along with digest value. Fixes: d5c247145c2 ("examples/fips_validation: add parsing for SHA") Signed-off-by: Gowrishankar Muthukrishnan Acked-by: Brian Dooley --- examples/fips_validation/fips_validation_sha.c | 8 ++------ examples/fips_validation/main.c | 13 +++++-------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/examples/fips_validation/fips_validation_sha.c b/examples/fips_validation/fips_validation_sha.c index c5da2cc623..178ea492d3 100644 --- a/examples/fips_validation/fips_validation_sha.c +++ b/examples/fips_validation/fips_validation_sha.c @@ -182,7 +182,7 @@ parse_test_sha_json_writeback(struct fips_val *val) static int parse_test_sha_mct_json_writeback(struct fips_val *val) { - json_t *tcId, *msg, *md, *resArr, *res; + json_t *tcId, *md, *resArr, *res; struct fips_val val_local; tcId = json_object_get(json_info.json_test_case, "tcId"); @@ -208,11 +208,7 @@ parse_test_sha_mct_json_writeback(struct fips_val *val) res = json_object(); - writeback_hex_str("", info.one_line_text, &val[1]); - msg = json_string(info.one_line_text); - json_object_set_new(res, "msg", msg); - - val_local.val = val[0].val + vec.pt.len; + val_local.val = val->val + vec.pt.len; val_local.len = vec.cipher_auth.digest.len; writeback_hex_str("", info.one_line_text, &val_local); diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c index 622f8b5a6e..cc585e8418 100644 --- a/examples/fips_validation/main.c +++ b/examples/fips_validation/main.c @@ -2268,8 +2268,7 @@ fips_mct_sha_test(void) #define SHA_EXTERN_ITER 100 #define SHA_INTERN_ITER 1000 #define SHA_MD_BLOCK 3 - /* val[0] is op result and other value is for parse_writeback callback */ - struct fips_val val[2] = {{NULL, 0},}; + struct fips_val val = {NULL, 0}; struct fips_val md[SHA_MD_BLOCK], msg; int ret; uint32_t i, j; @@ -2328,7 +2327,7 @@ fips_mct_sha_test(void) return ret; } - ret = get_writeback_data(&val[0]); + ret = get_writeback_data(&val); if (ret < 0) return ret; @@ -2337,7 +2336,7 @@ fips_mct_sha_test(void) memcpy(md[1].val, md[2].val, md[2].len); md[1].len = md[2].len; - memcpy(md[2].val, (val[0].val + vec.pt.len), + memcpy(md[2].val, (val.val + vec.pt.len), vec.cipher_auth.digest.len); md[2].len = vec.cipher_auth.digest.len; } @@ -2348,9 +2347,7 @@ fips_mct_sha_test(void) if (info.file_type != FIPS_TYPE_JSON) fprintf(info.fp_wr, "COUNT = %u\n", j); - val[1].val = msg.val; - val[1].len = msg.len; - info.parse_writeback(val); + info.parse_writeback(&val); if (info.file_type != FIPS_TYPE_JSON) fprintf(info.fp_wr, "\n"); @@ -2361,7 +2358,7 @@ fips_mct_sha_test(void) rte_free(vec.pt.val); - free(val[0].val); + free(val.val); free(msg.val); return 0;