From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F16FCA2EFC for ; Thu, 19 Sep 2019 13:54:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 473F91EF91; Thu, 19 Sep 2019 13:54:24 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 4171F1EF82; Thu, 19 Sep 2019 13:54:15 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8JBohWk028434; Thu, 19 Sep 2019 04:54:14 -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=pfpt0818; bh=PiywGOFmIkp+QnnEMoofqkTC3x98SnxnDGKMcbg6IVU=; b=WcovZjOsxTRKekwJkzxSp6n+r0RfXitJbk0YA+tMG4hIQGwO7nqLfRfR9qrzNvBioi6G soc/z8+UBdXOxYUivUR2M1ICmhvTBe9h4AQt3XwMpuC2/R9S5KlQC/KMHmXLowwldkuD m1R0F75fZs1ArPvr1EI1FNys0+f7dnhmkG2R4K+CxEYpfJYnSa7F3rAI7QekH81PyVWW JZX+CbJFx0yf+CUoywOa5xE3VP+daFHMtMueDzEliVue3apxXSopVWbkIDIJxed728rr E96sxAAmF2kdEqE6xhjOHYJe4iz+wxQEafP4B5GO8tH3Fga9adoQGfGxK/RuTYJUKPmC vA== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2v3vcfjn4w-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 19 Sep 2019 04:54:14 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 19 Sep 2019 04:54:13 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 19 Sep 2019 04:54:13 -0700 Received: from vvenus375.il.marvell.com (unknown [10.5.120.75]) by maili.marvell.com (Postfix) with ESMTP id 8E1153F7041; Thu, 19 Sep 2019 04:54:11 -0700 (PDT) From: To: CC: , , , , Date: Thu, 19 Sep 2019 15:12:29 +0300 Message-ID: <20190919121232.4864-6-michaelsh@marvell.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919121232.4864-1-michaelsh@marvell.com> References: <20190919121232.4864-1-michaelsh@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-19_04:2019-09-19,2019-09-19 signatures=0 Subject: [dpdk-dev] [PATCH 5/8] examples/fips_validation: fix AES-GCM decryption vector X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" From: Michael Shamis AES-GCM CAVS vectors for decryption set PTlen (plain text length) but provide crypto text and application expected CTlen to be not null. Now we assign PTlen to CTlen in decryption scenario and it allows to application to handle AES-GCM decryption vectors. Signed-off-by: Michael Shamis --- .../fips_validation/fips_validation_gcm.c | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/examples/fips_validation/fips_validation_gcm.c b/examples/fips_validation/fips_validation_gcm.c index ea48ddf70..f68b4ea82 100644 --- a/examples/fips_validation/fips_validation_gcm.c +++ b/examples/fips_validation/fips_validation_gcm.c @@ -33,10 +33,15 @@ #define NEG_TEST_STR "FAIL" +static int +parse_uint8_known_len_hex_str_dec(const char *key, + char *src, + struct fips_val *val); + struct fips_test_callback gcm_dec_vectors[] = { {KEY_STR, parse_uint8_known_len_hex_str, &vec.aead.key}, {IV_STR, parse_uint8_known_len_hex_str, &vec.iv}, - {CT_STR, parse_uint8_known_len_hex_str, &vec.ct}, + {CT_STR, parse_uint8_known_len_hex_str_dec, &vec.ct}, {AAD_STR, parse_uint8_known_len_hex_str, &vec.aead.aad}, {TAG_STR, parse_uint8_known_len_hex_str, &vec.aead.digest}, @@ -123,3 +128,19 @@ parse_test_gcm_init(void) return 0; } + +static int +parse_uint8_known_len_hex_str_dec(const char *key, + char *src, + struct fips_val *val) +{ + /* AES-GCM CAVS vectors for decryption set PTlen (plain text length) + * but provide crypto text. + * In order to compensate the behavior we assign PTlen to CTlen + * (crypto text length) which is used for calculations + */ + if (info.op == FIPS_TEST_DEC_AUTH_VERIF) + vec.ct.len = vec.pt.len; + + return parse_uint8_known_len_hex_str(key, src, val); +} -- 2.23.0