From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 75C2CA0C46; Tue, 7 Sep 2021 10:44:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 682BE4113B; Tue, 7 Sep 2021 10:44:40 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70043.outbound.protection.outlook.com [40.107.7.43]) by mails.dpdk.org (Postfix) with ESMTP id E9E4F41136 for ; Tue, 7 Sep 2021 10:44:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BRuRvy+CyeY2X5TXQ2Z4mkQiN2ExG4duogQ1HNfK5HGMx43utBig1j2iZH55iIpQYwh2X9RjP/3TF5xoQtO+ZVyeXetdSA2xlcHaxze2F7umH0JFN2zQv+xXviSXq6xUab81vGYaUFwIRqhvAlcEASaDh0wLneO5rFbdw1pMemTMyk2arjcUHoB4Y+QkbwxLg5Qh9/mdsBlO66yUrNapvG0NZmCMBHTtGWgOoKvIZY/86Xk/eiy5v/n9fpLvjA2vu6+aa1IquQAmXs6K046RoQjRSUk0nbYj/sIi7eeNNnMIsiWGWrRIP37cUlJLExO+FfRYWsQVlScHbd1Th2asMw== 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=bEIyEIZTFzPH8Q/eZ5eTHPrDk0xotFP+NSgPBWkjmkg=; b=cc8L9iuN9dG3d+dM+n6e8VQ67ppL5DgpOIKHVGc0EXtg6r19jQ05Pd1BDo4rTyIZbh8dRrJR+zEkj7vUJ52X599/mqmUlcULv/I0FSI74QAjoDluzCj8G7dW8MO6MBT8bVy6b9MVRtuYrFwC9O/h/UrHTtQ4DvJ5OUYOu2Va+jtUE+coFDirIm40IZVdForFVE/6joOWVPnRoDz5bXrotxRerLVVXa4WB2PcbGBtWh/wmT+f+BnYoa8MNlLigpxg9Uajn70wpvGjOXDnAlgI23fh5YIG0krGTZgITA4axf6KeGi7UeKl92rFBQfJ69kWUlIqj6282qREyXCUShupIQ== 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=bEIyEIZTFzPH8Q/eZ5eTHPrDk0xotFP+NSgPBWkjmkg=; b=SUqXuY8BWWNr7Sa8k8axTDWZ5oiHa+9mQeSbsBwyw9nVw3FaQv9rLYUYTX00mJMN218pmqVo+R4LVTcEfXn1SnYOw5sZPxj8Uigd609/oOF1IK/fwkIzzjsJHbjK960D+W47UNvzcP0OIsQg/1dpRd5OFeOwaldR6zY8kpEHvmM= 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 DU2PR04MB8949.eurprd04.prod.outlook.com (2603:10a6:10:2e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:44:37 +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; Tue, 7 Sep 2021 08:44:37 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Tue, 7 Sep 2021 14:09:47 +0530 Message-Id: <20210907083953.8948-4-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907083953.8948-1-hemant.agrawal@nxp.com> References: <20210825081837.23830-1-hemant.agrawal@nxp.com> <20210907083953.8948-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) 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 SGBP274CA0024.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Tue, 7 Sep 2021 08:44:35 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e504fb2e-6f53-430c-a9aa-08d971dbb94a X-MS-TrafficTypeDiagnostic: DU2PR04MB8949: 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: N4h4wQF7FxqrlcGL/H0cvMVCo5U0mNEhQefDiZlIBULZPUBBfx2800wsdPltJtL51h1iLpD6qEnGFifxHNdK2T4o+DkeYREoKBNIby5o66t7ClzpoMuwDFkp3ZJ6ELqD+j4vZuatHpN4katR85+c0kLWI7YF2SA6AZlyoT/ZwKM8TBeQzqjUyA/ieIX8YaaBsdgHRpqPlfDmKrtq3irGGoYw7GQHmlhfYsZp2zO65SkoWZ6QjxvCvbFKb+IkSl2zW9EFR20ZH6RmVTBg6aD0gF33cZcOij3xx5hMvVHo9+56Kl/0zpkUIZo3h/9R87mca++2F94xzpHwCddCvXJVUWWsWERoAm7rcPaA360uGgXzGlaArdcbijt7gQAnEv2zdSEw2RlCXhDUAwjMVWjCvaYAi43JGAaNflj1zOzTAuq3gDlQndeXvvqAnqfUaQYXUemeRyaBw1WzDWcOS+sgS8kcJ4kvirmlydWZYCI4HLJDflSn7PJdFRMMe2c5jKusc/W8yZW2M2vM5t825tFzgcHODMJgP65TW3ToMklCEuA5Vaiq3SurspPCa2OzJss6+wCQZupMAHyjTGkU13sf6fy2821RGAo7b/XFOCU7NHLPDOxjw71FW/ujmGzM1wvhgdFn/BOHSM7jRYpHPq2Ng/NZfhGr/rcdQaPntnuxKfYb8h08nAu5+969cSbssT3n8CkZPGHLG6gPCeZsvELdtw== 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)(396003)(366004)(136003)(376002)(346002)(39860400002)(86362001)(36756003)(38100700002)(38350700002)(316002)(44832011)(52116002)(6506007)(6512007)(186003)(2906002)(956004)(6666004)(5660300002)(8936002)(8676002)(6486002)(2616005)(26005)(1076003)(83380400001)(4326008)(66946007)(478600001)(66556008)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?GvuIacpOzxTFJOkE3Tw3sVp7Ho7gE/dQyrKnlqMfLAglarNSMmFQRHmKPoTG?= =?us-ascii?Q?kqt8nouwGMmRY88JhKxnD3gg2uYRMR4xjIHXbuR6vqD+mZqkEx7m+1mbepyj?= =?us-ascii?Q?5T0gFT+Mx629eyFV2nNOdbJMX8F3qZU/BNogjaDcyU/y8ZfG3a+qbPulX4V+?= =?us-ascii?Q?1R0dpkZpe8bTb5mB3h5KLSAlHxcX03brhaVzbEwAd5kNBRf+rxLZ0vUEM9RW?= =?us-ascii?Q?eK8yB2Pk+vEjviGnckSmRfshc76+cAhLqhe6StN1pzB1MwfQ9csw0WsTb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lwP14Kheo+v4VSXLl06SdEu1CzmlBF8WgaJR?= =?us-ascii?Q?p7AvWSJjWNG7cTOvJ3gYKr+ucqMeABn7v3BGE8eonT2Ynj7s7HEPgNLc0mC6?= =?us-ascii?Q?mMexPPy1+fj5Mus2Oa5H+9CEUfJMdVCgs8dHeEpGGqoAyEu5VYf9tujWsYNg?= =?us-ascii?Q?y0ErmNq0azdvoegxUJ7TyGtF?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e504fb2e-6f53-430c-a9aa-08d971dbb94a X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:44:37.1932 (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: fHPEIvXTIyXhsP08AVevQEFcOJlcWHPrZpu+ohWrcvhrjnXRfaJEAxcU6o8Zfhaq8LyBCac6B8tmZ1VQ03Qfzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8949 Subject: [dpdk-dev] [PATCH v3 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 + drivers/crypto/dpaa_sec/dpaa_sec.c | 10 +++++ drivers/crypto/dpaa_sec/dpaa_sec.h | 43 +++++++++++++++++++++ 3 files changed, 54 insertions(+) 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/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index dab0ad28c0..7d3f971f3c 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -525,6 +525,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, @@ -2177,6 +2178,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); @@ -2262,6 +2267,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); @@ -2697,6 +2706,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 153747c87c..faa740618f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -738,6 +738,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() }; -- 2.17.1