From patchwork Wed Jul 21 07:39:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 483265 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5941285jao; Wed, 21 Jul 2021 00:42:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAzihpLYIPH6I3OJMuU07sX22oNhvFZCCo2HziRIPdkARimSk508bvsOGahae08BWxbEa8 X-Received: by 2002:a17:906:616:: with SMTP id s22mr36851590ejb.210.1626853362365; Wed, 21 Jul 2021 00:42:42 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id x4si27204406edq.317.2021.07.21.00.42.42; Wed, 21 Jul 2021 00:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=M7wNbZUt; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19072410FE; Wed, 21 Jul 2021 09:42:26 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20085.outbound.protection.outlook.com [40.107.2.85]) by mails.dpdk.org (Postfix) with ESMTP id 39856410F1 for ; Wed, 21 Jul 2021 09:42:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z0LZLSWYM92zlbmAeUecQGpGCF0bG1TW+7ypd9XxB372I06xKyeCYdvlYXag7IA5X+cV1rm4hAAam/D55N3dpHL0PB8EqCb9H/xjCNPoQ83FMSKJ5jwFBTxi+u/nzeQEMb6o1RpkaKGcGCdrvG5vrG2tjQz4guRiU451Gy54GgFNO0prl943oRI28b32Sdb8Yy9AZWUoBdvIpNOQAHVOYFMVPB3IfllrDy5jrjGP9d7v51Gdbjy26uKkrW7BnydTcIrchSSiHLvgDEzk94g1gqsAC61KWBV6qh769sD03r5PM7diHEyGM57Kfnu3HqPQNc6pVxwnrKdjJrmsdINZWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rfy29COm8ATv7DsEuqJq9qmxajguJ7fE5qnCZryZnNg=; b=dAar43qo1qUwGM3RL2M1ubBxSDVIAuu10SKVCVpQu0QHclguRHAABfLOaJjZ4OEuCxYP3abCq7OKxfe+hqt+AKoYCuXXpWfwGR/2qvNT1Dj38pauJm+HYvF4W7phlJGviq8fDSJeDMw1rkVXVZ6oQ4R5q6hUDvAjd9tEmIwFeKKxKEumidt4u33+iTs33yVxGAQgP0MdY98/hIBCxCGTdWts3zYLNaem/Ll8CPygB7j6inYFOU06SV3jBkxsRp3D0m+VCMkgjwKeyHJEaAkzF2bnhkiU9d3Ph0MezztdqnPTacyDVyTW8ZOQ2b8DL9pl2NSEqExXWYAGTVtjcpSMiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rfy29COm8ATv7DsEuqJq9qmxajguJ7fE5qnCZryZnNg=; b=M7wNbZUtjN9JX0cb00HxayuBngtLWBsJGgoku0SWHrtWBUq6moxp1QZtPvgyT0JMOlFrSz6Lk1bjPOv/OlTeo+xBmQQwy+SBjKMlJ7v5/7bJqk67b7YgcdLCehMvvogfXCeWFJxN/akrZsipvETDlScuVY1yO0Qd3mJ6cSPTkvQ= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8581.eurprd04.prod.outlook.com (2603:10a6:10:2d8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.23; Wed, 21 Jul 2021 07:42:22 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::f483:9bb1:cde3:8a28]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::f483:9bb1:cde3:8a28%6]) with mapi id 15.20.4331.034; Wed, 21 Jul 2021 07:42:22 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: gakhil@marvell.com, Gagandeep Singh Date: Wed, 21 Jul 2021 13:09:19 +0530 Message-Id: <20210721073920.21893-4-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210721073920.21893-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR06CA0240.apcprd06.prod.outlook.com (2603:1096:4:ac::24) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR06CA0240.apcprd06.prod.outlook.com (2603:1096:4:ac::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Wed, 21 Jul 2021 07:42:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2c1583d5-c34b-4de8-23d8-08d94c1b1340 X-MS-TrafficTypeDiagnostic: DU2PR04MB8581: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1122; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CGRnHuwE0z3A6k8E5VTN/+AMvwv2SZou3SMlxzn0adY7ZYh0HwlBil7uf285H69qQde1rwEUYLEvOc9FsJZ6Ne/96KANmQqVYeGV/V6SID8PKxv7vpaQeCK1aIMFG8RNaMBXYEAiKWZZC9lk7pYbdUWeygiZEyZqEv7+53udWkbaoZi+H0diLVYQpThTYO7sbl/V4zdRKGa5hyCA2uRrxmwsEDjds6cHP5e62W4jj0TCHkJAy5baqvDz0Ke5fx8+lWNvjyLBFH3TJFNG7HR3XiQkZHUy2w2yac9GfvNgYlWqc4agLCtXmkNIvT6UFDDDqg24zouqIiJgOZ3oF9wjBVi/4+sidB/imjmK06iJORDq0gexy3x6GRWFXbfq8x8yAs5jcIZmjJQuUm/tKuO7gkADE2KNYDWumg1bWzV6dD60gmiChHpRjrzLD6K1Zb324Py+tfl95oAmR2DgB43LWA5pM22VWL7ac9qgf6nUI//M8MbESiih303NZ7GNop+WCIyhNjI+y1WnRI7LxjweyllVc6YwyIJf0Hwp+Jwr/uZCexqkNe6ejqeRILgMIWbZNipxNPilNvOdl4EuFpGLSatWA2mRqfD4JbUwi0uJk8nMSbaIsx119RgkkfKyrW+CBDp7FZmxSPvQL8NwBa50xRwPFGo6XzHvpmzh8qgbFJeQuo/rsEHVW5iJjBGl2RbhDMgp1NmZGb+kuzD2ZxN52g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(376002)(366004)(39860400002)(396003)(136003)(44832011)(6512007)(186003)(956004)(2616005)(66476007)(38100700002)(38350700002)(66946007)(1076003)(6506007)(5660300002)(8676002)(66556008)(36756003)(86362001)(26005)(83380400001)(2906002)(4326008)(8936002)(316002)(478600001)(6916009)(6486002)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +9x6G3gM+mF9mihjGWaf1842dwxmCqfI77LYwit6Qtw/n6RsdwoBJxsxQRwkIqfWq+iDnaxyN5TxG+gKjdC/fKQydyhicZXeQ46t1yj7PoxBMRUUmeB75y3qIHrAOPLwCFVxxrFP+vJ2FwmCdOKDtevIew+w4QTI/eeTF8BiwUs+BL9rk9I+DsFV+xCN7xMmWYbJNg4e/oAFGXUhJPK7z4MEVNSCJVTAi+KarLkOVTKDEwomSOzgTsCkeC4pUa45O2/lmTGakKFls13QG0lD3xBXcm16ZRIjnyh+nY3Gh/twL09ADfvmHc33oZLWC5qFsqYk6ZQ5qVQuQ+dim1tRwJZapllrXw0Tu3e5/3HsE9dBFREriZlCwppGnNHoy2LyunUZwOm7omIaiKcDMkDRwdyMwlcT5U2TLvYCj/YSWLnKCnYegcDWwirt/HyTwkuzxD64qaVF3mMnE0aHntIIk+q5hu+Q69F9GSo1vH92I20Vk9c1o0sB+3geYd2cMS7Eg3DGp6brckRm8FdYrOySGIIRni3+PXUryKZNUZtXuvT7/fE7JeatP4R44nQx2+jxIQhpDR8kS7OVR0HfGvYENTz9ZRGx4jiPJMoYDCiliUmX9sqzLULskfLZ/uWwxnjEqOeTkpKyaTS15As9XiLdqwta5p+t2WBr0sw/1hNFT7scTZvVWfdxPgZctpFl+uFFoSzmVeqqJ6uRrV357rmt8FIv5NACvDUoXbJlPmzkMEfhESPMvSHHiATEIFt6Xpn5Deu2zYWeQPzaKoIsxiVX0MAaEj/9mwcFC15HKupEDBL/BkZyEXPhXdtmWpZ8QnlFdZQdrIEwbNtijWLXaSZ8BDUUTM+oBOGiQ19nPOKeQ8ZC8IB2jXzpOWvLaFis1JR50swKj5sdZ1cf253jO5X79XkuMtXGyHxcUEUUdZLviOXvkgVSkDsRN98Iqc5Qi8gMwDMZVJJWgqUy2H1Yn8+uBgyZqcL3BM12IKoUOFHTO3eb90YNYHdNcyNyeKu2NZkesvZAC3dkKg3TFhw8T5QUO1S6frx9gmaU0ZRPl1LkCwoWW6HRaMlOGVzdDrXY+mjt61SZNDAadWRhzF5tnCUd3Y2PvpDu38ohYToz2PnDZLeYJwMYVf7VmIzOEe/adIoa++Uh/tN2shvIsEVaE/G8fsXM/Uqitu8HfIIXQGpNrJZtS0GK0iCJt2K6PR4cHVJ/tYC+n4bc5CfHdK8HwWgNCyMOOdiYJ2QPHZnL+Dy3Qi6Ml9faoM5P2Os5+sKA3Lw89yqc6RNmOQZ0M7K+vFOo17rGbVY9SI4oZtsusB5wPXesmSwc9xj3BMHdd81rew4+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c1583d5-c34b-4de8-23d8-08d94c1b1340 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2021 07:42:22.2296 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4ilkWVuJT9f/KMfMz7Botbd+G81ojhgubGMk+KtCC53PcMKVko00ZJ+L+lJaPbfGixfJ3RiHBdUFLg1Glw2dTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8581 Subject: [dpdk-dev] [PATCH 4/5] crypto/dpaa_sec: support AES-XCBC-MAC 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" From: Gagandeep Singh This patch adds support for AES-XCBC-MAC algo. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 1 + drivers/crypto/dpaa_sec/dpaa_sec.c | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index eab14da96c..d7bc319373 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -47,6 +47,7 @@ SHA512 = Y SHA512 HMAC = Y SNOW3G UIA2 = Y ZUC EIA3 = Y +AES XCBC MAC = Y ; ; Supported AEAD algorithms of the 'dpaa_sec' crypto driver. diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 95b9d7414f..fc9c3a4c2c 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -527,6 +527,14 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) !ses->dir, ses->digest_length); break; + case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + shared_desc_len = cnstr_shdsc_aes_mac( + cdb->sh_desc, + true, swap, SHR_NEVER, + &alginfo_a, + !ses->dir, + ses->digest_length); + break; default: DPAA_SEC_ERR("unsupported auth alg %u", ses->auth_alg); } @@ -2168,6 +2176,10 @@ dpaa_sec_auth_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.alg = OP_ALG_ALGSEL_ZUCA; session->auth_key.algmode = OP_ALG_AAI_F9; break; + case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + session->auth_key.alg = OP_ALG_ALGSEL_AES; + session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; + break; default: DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u", xform->auth.algo); @@ -2249,6 +2261,10 @@ dpaa_sec_chain_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.alg = OP_ALG_ALGSEL_SHA512; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + session->auth_key.alg = OP_ALG_ALGSEL_AES; + session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; + break; default: DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u", auth_xform->algo); @@ -2688,8 +2704,11 @@ dpaa_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform, case RTE_CRYPTO_AUTH_NULL: session->auth_key.alg = OP_PCL_IPSEC_HMAC_NULL; break; - case RTE_CRYPTO_AUTH_SHA224_HMAC: case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + session->auth_key.alg = OP_PCL_IPSEC_AES_XCBC_MAC_96; + session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; + break; + case RTE_CRYPTO_AUTH_SHA224_HMAC: case RTE_CRYPTO_AUTH_SNOW3G_UIA2: case RTE_CRYPTO_AUTH_SHA1: case RTE_CRYPTO_AUTH_SHA256: