From patchwork Wed Sep 8 06:59:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507903 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp335044jai; Wed, 8 Sep 2021 00:04:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUB1mr1hLZ1+B1VoF/2gXn9QkeaaRua2uoF3KlzIEeyhCottNioa/rKX0nqVDOwk0OcY8B X-Received: by 2002:a17:907:7703:: with SMTP id kw3mr2559706ejc.34.1631084661112; Wed, 08 Sep 2021 00:04:21 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id dm14si1451641ejc.226.2021.09.08.00.04.20; Wed, 08 Sep 2021 00:04:21 -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=FLc8eH+o; 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 38FCB4112E; Wed, 8 Sep 2021 09:04:08 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60051.outbound.protection.outlook.com [40.107.6.51]) by mails.dpdk.org (Postfix) with ESMTP id 2BC034112E for ; Wed, 8 Sep 2021 09:04:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jOwOuNc7uFnhVUUyjRePU7FMIpcX2gHpwtMNExSa0A6W4d5CjPKG6711JI+LKjUbEUl0WhiSXVRRvmUp91yJU/yZ7Y1A/nF9rZGzPQ4fdSgh6Tz0AbHr6FhHbqS7cAKhOLYN/eC6oIkpnFAKQ3pGP0NCBPY8A1GmRN1yEiPO5bY+TxWGbFQwVuRJK9tQnsuAG/ANrlcZYdKjZjT2T7ohZNI+Eo764iJwTmcbzuCCaHGwxMKaRYgtFj34sAOg61dhIslU2EbIjUPVv+c3ZS9iylN/Lq64Jk/3fsrlD7oQJ7ATi0GH3/nhb4kBYCKt+1eAkNlqBVVVAzP5T4JX46pisQ== 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; bh=tf95+5hllGDtu1dcnGmZs7QJghQfh4G1qsqEqSKg/BA=; b=agucdvYbf5Yfx0ng74hRcHzAg8ZL4McfIKNl98tT/bWU+ysNe4nOj0wtyltYkX38JZRRadih+hPrGwhmQ42L8jyz1S5yFlFtZBgyYXKSsNs5PYtUgu14csZHELwQ6nOqtD3iwDdSwiutXLwkucC60K7g4i1DMem9htHm2zRMx9ie0/H1sA3yqpwy/bjWmur9z2VgmXQW9hg+Ui53pTTqZ7KZffbqRs/8ZdZ55cha3KN7w+bfc89GYwr5KykmJt7Dwhi60wIbgDX9IKm4ENh+ZW0jws0ogCiMGZWXuSitEfCx/iVKTcJhS4CbgUwh160vl4Tp1c9xTbj5Xcnf89YeOQ== 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=tf95+5hllGDtu1dcnGmZs7QJghQfh4G1qsqEqSKg/BA=; b=FLc8eH+oUqQlp+jUuEZV9l0KJWtEhszXsfNPbzLwMhSDxZe1v3VhwyLPaFrpVneRhPabeN9JarkSQxgziEkxWZoSu57vLKyrjjzao7n+K5s/hiJL75l2fTOGBp8IhQ3TBgDod0BXEWObKbTgc45JnJxOwVTpXcvwZiSi9CYNi3Q= 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 DU2PR04MB8903.eurprd04.prod.outlook.com (2603:10a6:10:2e2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Wed, 8 Sep 2021 07:04:06 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Wed, 8 Sep 2021 07:04:06 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Wed, 8 Sep 2021 12:29:47 +0530 Message-Id: <20210908065953.28349-4-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210908065953.28349-1-hemant.agrawal@nxp.com> References: <20210907083953.8948-1-hemant.agrawal@nxp.com> <20210908065953.28349-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) 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 SG2PR01CA0087.apcprd01.prod.exchangelabs.com (2603:1096:3:15::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 07:04:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ac6b54b6-a759-4063-6238-08d97296d926 X-MS-TrafficTypeDiagnostic: DU2PR04MB8903: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:359; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T60CChLvasO3PoQw7vkjhdUndSsm/ay+LZV8N3geUrL/5WMa7M+1H+O6LAsGkaj6tN8hY9TBiTbGVprsQNa9f4bJDcR1VmOWr/7DoYyCqQ6aa2ySxL6HoukJyajAYHrGnGGvVlOWWXe4hRgsonMM343iC4NJ+oMjk1MuIlx/el9bupbZOk4Mtji9EB333zx8ezJVnPwzP89hRrTvSqRczwy0csDv0tY/x3bEb/1yNZFoze09BKLcUdqb9Msc+w2bQ+sTQTQu5xn9BizTP/Da/1qZz/ZI8U9SpJJRbG6ZzwcjuMiMXgt2D9nU9h+0Dd+mVWJPO9D8nYCGau+SqADQ6lRdbN5g42G8DtHmKBbFSbvEyta5BR+/yOWU7Vh+6ArDCG3KlCC2Rj+wYzM0kQ2AcB85FGlYv8+SY5vDOJHzx5KywJza508ujmXKsDnPux6zt9Muc8tstl6VSeTeQhdR0EM/CxiGQBh2IAHvG5D+UceNRGLvjcqpKwwXt4x3Epm3/ZC2gTqLgElbvHnK4t/cuGeHVXTjyLWDxuN7AeHp6HtH18ySJJBnuWo7D9t3cAwNmGjBpskKDKJflw6PanHrSQkchOW/jlBcvLTCWyA4/vykfrsi3g8GKiJbhu3qxxkQd3cND+4Re93TcV1ET+SNUwCjlIyCrI+WufsYw7Q4L/Asr8h9NY3aljnCz65d8Qd36J6QQObS03Crtkq7mPAuMQ== 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)(366004)(136003)(396003)(39860400002)(346002)(376002)(52116002)(38100700002)(956004)(478600001)(83380400001)(86362001)(5660300002)(38350700002)(6666004)(6486002)(316002)(1076003)(2906002)(4326008)(44832011)(6512007)(6506007)(2616005)(36756003)(8936002)(66946007)(66556008)(186003)(66476007)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jPoPdy+OorYJZSbTz3EiZPxVJ4rv6N5J+cRDANKL4e1HCwaiPjB26nHPazyS2CZJMAThNL+NJm1sKC7Jfo/fmthVx39NFNWDirhfqxMGqibzIr15WF6ty3tvecQbv+5yjHf+dReVK5sp56IM2Esgf//j1sb74U8l4b3ZCoQGOdXTbXRljYFHFL5Vm9fp0Ru7CwPJGPyXEAvwuhd/Ipeo1EeAC1UtphrIkM7rlTwiA9Ff7wbJ1WronMzEdUKUIwN+Qrtd6w/IZXpYBm0OMi/c9YDmJzvtW4nBMj4kTzJNrRbaBcHSLbS/1ewe2GK1ZEABDQ+Uwcrv730nmD7jfQfMJqP5nd7vMqhVwTJ1w0dInxMufmPbmEHxYDJYBBXHWgrzQUJHol7/HskjsxCSOAJO8UrPSqFWA5F7okGaVJXVSqgWJDboJOsBAQIGDBt91oxb3zU8ooFVcVA22avo+SB8A+1KV7W4gNbLDTpvdPuSfnJnfFn25IAZbMAh3zR+SDdGtsRJ6G2BXv4QcvxHlwxyoPr2ZS1aB4qk6g3zHE5zpY22xmxRSZycT6B9UDNJhlz+MgSSMmmR7ge8ZB0EP7ZrV96uCwNlqh/SU8+Uk5yOERDGKbghGMaLv22kk9rTQ+bafiCv/mRRKm13S+NaUerpd9ZrbryX/OOUxDiVThKM1V2Z9ImJwOoP35Ddw6EJ8B/qQidzxmitTekIOsjK4Mrd4xtcOyY8uMKdD1SNafotEVu6n7mmSCtYo61ifiCSZQiUUpglGWL7fA+2HYPxLxNQp74ikTikJSHXris6a+6xuxPpnWB0I9qJLeN1GwLF0WgGJcYUak5dIvPAPi16g/PL1h5h+p9cofKoTYSg6h9CeYwB4V6tq9ZDSWNJW2dJQzF3ZODJhja5F4McnLLF11eaGaMcEhi2DZr+g44d0Zn6C+RC0L206chlice7ZYWxS2u5FQ0mvztp9dnbaZpUKMo5+XTGpIkekqJTnNsyiAainE8m9KbY6QOm9KxHCcU2HyWriPCQb+QgEgXHjYVbL6GbBZcwvQxiNMUjhb08CXN7ihPQmLe4O9IARP/MIoTTel1rEr8+dKFgih/rfqGD+s+BMgYc3Lxw3Pqi44SfXtCeX4fFs8hsJ5fQ4RcCmnAZ0IbLk2opVJdvVhZDgYptIAk27U3HoIm3KRiT5ljAociOo/uFAuB8nJmZ7b3CQjTWAf313/lbyVQje4O81U1YbiWlyC7dqdoYxia0NTJJ8f4nv+U1UZSG+/tCRZhI7NRig2IB8vDgblRXKezaVpCDmSNxbsFopXEukM04JUuzsaNAsOtw8TD9ZSNKGRFdDsQY5tlw X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac6b54b6-a759-4063-6238-08d97296d926 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 07:04:06.5309 (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: csdX7gvXLz+RcryUyAEC+ETI92bWm+qunyJfdgRwJ6eVm7g0cypqlsyBYKGzgZ9ioEuNvHUPuqTmyQskDFUq3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8903 Subject: [dpdk-dev] [PATCH v4 04/10] crypto/dpaa_sec: add support for AES CMAC integrity check 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_CMAC integrity in non-security mode. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 1 + doc/guides/rel_notes/release_21_11.rst | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 10 +++++ drivers/crypto/dpaa_sec/dpaa_sec.h | 43 +++++++++++++++++++++ 4 files changed, 55 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 d7bc319373..6a8f77fb1d 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -48,6 +48,7 @@ SHA512 HMAC = Y SNOW3G UIA2 = Y ZUC EIA3 = Y AES XCBC MAC = Y +AES CMAC (128) = Y ; ; Supported AEAD algorithms of the 'dpaa_sec' crypto driver. diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index b0da7e3135..bf4f1c389b 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -75,7 +75,7 @@ New Features * **Updated NXP dpaa_sec crypto PMD.** - * Added DES-CBC, AES-XCBC-MAC and non-HMAC algo support + * Added DES-CBC, AES-XCBC-MAC, AES-CMAC and non-HMAC algo support Removed Items ------------- diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index fc9c3a4c2c..c5416df726 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -528,6 +528,7 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) ses->digest_length); break; case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + case RTE_CRYPTO_AUTH_AES_CMAC: shared_desc_len = cnstr_shdsc_aes_mac( cdb->sh_desc, true, swap, SHR_NEVER, @@ -2180,6 +2181,10 @@ dpaa_sec_auth_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.alg = OP_ALG_ALGSEL_AES; session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; break; + case RTE_CRYPTO_AUTH_AES_CMAC: + session->auth_key.alg = OP_ALG_ALGSEL_AES; + session->auth_key.algmode = OP_ALG_AAI_CMAC; + break; default: DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u", xform->auth.algo); @@ -2265,6 +2270,10 @@ dpaa_sec_chain_init(struct rte_cryptodev *dev __rte_unused, session->auth_key.alg = OP_ALG_ALGSEL_AES; session->auth_key.algmode = OP_ALG_AAI_XCBC_MAC; break; + case RTE_CRYPTO_AUTH_AES_CMAC: + session->auth_key.alg = OP_ALG_ALGSEL_AES; + session->auth_key.algmode = OP_ALG_AAI_CMAC; + break; default: DPAA_SEC_ERR("Crypto: Unsupported Auth specified %u", auth_xform->algo); @@ -2700,6 +2709,7 @@ dpaa_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform, break; case RTE_CRYPTO_AUTH_AES_CMAC: session->auth_key.alg = OP_PCL_IPSEC_AES_CMAC_96; + session->auth_key.algmode = OP_ALG_AAI_CMAC; break; case RTE_CRYPTO_AUTH_NULL: session->auth_key.alg = OP_PCL_IPSEC_HMAC_NULL; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h index d500a4c246..c94d78e046 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -712,6 +712,49 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* AES CMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_AES_CMAC, + .block_size = 16, + .key_size = { + .min = 1, + .max = 16, + .increment = 1 + }, + .digest_size = { + .min = 12, + .max = 16, + .increment = 4 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* AES XCBC HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_AES_XCBC_MAC, + .block_size = 16, + .key_size = { + .min = 1, + .max = 16, + .increment = 1 + }, + .digest_size = { + .min = 12, + .max = 16, + .increment = 4 + }, + .aad_size = { 0 }, + .iv_size = { 0 } + }, } + }, } + }, RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() };