From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFAEFC3A5A6 for ; Thu, 19 Sep 2019 11:54:38 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 7DB3A21924 for ; Thu, 19 Sep 2019 11:54:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="IhwnFR69" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DB3A21924 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=marvell.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 58E341EF85; Thu, 19 Sep 2019 13:54:16 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 6CDC41EF6E; Thu, 19 Sep 2019 13:54:11 +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 x8JBokdk028485; Thu, 19 Sep 2019 04:54:10 -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=1K9tYhooGyBnDbitsliKXiuJuCsvOcwDGRhI9OjIezc=; b=IhwnFR69DBdDcZjeTIF0bPigIuObKigbVQ3+8H6lSfwJ7+aReoH0zk1+Cyo+Ltk4N4A1 +AiArpnUm9uQ0PwvLH8GH0dOnewAJ7+Hbs/daphW9FCR/RFLD6h74Dph4f02e+O5Dtm5 CD5mL1kJw1Z5PIY88+fpqZP6wmGAdq0LQrT60V0gn9R7ojwSm3a+1vYLGsOdflJnyVPQ +XCUfXnFdQc4TwiJdjByzQEU0sAxg8fuCWpb0mcC+6HaF46nKTlIItMkOR32tJWDWanY svkif0mxiCjwlwITwmqYMcniiKoKo4VstZQlZW6iC/fC9+EE4q4LZ9WZaNDVvMcBsD53 /w== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2v3vcfjn4k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 19 Sep 2019 04:54:10 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 19 Sep 2019 04:54:08 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 19 Sep 2019 04:54:08 -0700 Received: from vvenus375.il.marvell.com (unknown [10.5.120.75]) by maili.marvell.com (Postfix) with ESMTP id 1F0703F7040; Thu, 19 Sep 2019 04:54:06 -0700 (PDT) From: To: CC: , , , , Date: Thu, 19 Sep 2019 15:12:27 +0300 Message-ID: <20190919121232.4864-4-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 3/8] examples/fips_validation: initialize IV for AES-GCM 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 Configurated AES-GCM IV may include only salt value which length is 12B. In this case driver should set second part of IV to initial value = 0x1. Signed-off-by: Michael Shamis --- examples/fips_validation/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c index 813534068..193f36ed7 100644 --- a/examples/fips_validation/main.c +++ b/examples/fips_validation/main.c @@ -25,6 +25,7 @@ #define CRYPTODEV_BK_DIR_KEY "broken-test-dir" #define CRYPTODEV_ENC_KEYWORD "enc" #define CRYPTODEV_DEC_KEYWORD "dec" +#define IV_SALT_LEN 12 struct fips_test_vector vec; struct fips_test_interim_info info; @@ -580,10 +581,16 @@ prepare_aead_op(void) __rte_crypto_op_reset(env.op, RTE_CRYPTO_OP_TYPE_SYMMETRIC); rte_pktmbuf_reset(env.mbuf); - if (info.algo == FIPS_TEST_ALGO_AES_CCM) + if (info.algo == FIPS_TEST_ALGO_AES_CCM) { memcpy(iv + 1, vec.iv.val, vec.iv.len); - else + } else { memcpy(iv, vec.iv.val, vec.iv.len); + /* Set initial IV if specified only salt IV value */ + if (vec.iv.len == IV_SALT_LEN) { + memset(&iv[vec.iv.len], 0, 4); + iv[vec.iv.len + 3] = 1; + } + } sym->m_src = env.mbuf; sym->aead.data.offset = 0; -- 2.23.0