From patchwork Wed Jul 21 07:39:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 483262 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5941067jao; Wed, 21 Jul 2021 00:42:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvTHkKLaRMzH4g+28DDs+MZmBrAdwK+bkwbapX+UqRbIW4x5Qo61XGyiUpTeQbVpYVS4ZR X-Received: by 2002:adf:90c6:: with SMTP id i64mr41769017wri.168.1626853339839; Wed, 21 Jul 2021 00:42:19 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id p17si1663255wru.51.2021.07.21.00.42.19; Wed, 21 Jul 2021 00:42:19 -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=aBUmvpZQ; 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 195E640689; Wed, 21 Jul 2021 09:42:19 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20075.outbound.protection.outlook.com [40.107.2.75]) by mails.dpdk.org (Postfix) with ESMTP id 3742A4014E; Wed, 21 Jul 2021 09:42:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XAIJKJCPS0qEYJjZOOQ05PYyNrfO3CJ86XVaX6F1516bvb07PejX8UQq4LqHrxVjlDu/ceSEN4cptoKiee+51HbaFLMdU/awMQG+yB7+JO9Am1+/8Y2OnXLqIquKvJhrdSUfYHRlDXsqDY2NJF3T01zQSjkbw/sTEblhGF6P1P4ntI5KHherm/vphlJSzwe3qAcQpfj06UG8eIDdUQrTrG7DxPQnZ2QH40xuRgf/Dh8cCG8WlYqRIzp9kFuYebo0jU2VU0ezgBm8wVTcmENVrsAwAkNTGqXG4STZncoe8mM412KUVNdF523X55WGxxd6uyMfHheHIJsprcWc+KtIdQ== 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=fhkYWX0GAVb6WIZc9B6JYgXV9puFDbiB5csNptWIb7Q=; b=DjMORh1IVsm2DFvl/foIOcHVkPWNY2SbLjl2p703X/CJ+rb0miU+g56QBWQYjXJvHJ3/kWwyMyK1UNGQVmACBOLHbzhH3ENVZk12LzSdb2MApLvSge5PMMK8g+fVRPXLzqu/IV+iCyBe0YvPyruFYbUwtOP9l6n9ilH7J0lTa+fN2pHvnvaqyR8bkAZNOlC9ZGcAHBM+OxoFCT6k/2OneQemgHWcG1pd1rtClwTvD1fZzQo7UI27ilVAcEjhN0bz+GU19e/jAHbr34cBmoeEBKgmlXJ35WvjpAn9HdzC9sfcosJ3xtuAvLEwIxINHtdCxwZAoIt9dyRDSmfqRB3BHw== 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=fhkYWX0GAVb6WIZc9B6JYgXV9puFDbiB5csNptWIb7Q=; b=aBUmvpZQO2IVj7+3+jFHfsqPW9HwXG5AVdTiFKi3ezEsQLHdnBa+JDa1WBHKo39BLBv3ePtFumkVgqysgS5gOJMYMG6eREKTN6clAS0D/KOdr+dkBUsX1iL+suRUn7nxCJcmrvVrkli8KNmRiVcDPNExQvlrlRCMDAz7h2zAkco= 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:17 +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:16 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: gakhil@marvell.com, stable@dpdk.org Date: Wed, 21 Jul 2021 13:09:16 +0530 Message-Id: <20210721073920.21893-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 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:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 50a442b6-7e95-4929-5229-08d94c1b0ff3 X-MS-TrafficTypeDiagnostic: DU2PR04MB8581: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7C1r8R1m2N8xeHHJ62tPStpUSekmkeTQnSh9R3lJpu6tdFsqTWHCjmZd56ckYhdgM6BQCD/SPojO64iWtLYY5FpDsf6eGiyCpCUTVdcinr6RZheAo6WdIs7BEdfgeCfs26ONboR/ALHPyoGpJFIOHj1HJRnxL8EfuQiy/VNKkH/AO1Ibjzr8I/Zt1pXRWhIV8NAPOQ+BLVi7yILqV78UIswHN6R/kuvMK+xtN1N2ErWRHxY4F9pfe4xKCKOjIclaGkx+uAVdK7bbAnn+jR4WOhGMOD0FDPIjvn/4FUeX6AzdWMMFsWr7+3TdxxupOINLiakMigYFBXgw8HHxMhwdoqOtqpOPzApJvJcG2NqxKO+IbclsHsvRe73jmHLPTELhF+mjHl5EuoPjT3AcXhcBHSB4yLNMb65mmfKEMbVcr2JwHor1fBnhPF4nJNSUDgY4lW3cWityc6h+B96GCEViUiDh9K3bRecIpNRWee2kf21olWIQwZe8CPVK12v+DOGUVHL/PVJ2Mcih/herfgOkQnH3kUkCEO3mHQZa6P8ZZeiVV+vctNpOjRagsVfQrMjljj8Uonc9VjmwlDzJkQ2T5onIJKTKDxviV49iJ5Dybklo/qlFIPtaaYahJqJSodLGAyanapCQ34GFdDKFtF7KjnRtLlPj1hGLIt4oeSP7zmQjbWbZ3oTAYqrnuTyvn75omxSmD1PntsweRHv5KAZcXw== 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: adpFVxzQ1cuWIX3kaaGXtu5a9vC2JAWYVIpgewXnpgUmeLkivLQGiGua7JjTxirnlSiyMlVm46e1WPmJNnRJ+KEHJgrThJVKNnPIyjMb5ejq6zd4rYKExKN65Tx337wdAMknyIte2CtjKChfgKDmlySddssISbw50yDODYTGqUDItdBDsDWgXJ5vf240FhRiGYYyq9IqLtAQ17XoCx2+PVVnN6X5qg+QA1fS13TaJecSGOyed482yznOJX+yMb2BwWyQWPNw/t8XdKkN2XNz8b8sYfJkGaZve6pdDAZTgZvkQY8zuBYDRuSzLgQP1iiUBeZtNAYo2TuBYoZ0Lhof0DM21tmeFgCdMh99+MV4zSVxO175v91CmGlOCSaq1yEuX1s05BrokLWjSja7z/6aaCgb2n6qfIZZ3Bb31ILLvc6MDEk/xrWBIXnHvxATvDRlvhvgjdsxz1cuqK9JCfH0FJk6qBjF4mY/GdHwd3aCR0ADx7NQ+1I148KhyHZDk35YEIw9vCcxp8RrI7/OE5YTALdIAg8YMJY2jS81svNnBBqTCladXGF7HHGQeXrmBa9I4vtSpBPWP+9CsCLvX8ZtkLFgfjlcV+pepfJo11IejHBq91B1QlRox3R2qfNkZjp/VYHgs1GPlZWF6TNPju4u6sL+qr47D2QeTP0vB1r2ehvS7PMN8o6a/ZmwXMIaW6Up6HG5D1Ry9A8lxdTofW+iWsE+AW1WJsKrXRWYRtcDLIRONiRZ42huANsz8umHGpHuPtK4KlkVvekmgc0wQmSrLtBvhbpiCXtkA9IL8gffu57Z84Y5peBtRwHN5tZWbhu2CWWPnoT6UUefGhrCwotFvFYzP7qy0o4fRAH+P4L4h1zbDsbDlY9F2nEyhjqgORDGKQMjmTVDHJn/lqxyrb+v2b0jW8y2tPLX59z3aj4HYiS4p4Z8d1FpNcTVwIbDBxBIbyYMxyAP5n+Wb35sP+apAlBmOjXVXuDdBbPNGIf4/bBrHvvBDQrV1AN50kd1SKNS8eWLKsb6T5PZ8d8hJtVNlxbtTgpKK9dXSg2DmcpqpIEjTBctug8o2HUXRJhrDsScnsAicJ/KWA0TOiomP8wtqWb/F6h5KrB20n1NW9kVyvhrCo66Rmykp07RiMrZhbPCKC6rdlMr6mEhLYnTp/g9kNDTHurB+K6gsjPX7Bas75ITXTO8QzuwfPIAYdciHMQR7BA0xW5YKUiaR3WUpCIwqmcqLKSscK0zCitwreVfSq8+092lGD+iPvC8yT3novYPsFTIKyWscakAlLcIpq4Q8qyDE0m1E8lBwSi2IlAD0RCfWGNFQrrCn27IJIJc1TY1 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50a442b6-7e95-4929-5229-08d94c1b0ff3 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:16.7268 (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: ZysuGfv+KlbFARJlX3d+rSckZxqmiFMPpxZaRuuxXpxd1mwWUj9OWRKxxhXejlZXusbeOfkVgSEiiO2wnS7LoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8581 Subject: [dpdk-dev] [PATCH 1/5] crypto/dpaa2_sec: fix to check next null for auth only case 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" This patch fixes the issue to check for next pointer as null in the integrity only case in pdcp-security context. Fixes: bef594ec5cc8 ("crypto/dpaa2_sec: support PDCP offload") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 25 +++++++++++---------- 1 file changed, 13 insertions(+), 12 deletions(-) -- 2.17.1 diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 1ccead3641..4438486a8b 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3102,7 +3102,7 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, struct rte_security_pdcp_xform *pdcp_xform = &conf->pdcp; struct rte_crypto_sym_xform *xform = conf->crypto_xform; struct rte_crypto_auth_xform *auth_xform = NULL; - struct rte_crypto_cipher_xform *cipher_xform; + struct rte_crypto_cipher_xform *cipher_xform = NULL; dpaa2_sec_session *session = (dpaa2_sec_session *)sess; struct ctxt_priv *priv; struct dpaa2_sec_dev_private *dev_priv = dev->data->dev_private; @@ -3134,18 +3134,18 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, flc = &priv->flc_desc[0].flc; /* find xfrm types */ - if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER && xform->next == NULL) { - cipher_xform = &xform->cipher; - } else if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER && - xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH) { - session->ext_params.aead_ctxt.auth_cipher_text = true; + if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { cipher_xform = &xform->cipher; - auth_xform = &xform->next->auth; - } else if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH && - xform->next->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { - session->ext_params.aead_ctxt.auth_cipher_text = false; - cipher_xform = &xform->next->cipher; + if (xform->next != NULL) { + session->ext_params.aead_ctxt.auth_cipher_text = true; + auth_xform = &xform->next->auth; + } + } else if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) { auth_xform = &xform->auth; + if (xform->next != NULL) { + session->ext_params.aead_ctxt.auth_cipher_text = false; + cipher_xform = &xform->next->cipher; + } } else { DPAA2_SEC_ERR("Invalid crypto type"); return -EINVAL; @@ -3184,7 +3184,8 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev, session->pdcp.hfn_threshold = pdcp_xform->hfn_threshold; session->pdcp.hfn_ovd = pdcp_xform->hfn_ovrd; /* hfv ovd offset location is stored in iv.offset value*/ - session->pdcp.hfn_ovd_offset = cipher_xform->iv.offset; + if (cipher_xform) + session->pdcp.hfn_ovd_offset = cipher_xform->iv.offset; cipherdata.key = (size_t)session->cipher_key.data; cipherdata.keylen = session->cipher_key.length; From patchwork Wed Jul 21 07:39:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 483263 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5941115jao; Wed, 21 Jul 2021 00:42:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvIzkfLfK4TWb89uZMtawfeG9QVi/T8XV6LrIN4ZUrQniltz+VjSSue3ceDRYl/hnq32WK X-Received: by 2002:a05:6000:144a:: with SMTP id v10mr40321377wrx.339.1626853346447; Wed, 21 Jul 2021 00:42:26 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id f11si29313085wrz.107.2021.07.21.00.42.26; Wed, 21 Jul 2021 00:42:26 -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=eVixnkuE; 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 3C4CF410E4; Wed, 21 Jul 2021 09:42:22 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20076.outbound.protection.outlook.com [40.107.2.76]) by mails.dpdk.org (Postfix) with ESMTP id 73FCD40F35 for ; Wed, 21 Jul 2021 09:42:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XkElLy1m6LbTKj2q4/0HdVAtckPgtksLZelrfRVGR/ocSBX5A4rjxuY9VvWHs49LoiL8E0zu7Wm4a5gSByujXIOm2dWpj0J5wy8+Vn+wLIZvL37mE2NDQ8GZOIltCczLwEPGuPDyNd7w4k/rNH85FbqjjW0Lq+XWdrHEeB7cvNJjYPpPExoLZOTPchwGFxeCbzWWEnRm5LEAXxHlRkEtQfDGfCMelm2hhwH4J646LXV7pwckGmrAOb0PSZDZsBsbFC3z+Ry002MIIf/YIGYgvOz+Phbqftt13PoVWYj0eOr2LRY6oRDcIFUdcKkq31opYWejGKhethtrSmablMrYrw== 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=rl6AZQZIz9YQG11+7z6+x54jCmQb2w06s2Ddfgq2Ukc=; b=AQ0kUp7JsefujU7d0U90hNsa5SlsNKoC+klTCNAjHtpEBY9rusBk49RZrPsVhzQrre5E23OR+D9O5B0wvqUHWhRB7CrlqymGoFPs9WeeH3GJZWqv7Y9AVo1UO4yKPhguj+ghKYBSCFS5wS8TmMfYoNGWG0Xpbx6R2H1N6Id4ML3hLHCPF716PNgdgYUQS8dqL1BoUcosdRNW0l4pZxE0rpam+2nejdZJwtZxCa7djGNdcX6z29e68yzqWhx+tbHqV4ZQTsNwzdHiXrIm9y9LWudZsJLgnVu8ixfPhgQDWpWnhEd/dex61bff9c1gUJkNEVEYFg0CWTZQjD+THbgx2Q== 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=rl6AZQZIz9YQG11+7z6+x54jCmQb2w06s2Ddfgq2Ukc=; b=eVixnkuE1ngPejGiuP9JpKmlZZRFY+n28ZVgVPpePqW4X20LWzyj4ctrbK2/jpNUV4HkNe9zlQ20S9utNXxa5WiombqmMrXxxF3G8jJqUH8e1tFYMSBRW4g481boOiMzdg2iKuKab++zSNCOpy6wDsBdKzdd6MXKAqT751XYD00= 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:18 +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:18 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: gakhil@marvell.com, Gagandeep Singh Date: Wed, 21 Jul 2021 13:09:17 +0530 Message-Id: <20210721073920.21893-2-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:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4d12611f-32e6-491f-fabc-08d94c1b1118 X-MS-TrafficTypeDiagnostic: DU2PR04MB8581: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SOK+LasAII06dKnhwz8Jabeb5BhnD0zH4b7/2b1rCB0ptqX0CM8HGTczCiF0putSZTlU/fKK/B2pm95PCa5HZeS2YZNiiG8rTnXd+68F1Bn9ReRRGSTKjok3tB4b5RrH8Q/X5CRAFd+/Mh5FQnYUiGatSY6hGJ9l8GILddCWQk2rQukioinlnMVGzAiGzHWHKuQ0bMfI4fz0Udayb/I+XtFRbTvMT+yfhvpAJQ1XJxpVQ2XgdQ+FewU7wrype/bKJzqdbBv/5UllbpmnugOB1xqOkowZanm7fxaURhbVT2tkf855Qgzn54KRClXe1CTkRfgcL0GXT19/eZk1UKSKdJNJDaYo7n5vgBvp51DWCx3344yREcG09isE92wTR37u7mtumn8S2Hb89K9GPAwEoly3QR86q+TIuSSgEha8gI2YFR4t58xuLzikhSucAer42zYA8vf1UoIiqpGhXz4/IVaxonppTo6JUN4RsylM7xjm5IYaETBAQmQiwj4NkvFQLadyhsCt7zY3scfYbgqdcfYWW4Nd2DrCD++vgIUWeQG/eo3/kKJjlpFGDNdn43Skq1YVqbshTygvstSa9mSdeaYSzP/Ruv1JKVC7uUpcbmr/F/1ro5uNkzJy894rqMbKmoze2gCQ4lEIpBiy4GyaioQ2Nyqm1oYMuTgb3xX7if+Vi/1yh24435XhQBmkbICw/xeus/rB4xK2Ipjui5A6Iw== 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: viPC/XofuHmsKOEjzcE73lx2I/hYx3EvYdvuqn4ardkFEex9D+ApUs4/4DVbBJOlUDg26VteATakeMZXhB/VhfLxWYim9Ud3LGt6pGexdrHTkjcfiEgXZERwBvULJ0wLYKqdi9hSfigzzIttB6NgKC4RvDUwDsYdqKo73Cb0ICcQPk4dprOeU9TiHDNp7PUStZy7NorRHIbhET8MwMow/83JWorN44DJPyI21/+mdbd+GFJsaBlx0fdnXv3rysNU7IaHRa/RMibMXOGaltAV0JZw4usNFoNpJTIkkwoeh5dXYr4ZdOJqkxYbaxwRRR/vMrTdA08saLN5hbvod2AHp9RofmyVoYk/CrisHf02OcsOFzqaU60wlPA0lHmkC29+PpWzTWoKuK7GYdLREh41ysC+U7N5QiyFlsUCTqJG6AJLe5Cf0XoSegdE7vUrYF8vHvzEaA95UC4V1uHvXtakDswllEQFC4dxuF4gLO9adWOh0aRkPaBqAHpoc9H7CkyBJilNNZyZpvH2ltpF44JpchytZmN06DqkhUuBXbsVIs0yLjYzCdyOOzV6vl6Sn7tKZXPgO/DG+YNJlFdroDjBk66Ij5IVIfalSUwE3A/74k3GMR/+fBoumV0X+bjoW4FdyxUeELhmVh7L0hNZjHFAo3aeUnqsKM4l7DmezaevjF4mrMkE+EkWGnYUXlXztR8CslpqD3bcyZOaMwYfvRRFedHquN4CTNrKYfRSq5XUOJ/x1uC4YrjjXykndP5j/7KupvKlKCHmoatZoaTdKSvNk5BOB2qP63pznFZh/9fNoCLpP/c0Amq9le6XPWtUo8gUrEcpYzdQI6+KNyXB2Qtq81n4dWEi82Wd+ORkeeqsbovkbSxJh/PB3xOrjAxy2jzm7rkKNs4GUZ/IA2UezQb+O4vvBmzQchRlL3/hEB9z2Q67RtCgTFSLtpLK0IBPCRjsb7Vs00SmNbULRC25bxMJOGSnsfFsvxdIS0o9i8q7gcr6T+L/L/h5+L7QPHIeavi2qv/h7Xb2bAwIrBX+JUMHsW/tizfDnIrqXfLZw2JTUrfxiN5vVf3gsyFJrrkd8lZ+0VnqwcNEKMsF4drRiVnrWmcZCj8anJcrpJESN3jXdFL57d+Ykv003tPVk+6M/aN2PJ/vGB5F4s7Y08PyW5uG68Y/dvQUTXLG2gQDGKNPF4tGCruCQPIJ2lFCtNNgeBai+5UUQfZA5OCadeGIJ7x+ufnlFeV+qmPFqAhvAT78ODmN2rLBJGLLsVXTrLg+wB8OmPluo+kffQG6obLQgLyVpE85yeSgBw5THfsu+x61wz+TjNY50+T1cSkd0GhfkMm+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d12611f-32e6-491f-fabc-08d94c1b1118 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:18.6673 (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: kCeC7mvLX8jlIu2cj+0+8ULBccCDWKJHHZ1a50a7MLHx7LPMfk5PyuNsaGMQxLNc79LpKvonkqZ59CEQa/9tSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8581 Subject: [dpdk-dev] [PATCH 2/5] crypto/dpaa_sec: support DES-CBC 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 add DES-CBC support and enable available cipher-only test cases. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 1 + drivers/crypto/dpaa_sec/dpaa_sec.c | 13 +++++++++++++ drivers/crypto/dpaa_sec/dpaa_sec.h | 20 ++++++++++++++++++++ 3 files changed, 34 insertions(+) -- 2.17.1 diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index 243f3e1d67..5d0d04d601 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -24,6 +24,7 @@ AES CBC (256) = Y AES CTR (128) = Y AES CTR (192) = Y AES CTR (256) = Y +DES CBC = Y 3DES CBC = Y SNOW3G UEA2 = Y ZUC EEA3 = Y diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 19d4684e24..af5c7c499c 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -454,6 +454,7 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) switch (ses->cipher_alg) { case RTE_CRYPTO_CIPHER_AES_CBC: case RTE_CRYPTO_CIPHER_3DES_CBC: + case RTE_CRYPTO_CIPHER_DES_CBC: case RTE_CRYPTO_CIPHER_AES_CTR: case RTE_CRYPTO_CIPHER_3DES_CTR: shared_desc_len = cnstr_shdsc_blkcipher( @@ -2043,6 +2044,10 @@ dpaa_sec_cipher_init(struct rte_cryptodev *dev __rte_unused, session->cipher_key.alg = OP_ALG_ALGSEL_AES; session->cipher_key.algmode = OP_ALG_AAI_CBC; break; + case RTE_CRYPTO_CIPHER_DES_CBC: + session->cipher_key.alg = OP_ALG_ALGSEL_DES; + session->cipher_key.algmode = OP_ALG_AAI_CBC; + break; case RTE_CRYPTO_CIPHER_3DES_CBC: session->cipher_key.alg = OP_ALG_ALGSEL_3DES; session->cipher_key.algmode = OP_ALG_AAI_CBC; @@ -2218,6 +2223,10 @@ dpaa_sec_chain_init(struct rte_cryptodev *dev __rte_unused, session->cipher_key.alg = OP_ALG_ALGSEL_AES; session->cipher_key.algmode = OP_ALG_AAI_CBC; break; + case RTE_CRYPTO_CIPHER_DES_CBC: + session->cipher_key.alg = OP_ALG_ALGSEL_DES; + session->cipher_key.algmode = OP_ALG_AAI_CBC; + break; case RTE_CRYPTO_CIPHER_3DES_CBC: session->cipher_key.alg = OP_ALG_ALGSEL_3DES; session->cipher_key.algmode = OP_ALG_AAI_CBC; @@ -2667,6 +2676,10 @@ dpaa_sec_ipsec_proto_init(struct rte_crypto_cipher_xform *cipher_xform, session->cipher_key.alg = OP_PCL_IPSEC_AES_CBC; session->cipher_key.algmode = OP_ALG_AAI_CBC; break; + case RTE_CRYPTO_CIPHER_DES_CBC: + session->cipher_key.alg = OP_PCL_IPSEC_DES; + session->cipher_key.algmode = OP_ALG_AAI_CBC; + break; case RTE_CRYPTO_CIPHER_3DES_CBC: session->cipher_key.alg = OP_PCL_IPSEC_3DES; session->cipher_key.algmode = OP_ALG_AAI_CBC; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h index 368699678b..216e8c8b6f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -456,6 +456,26 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* DES CBC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher = { + .algo = RTE_CRYPTO_CIPHER_DES_CBC, + .block_size = 8, + .key_size = { + .min = 8, + .max = 8, + .increment = 0 + }, + .iv_size = { + .min = 8, + .max = 8, + .increment = 0 + } + }, } + }, } + }, { /* 3DES CBC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { From patchwork Wed Jul 21 07:39:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 483264 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5941208jao; Wed, 21 Jul 2021 00:42:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7j6opVJDNth0IirCs1rt7SnyBPAqo7qutnLfClWTz39bi233GUdiNsD628a2PtAPaarGl X-Received: by 2002:adf:c448:: with SMTP id a8mr40624560wrg.103.1626853354724; Wed, 21 Jul 2021 00:42:34 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id k8si29943211wri.156.2021.07.21.00.42.34; Wed, 21 Jul 2021 00:42:34 -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=D8x3JlWt; 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 EF1FF4111A; Wed, 21 Jul 2021 09:42:24 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2070.outbound.protection.outlook.com [40.107.21.70]) by mails.dpdk.org (Postfix) with ESMTP id 9EB4D410E1 for ; Wed, 21 Jul 2021 09:42:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gj8V4+CjLhhDBY6VzQbeABrE6RlKZ/7JJNLyy5I8W0to5E9kZbAlbWOr0CzD4u9y4dMzqMdES+X4zlZfIgfEzGqC5eC58+TejomF3aE7c43vvBZQdZz7FJrH4c2GvFmYUH/b9frTTLY2B3wJ4tVCsS19m4Xf3MXUaaFvz2HeOfADWHoagYVa1ZDl+ajs6L/g0PpIPQTple2cf75M1RB/4dBwoloalNxhYsyRKPzyNEgLCa6vKQOo8qUGoivrMULAN5IPlRURCBa9eUln7MJTWKfRbAcFdOQqxKjugE2qq0rYjcavHYxur/d3DSJjxuRM5bWHtPDsHa4As1m9dnQCXQ== 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=iZt6LmisG8cVDtOf+H+IMogSeNCzlar/cn0C4cdEQ5E=; b=HnKGI66zyaGXlPXmtzACwpfMS8j4Xkc51CtSEO82I1wR2FyC0uSr6ZVTWpwuuRHFN6Hx5y+7GQzFVWkuthBSWGn6t/6F5vhWBCB3eIwGTTCFSJh+F1W6/EYQoUtz2ZRIclnTJ8i4b4kvz1UTEWAMAp+7W0dy8qGFOMNQjL2/DNWjEd1HIucR2sZs+d6GWJ7q0YCt8yHDWBlmGqzt/sEiKNy9dAWgRzz3tM5ZzwVeqQ70ZJsPUqqws9vONlupNNgc/ZXgdSziB40SJEvgNgU+1Mtd2UDHypMCpXv1gKssRpp1LCAGcUWhRaS4ON3TJO7JXm//L5ZPpwxk272tF9i5dA== 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=iZt6LmisG8cVDtOf+H+IMogSeNCzlar/cn0C4cdEQ5E=; b=D8x3JlWtwfDlB+7cemhHV6jh6MQfzBQoHS8awOk5xjtyhgD5X7aFIxpUx/NBLd9hbGlkdxBWZEL27HEN2ihOShoHCadtB8cdaogRjcY7oCm2dkXD0o2pfjECiA04NmD/ZSc9hXMLr2/mCV34zOGYv7sWj05C1OBcgL6heTSK/5Y= 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 DU2PR04MB8823.eurprd04.prod.outlook.com (2603:10a6:10:2e2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.24; Wed, 21 Jul 2021 07:42:20 +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:20 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: gakhil@marvell.com, Gagandeep Singh Date: Wed, 21 Jul 2021 13:09:18 +0530 Message-Id: <20210721073920.21893-3-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:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b4250076-45a8-4449-51bf-08d94c1b122d X-MS-TrafficTypeDiagnostic: DU2PR04MB8823: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JbnxXkg8mwrJ1qRmB9tC+xsVYMY54DoFOdmOSxkoNalhz98034OEgGaV3GmWEB9JLFVlLrvrah4JeITqhEHZTEOdO3nCyjwqtWqNeSbqDrdKEFYA8f8wgplGdpm4J7/s8bI3DNXp4mO78GwywDszNi9cQRJsqf+6NG3kXXZvw4o5f8yB93KssYhhzvAEbi9ixBuTHxk89Co2nDTkcIGJEyyyUTA3UavJz+u7X14OzrCUgrP4agMv3qp1dlcGvQNy1OdoGdpJfDB4F4ZlihXOvuU3j47LU8FLQXVnukNqMCY3BxfLfEtOMe06UcaLx2BZ53tB6DTDQxYW2KTHPUnP4sExB4v5yTyYzZ38DbgBZaQuWnVgLNBrFUpTx4yYlleXgQ7bNXpZMzprI/x3KUonqGN7VqMnHTrHbHpakbKCrrvPoGmagPLpTZp3y8Xe23LlYxry70OJcErzgYsNrckGENBeoemlOAUJsyXQY7fAM2Im/puoF7eqreUcLh2sxzLtC8h+gdT634ycoV/0Ph/FSteWUMcQBMXxSkrIGLToxUcXQl6DgSTMi1HW7kZ184Nadg3zgUVjyTRl65DGVOfjbuZ6cFrDsSWVNC4UpM4EWg3hipJBI0Wz4yv8QcUk5NExkN7h78xAeB1kfbOwgksHxlpdMyJHfUqP3GQeaqk1r6864MIv46ts5/dW0SkutifB+znFLPsuloMXtuiNEgYiCg== 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)(136003)(366004)(346002)(39860400002)(376002)(26005)(5660300002)(83380400001)(6506007)(2906002)(8676002)(956004)(44832011)(186003)(4326008)(2616005)(478600001)(38100700002)(38350700002)(36756003)(6512007)(52116002)(316002)(6486002)(8936002)(86362001)(66946007)(66476007)(66556008)(6916009)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TKofGLM1aLAjBLRSGtqOinsTMU10D+Y9i0SwFfHEtN1g9UcDg48txWErYts4iqH/sV2TA13qlbmG5uvJTh2vKYbh/HqM+hFaQJNhfAiKaBXTvyI/4pWlJaJ48GYxSU0n9u1SwpMuJnc6kGnRfk9+9Fx3NSfbbPOc3vua/hOHckn3oHpSgd9BcocVcQt0RpqW00d//bYvIntfMTnhXp3J2hED7yubMnbKvvFZwUQy0x1UwUU5rHk9drv3hDDUoDsAPCR+8rP+m3bL/y8IuDp8+Pgc/b3lC7P/BugrehzAd/2lxOpQ8wKT2iEjgqX6zUGK11YeMqWUVtApPRJimIaZIx4Vb0tirGdNhWZg+p9yiqGkEppigJBDf92AmfoelOm8GwGC4wpY7cxBpp2Roq/DEsRxVRy+QVTYmpYOfY7neGW0X8inwl7CJmwpXOrZvwCMUfEWfUtpaL81DRpetqJpqKS3WGE683rd8Y+mgrBvXr4dJiK2AmgNjrCumsAQAs2hXf9ahh1LNt+DUYj+Wp1XzVcDght2Vyl8EKf+hbFdCaY9Js438Lz1O7tXld56ss8JWN2caCN21glaEFeYBmaOmLPhFc0knNKE0Kyujk+cAowBtWzhFnlmZnp5+AXbcnE2CL6rXMVTyeU9VcXz4v+7qiMlsBtATuh+cTXS9tDmT328PJimPJnSSE40FS5IgaZWaFNZRJPybYThV34Vl9WbkNK0jw4BPzueeIMIA50GNTB4HsW35zSNQK5iPBKJL1RwNbaJ6cll7ITrob6xTfauC/Z8JSnRjVTbXHbaCwx4LJj8DwloPFK8hEZkbqeD8GirVl7C/dedgP+4jK+dYZo3QWWgFK0kxCj8mreSdpq+s/fci4KZ+KvC/rilzFIYluGVolBnvxR2Q6ga1Cxr+L99on0ICcxOquobhu6vGZjfy/pW5wpyrJ2Kq0W8saXzlz2FXXAZRIlIUM0OXPN+8dXVPWD2jtbDca6H7VmokyG1VWVi/ODMwpC2sI4LgJR6TnPihy5tGHbFGkGxNvvADzeH56rwirBRWu6G4ByRExuUXt0or0v00J4S4tYy1PHjwX828/9FZJmSdt7aLEEJZ3ZfCHNA5U4/hUQyn08+nsI8ILzs7BZ+02S7bJy0f71L/eQCfahSlfucbnxLMfMqNJrforihsl3OKU+IEAHMDWYWzbz7Dll+BcrZB2rWQ4RmO4TT6jzGfYGak6Bz+KqPXoS8iUcZuMjXtOT65QtO2QGR7RvR0THw698KuLYZxl1xYblzvdSHK5QtncS7NhuFqijNR+MkJoaj8yC+3lhiXoek6hzmU0TMByJQKkJsl1qb1g5l X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4250076-45a8-4449-51bf-08d94c1b122d 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:20.4305 (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: JXB9O2XyZsQIpuj3wmeSejT5D1OWO4wywrUpxt4W61AEXHmwQF1Mtj7PjnE1JlPobmlUf5NoF6BqWHZeeIM7QQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8823 Subject: [dpdk-dev] [PATCH 3/5] crypto/dpaa_sec: support non-HMAC auth algos 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 add support for non-HMAC, md5, shax algos. Signed-off-by: Gagandeep Singh --- doc/guides/cryptodevs/features/dpaa_sec.ini | 8 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 55 +++++++-- drivers/crypto/dpaa_sec/dpaa_sec.h | 126 ++++++++++++++++++++ 3 files changed, 180 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index 5d0d04d601..eab14da96c 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -33,11 +33,17 @@ ZUC EEA3 = Y ; Supported authentication algorithms of the 'dpaa_sec' crypto driver. ; [Auth] +MD5 = Y MD5 HMAC = Y +SHA1 = Y SHA1 HMAC = Y +SHA224 = Y SHA224 HMAC = Y +SHA256 = Y SHA256 HMAC = Y +SHA384 = Y SHA384 HMAC = Y +SHA512 = Y SHA512 HMAC = Y SNOW3G UIA2 = Y ZUC EIA3 = Y @@ -53,4 +59,4 @@ AES GCM (256) = Y ; ; Supported Asymmetric algorithms of the 'dpaa_sec' crypto driver. ; -[Asymmetric] \ No newline at end of file +[Asymmetric] diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index af5c7c499c..95b9d7414f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -489,6 +489,18 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses) alginfo_a.algtype = ses->auth_key.alg; alginfo_a.algmode = ses->auth_key.algmode; switch (ses->auth_alg) { + case RTE_CRYPTO_AUTH_MD5: + case RTE_CRYPTO_AUTH_SHA1: + case RTE_CRYPTO_AUTH_SHA224: + case RTE_CRYPTO_AUTH_SHA256: + case RTE_CRYPTO_AUTH_SHA384: + case RTE_CRYPTO_AUTH_SHA512: + shared_desc_len = cnstr_shdsc_hash( + cdb->sh_desc, true, + swap, SHR_NEVER, &alginfo_a, + !ses->dir, + ses->digest_length); + break; case RTE_CRYPTO_AUTH_MD5_HMAC: case RTE_CRYPTO_AUTH_SHA1_HMAC: case RTE_CRYPTO_AUTH_SHA224_HMAC: @@ -2080,43 +2092,70 @@ dpaa_sec_auth_init(struct rte_cryptodev *dev __rte_unused, { session->ctxt = DPAA_SEC_AUTH; session->auth_alg = xform->auth.algo; - session->auth_key.data = rte_zmalloc(NULL, xform->auth.key.length, + session->auth_key.length = xform->auth.key.length; + if (xform->auth.key.length) { + session->auth_key.data = + rte_zmalloc(NULL, xform->auth.key.length, RTE_CACHE_LINE_SIZE); - if (session->auth_key.data == NULL && xform->auth.key.length > 0) { - DPAA_SEC_ERR("No Memory for auth key"); - return -ENOMEM; + if (session->auth_key.data == NULL) { + DPAA_SEC_ERR("No Memory for auth key"); + return -ENOMEM; + } + memcpy(session->auth_key.data, xform->auth.key.data, + xform->auth.key.length); + } - session->auth_key.length = xform->auth.key.length; session->digest_length = xform->auth.digest_length; if (session->cipher_alg == RTE_CRYPTO_CIPHER_NULL) { session->iv.offset = xform->auth.iv.offset; session->iv.length = xform->auth.iv.length; } - memcpy(session->auth_key.data, xform->auth.key.data, - xform->auth.key.length); - switch (xform->auth.algo) { + case RTE_CRYPTO_AUTH_SHA1: + session->auth_key.alg = OP_ALG_ALGSEL_SHA1; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA1_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA1; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_MD5: + session->auth_key.alg = OP_ALG_ALGSEL_MD5; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_MD5_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_MD5; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_SHA224: + session->auth_key.alg = OP_ALG_ALGSEL_SHA224; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA224_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA224; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_SHA256: + session->auth_key.alg = OP_ALG_ALGSEL_SHA256; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA256_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA256; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_SHA384: + session->auth_key.alg = OP_ALG_ALGSEL_SHA384; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA384_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA384; session->auth_key.algmode = OP_ALG_AAI_HMAC; break; + case RTE_CRYPTO_AUTH_SHA512: + session->auth_key.alg = OP_ALG_ALGSEL_SHA512; + session->auth_key.algmode = OP_ALG_AAI_HASH; + break; case RTE_CRYPTO_AUTH_SHA512_HMAC: session->auth_key.alg = OP_ALG_ALGSEL_SHA512; session->auth_key.algmode = OP_ALG_AAI_HMAC; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.h b/drivers/crypto/dpaa_sec/dpaa_sec.h index 216e8c8b6f..d500a4c246 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -240,6 +240,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, }, }, }, }, + { /* MD5 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_MD5, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 16, + .max = 16, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* MD5 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -261,6 +282,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA1 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA1, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 20, + .max = 20, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA1 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -282,6 +324,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA224 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA224, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 28, + .max = 28, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA224 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -303,6 +366,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA256 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA256, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 32, + .max = 32, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA256 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -324,6 +408,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA384 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA384, + .block_size = 64, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 48, + .max = 48, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA384 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { @@ -345,6 +450,27 @@ static const struct rte_cryptodev_capabilities dpaa_sec_capabilities[] = { }, } }, } }, + { /* SHA512 */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA512, + .block_size = 128, + .key_size = { + .min = 0, + .max = 0, + .increment = 0 + }, + .digest_size = { + .min = 64, + .max = 64, + .increment = 0 + }, + .iv_size = { 0 } + }, } + }, } + }, { /* SHA512 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { 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: From patchwork Wed Jul 21 07:39:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 483266 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5941346jao; Wed, 21 Jul 2021 00:42:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsHUcUqvWekVW9f3nM64fUqP2XuTbl/TOBxwh5hF3j2UJWFlKIFZxCitpduZ6QXL1LpVK3 X-Received: by 2002:a05:600c:2197:: with SMTP id e23mr36199275wme.101.1626853369368; Wed, 21 Jul 2021 00:42:49 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id b11si6191678wrs.385.2021.07.21.00.42.49; Wed, 21 Jul 2021 00:42:49 -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=quliEqXg; 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 2CFB741124; Wed, 21 Jul 2021 09:42:27 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2077.outbound.protection.outlook.com [40.107.21.77]) by mails.dpdk.org (Postfix) with ESMTP id 077AB410FD for ; Wed, 21 Jul 2021 09:42:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SJcP5FffhcfhB33sZqzu3+WP637IuD+YyLgsJHFl5eGq7jQGmCKaNrbrZnXyqHK3L58biYROumFDheSGV+k2ol55uPyiWOjkUT93KDBqyS87BqqVSxY3Q0ZzfChda4df0XUoTS22rDkOoI+TcGOa+F4EGzNLFakFCJKjXXNkEm3PBQngyiQCCZ7qPu8P4rR/WItibSfynqeo7gjGzqtafzDcyugW3MwVt0icIej7DTQFc6xfz9A9T86xFPe0zNS0lg4gc11DMBmih+BBReRDwilLQCpmfmdt4gW8qSvDMMZ8jW4iWdMQxKpIYenhFv5Ghnxm2Ypjez1gdC5xdGUqQQ== 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=D2Sihn/D4snwDxbTTbeY9N8tUdHGfXDTExhtlH+QKD0=; b=mnz7PQ+0qYxwf0aGCH/3Rmqpc4ZwJgEWDrqFDMkNMxOw1/vSRMiYw78lCPqCTiNRtX6PNhfpsQeQJjyuhA/6r7JYqSi65XcuDKlx50/4Tmh0Fn+E5Omr/dsNKHzOsRsqUMXFmCxthE0j6bvRw247Mcfm8x+3wWeDiMU3ywp8vuZYqeBgynPqWk79OjhDIU320m/ZwWRJGtmwnQq2iwIFZPHTAVoQ2W9wBDQSau8S37/ciiBDRSdJJ7+BRrVodlChpBO21igw29wzFVkB/pPnwkmTiMEbt5A6YNpNmesNMyDTOjhv/mfC9bBJnYApSZClYqAjrPU5ar5j7lfleHGBnA== 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=D2Sihn/D4snwDxbTTbeY9N8tUdHGfXDTExhtlH+QKD0=; b=quliEqXgzXCdVTpevakHpBxoYV3EAhujLIzNkaGZQEhcWsP2rMh7+xgyij/1mnayrN5s9VDxrflqRtgeUnp0kqRKOBlOe22Omfz4EcwE8NJsppv3lBqsCgP71TF+Sot4illxF7k32OZXXJpXwkk41uFK7H1qZGkRDUVu7Fz04jE= 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 DU2PR04MB8823.eurprd04.prod.outlook.com (2603:10a6:10:2e2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.24; Wed, 21 Jul 2021 07:42:24 +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:24 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: gakhil@marvell.com, Gagandeep Singh Date: Wed, 21 Jul 2021 13:09:20 +0530 Message-Id: <20210721073920.21893-5-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:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e137608c-c5a2-4cb6-3379-08d94c1b1452 X-MS-TrafficTypeDiagnostic: DU2PR04MB8823: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:569; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +o603iNj51B+/11ziNAtLKoJA9dIV0eGcQIG9c6VJHtL3EqXdybz2xzb/Iym+hsUnSPnjE/ieWuz3UTc+utnkot3PpKAuD1wHIQqkQjDa3T2Kix1e6t9st0pWR28zanRWU/6R6483a+8drG4MynXUYsejPhvnnxIGwElLfRCiolBHTpwWfM8R5ObVcqLGjKzNT6Yrz0lkXUB5Hg6z5zQyoQID+PixchOi84aqSDCeIUyKc1xNKpQe5c0IIEfdmGtLXsvH88ryPIM3I9QraSBwEHHNcOOtgIoOhgvMML1L2bDoMGsFQNP/b5L3v7mFPtJZFDHPNrteZWtRz3XsB0TDzF93nNqKtjXnHQnv0DY9/BgC38Tx5OzETcOHWG/qadj/tN4awRewtFUL3mk3RQJPC0WMCbC9HfQqHQbG5ap0N6Zg/EfZ7W7HBRvCi18rBJLHrbQIiQ5ocNB9oWbbRlCUO33Ff7rNWlhuan+NwMjL/A4LoLVhX8I7eQyuH+YKx8DLDHZC8PqPKozMadiSv/3pyqTE2GMJiicJwyhnlKhlGdUImY4u/yf1AqN4ItJuxlqUTYH1y2BYKiqvVshd4remHSzbwl3iz0Yp2zKWNe8RrYkcMYHi4z/3VKAmRWO+DJc/FQFBjlK0NwQRYhnYEh6mzKDXyCSsE+h5pq1EFNLD3+r0yFRViI2idxMZo2tiyhTSCmR14C1jEh3k0WXf5fxTw== 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)(136003)(366004)(346002)(39860400002)(376002)(26005)(5660300002)(83380400001)(6506007)(2906002)(8676002)(956004)(44832011)(186003)(4326008)(2616005)(478600001)(38100700002)(38350700002)(36756003)(6512007)(52116002)(316002)(6486002)(8936002)(86362001)(66946007)(66476007)(66556008)(6916009)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wSm7STp+t4AjtcV/IpIVuAd4Yw3KAtTOF9OrlVJ6uSJ1aRiHwSXkixgcJFFYXwtYD/fbllBN64qQa8sPCfCKB5H/eZSK15hEkxqk7705gyc+pE1e3fxd4rIm7TqDDRu0fePpD/oFhnxZpZ2KnhJ7tQwdROjI7u59xATYc3l/Qnj7ZZPF7Z6IEQJSSrLlaVpEIQAgDD+KfNMd7MxPR1GQx/+Rt5S/CL3bS0UJOThQ6CBZ7qP7xP14zA9feay2TPtPBEV78/baulXm3gFBPF/3qcP+yKhqXhGZl16tCq8uwoMst0VhWtk9sbKpoeqCL1N9/fEuWBoZCUZaTLjZRzgKO/BId1Mf7lauIg0j/S7q6VHuuB8LDFX7Mavov2bxMl5yLa995GWCcIANTp10ctfwseDpIYHMyiwWNqlK+Cy/x9dnv7dMqv/Yrb+IoSUk38+5JDP+ys2icE93o/gDtbHFPCKzoGK1Bl2qsrkY0R6yJeoqtRFDhI2pfe6NP9fyv9SdBzYVOUsi+9Zp+yIOdSeYIawPpwPztc1JU0SkOxJAY0u4NQwILnp9Bqs1xbASWSImlMz6/trnI6wk0J2n/x/vURYIhClAhzy30g9KuPXp3GeBk7sYhKe5yZqnnlWEvzGQapvMNxM5ufN+xlO09oo3C98wlnfLzyX8UgDG8tzA7PfMyQH94hK+NsimZ1iPneIZWI5mk+UVROZJiCrhwzYDAPrck9Jg105HyjeEfjJJoJmnc0NdZnk0pHAoxlcKacrM8rK/Z0SCWGPy3IDAbZbo5cvj7pjHbfpP4AUSLsJs1YEzVS3/C8bwceXorvx7v6Ex2VPaKWUpJm0sc2ymih5ovvVHL2OZmZzbNte9Z7LDskVvg/GkvOB1O8c9ZZTudM/SnocB9doYZRIysSA3PMcEABDAA0iUpifOv/RWrzLGUlvDQl9zAg3nSbjXgh4jIhcBJV1EckL9vOgVwrkdJiU9avTUOgYzjOyPUPC7ztNUKWSQImOWlEjtJ/tFtgkjf+aymeofxKP2un7zsSmQfJ0QW9NSa6rraIixRHDDV9kYbFCKqGtKVFUzmN7KN6+qb/wpHwNeN6adxh3ey4rAIDIym4peuGw1sIv0BusSXYPr3cFhSL6Y9/mSCYXWHw8qT9h2snGMfi0beOOIRtUhrvYgeNFNy+dXzgMjKOdqbJU9v0FIWpwCmphAEntVfE+lKeYUIwHYBqevZp/71en07H6yYKFeMHw3frdkShWUTOtrqGbDdeui5VionKrpxW+su4GUdshJxCL79NoGrcKkZD0z3DxSoXtDMCiZYYeMEOYJiXcPfo5idLxmv2RzLyjP/48l X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e137608c-c5a2-4cb6-3379-08d94c1b1452 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:24.1332 (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: GiqEKeZ29UqYTdeUbGBZF5h12NqDOOXvDy2voaCm0cFHvJ21yHsygUm071DI33ndv5iQmLBkw/gPN/H69Eb35g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8823 Subject: [dpdk-dev] [PATCH 5/5] 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. This patch modifies the camm flib to handles the AES CMAC without conflicting the proto ALG operations. i.e. by creating another ALG operation routine. 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 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() };