From patchwork Tue Sep 7 08:39: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: 507521 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4033106jai; Tue, 7 Sep 2021 01:44:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6MJWRFR/3lNRc+ZWTwxpNHEFJdILJdXxJAumzJCgBb6LCtN17RAHWXt7CbaK3MQzSFhjI X-Received: by 2002:a17:906:ed1:: with SMTP id u17mr17818048eji.304.1631004292799; Tue, 07 Sep 2021 01:44:52 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id aq28si10131767ejc.374.2021.09.07.01.44.52; Tue, 07 Sep 2021 01:44:52 -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=SUqXuY8B; 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 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> 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: GvuIacpOzxTFJOkE3Tw3sVp7Ho7gE/dQyrKnlqMfLAglarNSMmFQRHmKPoTGkqt8nouwGMmRY88JhKxnD3gg2uYRMR4xjIHXbuR6vqD+mZqkEx7m+1mbepyj5T0gFT+Mx629eyFV2nNOdbJMX8F3qZU/BNogjaDcyU/y8ZfG3a+qbPulX4V+1R0dpkZpe8bTb5mB3h5KLSAlHxcX03brhaVzbEwAd5kNBRf+rxLZ0vUEM9RWeK8yB2Pk+vEjviGnckSmRfshc76+cAhLqhe6StN1pzB1MwfQ9csw0WsTbDZra65bEBd5ZkiOmuCgq1KhLX8cKiESrie3c29xf+XmQKSt/9YWHtHx4Eybv5GXmKdcRgCYmnYkqwDc93F/3ySK36rDuBdVTImoVIh0/7pSDCX7tOteL1ITIp0ed3+OHqtEed5BJYt+mBw8DbQg62dChQYR6T85Zc9FgBKlU2PDbBEErJzInE105b84xNWfFHH5N3NYy/Cv68fYU2VSE2F2YDr/1mBPczD+J7u7JL0n6EhtD3H+ZY3CQjCNzOsfMCrKhWZvIWXY6oHZim7Uuf3CRYzsmzmYFRwlu5oNEG85mF+1LQxBPdjnpCSw8ke6qkpiGTDWynku1mcx1jEp43vJeSdPCW43LuN+EOw1Ae63nq9JwB103EhGuFQdLnSRiZ7H0z04CnmuoTOdTkaqJdhsRq5uuP2j6aeoCxzGQ5rhGzVPlnnEtjysKSZ0SBeGWnr0cgE4nMHUGUrnyQosREO+hn63QVUNCpzUGTi5uZ4EZ8I2AjaxnYMQpFO1NMOjQvyUJXEldbOFtMPAP6zPw/JC8WcakNUdg8tptfRynBCnQM4Q6kE7IwrWuVvL7I9nkAnZm86MnYFYTVtW3gkd/n+GBsVVepFBnRVMoSY6/CsxDyiesy+cRiFnYu7Dk5SChoFKZwBAWelzNrBfCrpWYUYyW1WZcovaX9t6HTVZxQqtqbZUbaGM0489bWaO6JrlKYiC2vN3+0U4HfxIQP1qiLT/vCaLNhXDa5wL4gtperrUg3tvdKoLgQheDRPltQt7/5g2UQERyLJ/qCCDyKcDgOjoF2Zw5xPwNf0gBRCNKe8nJndjG+6yJklF6W2mQdm9wQYlu/DSViaqFlUUbe2549Z/C0ppB16Wf/WQlwP14Kheo+v4VSXLl06SdEu1CzmlBF8WgaJRp7AvWSJjWNG7cTOvJ3gYKr+ucqMeABn7v3BGE8eonT2Ynj7s7HEPgNLc0mC6mMexPPy1+fj5Mus2Oa5H+9CEUfJMdVCgs8dHeEpGGqoAyEu5VYf9tujWsYNgy0ErmNq0azdvoegxUJ7TyGtF 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(+) -- 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/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() };