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 7C63BA0613 for ; Mon, 26 Aug 2019 11:24:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4F26A1BFD9; Mon, 26 Aug 2019 11:24:10 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 284C61BFBD for ; Mon, 26 Aug 2019 11:24:05 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7Q9K45N029840; Mon, 26 Aug 2019 02:24:05 -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=pkP0OgvXV/b0K1lTz03n7twVM8tY9r/tn9RvRQwyGsCoyJcg3UTj5v7MbHrVtDxUKhmN WQZSEgJ0T+saVCyrrpYwYJ5w4Yijd9UPg30lNiYRALLztamOXiwYHoTWGlFDpKBEDwsZ u0SwML9+7d7YgkVX+v36dhBlYjciOqI4gqnqQnaj4VNKyJ8kLPrE3+DJXYG95/Y+fddK 6a/BJ7A6fUnVs/qHcUYH+kgvTou6zscCm1HDXvowUlx2CCk88PubU5nLKBHjJKkyGLcH TLaIGvuPdsDpaBJQNpxG+p4PAXGanQk2WATTV6HXpg2fW6tmQQUvH7X7tiH8lqTfU0Sz 6g== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2uk2kpxf3b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 26 Aug 2019 02:24:05 -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; Mon, 26 Aug 2019 02:24:03 -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; Mon, 26 Aug 2019 02:24:04 -0700 Received: from vvenus375.il.marvell.com (unknown [10.5.120.75]) by maili.marvell.com (Postfix) with ESMTP id 97F6E3F7048; Mon, 26 Aug 2019 02:24:02 -0700 (PDT) From: To: CC: , , Date: Mon, 26 Aug 2019 12:41:16 +0300 Message-ID: <20190826094120.22590-9-michaelsh@marvell.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190826094120.22590-1-michaelsh@marvell.com> References: <20190826094120.22590-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:5.22.84,1.0.8 definitions=2019-08-26_06:2019-08-23,2019-08-26 signatures=0 Subject: [dpdk-dev] [PATCH 08/12] examples/fips: AES-GCM decryption vectors fix 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