From patchwork Tue Sep 7 08:39:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507520 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4033058jai; Tue, 7 Sep 2021 01:44:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwgXPTLCQKPwzWdZusoH5YqzonCs+LmCCRk1hroNUiCANN43BAz5T3TAAu+d8N6OgAT+4x X-Received: by 2002:a17:906:1b14:: with SMTP id o20mr18228315ejg.154.1631004287029; Tue, 07 Sep 2021 01:44:47 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id a10si1693262ejf.122.2021.09.07.01.44.46; Tue, 07 Sep 2021 01:44:47 -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=pB0tdntg; 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 4345541104; Tue, 7 Sep 2021 10:44:37 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40072.outbound.protection.outlook.com [40.107.4.72]) by mails.dpdk.org (Postfix) with ESMTP id 2F7694111D for ; Tue, 7 Sep 2021 10:44:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FNS3LBPpeYVLR0fPBAy09BMfqLONDvUpZjP7JdTL2RL1Rhr8igl0Sd053s4sT9catakPcU+c+rgbi+n25meNC1cqLZDkARApJ5RWlk48xZuxSTcgfDwAViFPrLwExQZQGiyGTuWL/dD3xDzEPh8aljxk0COjzu8Q7z8TF0LuGLyP3ovDpOWPxzhRwGqbd+RU+rPdAXjaQf4hsaZPYz0iJcmLjXFj5pChWtAsHcLup3Pjm68BBN8W9VNzDgOImcm1czM258L2rdkqfWJdlmdMPEIOVyo5W34o1ScWhWMrrzqfY9225vx+nUvmTWLrKYYu4w7ciChQM3EBP72yHJMj1g== 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=Ba3V+HXzr0aPZg3Dm7OHfrVylgGmGBk+KXpHZ7pF9O8=; b=h50fnk71Zz5+OVIdAIc3EQxIJEdwPjmu6iHa1pr7Q6CEwpiNWpz7O1KGrUORtcZCBYx2BkSnL1AVXy7eFW/03xDPTGpSRyGaq8/FVH3lQo6mzlAz9EUepubr83D8tiztzOuMMLWGDfe//S3pCm7IVHHCSTOjV+K3B4ZAR+b7q8T+DfkOYBuK4ve0cPCtiW6dHX2OWNSTi2YdG5+bCsuQBoejDQzr2PzpMU+zfTWTd+C1AoEGslAj0aAtXX/K8opHmohgwA2iSsxYVmlBoyIZbP+UarOu+CJ7I8n5fo8r613doyS54GGGtF1kAI+4ZyJcQKhdv02ctUoFDToeysgqUg== 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=Ba3V+HXzr0aPZg3Dm7OHfrVylgGmGBk+KXpHZ7pF9O8=; b=pB0tdntgV/i3jkxBmGhHmshxSxt/UUaNN89FiScvYeYbB8avTWUYl7dOx0+eVFzlTxnRsXl65OOxIL0N08u6gubDCzTaDw/maEiBWzsmUgW2nDX3flW0sJebybc0OJ1uXuvAd5hIEz2jBFKYNI2rzj3cxjN6vFEbR7KLh1tyMgE= 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 DU2PR04MB8935.eurprd04.prod.outlook.com (2603:10a6:10:2e2::20) 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:35 +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:35 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Tue, 7 Sep 2021 14:09:46 +0530 Message-Id: <20210907083953.8948-3-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:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 387bb53b-8f07-497a-3860-08d971dbb83e X-MS-TrafficTypeDiagnostic: DU2PR04MB8935: 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: Ak600ZTPAgX1XU13e25ha8z4yGLR01hUpIYvwRvUtTibzRTrcvczGRjf+nLHDtf5GFZ3Go/M4Os0QPnbPNbtHOMqMrzYRTkAn74L2Z0qUSzJaOL9mG01UZ0ZA8uzKuTTF34IyMPkxCmlHpebjpeRnDf/WCXBckruLuKhop/rtJf0om/R/TN0D872Tpg3G0+tcOs/ZzpVy0jl5RTthjDuUxceYtmyF1og7kwpL7Clh2YaCzzmXkZp1fmSokNgauiGd7JsBSHCWjo0b0Bi3Hi5dHXc/J19rR1t0AfnZRFxQhC+MimgLQX1EOeQH4XDT/eH3OVeCQ19mrXKvsWrSyWp3SY6Bri0FZPq+uhGop2/jivRy/uicccN3YW4coLOXTnMihVmkhNLBXIftEG2VGRYTkXfEUYDbOzxa2GvloPDbAOc550e12P+wpzVTUQOlJ3i3NP59wFxMQEdoVP31PnI6nW+f9iGxomETYPJf68UfST8vSo6FyBOgzOTbBcbw8WXF/sL0CWzhvUXKzhCveMEU3i95hcSAtU3HvjN/EOhVtDjpILnX7mYrb6l/Yaw5yN6JRIqC+hZe0ZX7YbFP8Pcp40dMx/B/f+RsBoJG75/UVEQ3tlazqL+1MfWFedZwaZclvUnDptiR+szRMEl/fzPGmdQumMT0n/fUyNdvvy+ojnT+BNua7mNXlfel+bDBYajwd8AdK1bP4yHVjx9v7Jylg== 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)(136003)(39860400002)(366004)(376002)(396003)(2906002)(956004)(86362001)(2616005)(83380400001)(478600001)(316002)(6512007)(4326008)(52116002)(1076003)(5660300002)(38100700002)(6666004)(36756003)(186003)(38350700002)(26005)(44832011)(66946007)(6486002)(6506007)(66476007)(66556008)(8936002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Qp487NwvaLnrd/uw47PGeQ3LhbuvXrw28P6lLtwu96RbX854h3OTNM+f9mK6HjH0E3LmlYDOXDkps3WfOw13nlg7/ziOrlv/2lAsZNLvM0zdzllCMwyp8Ex/pS8GZf/o91oxt0PBh2Ni66QsZs9rLROLV85sdUxfiOZYBxwqivXvdKZ8JyDarcMl4C2VzUi9aqykz7FA46Yz26H8L9o6qcM6jQP2zsZEdmt7pu4TCaxticZ6egVqQEZNw3E5rw02+LAFOFkVgFskcTDP8Q8ivDtLkQPCKfGR8kNE6WIJr3MZld2+zLmjTzbykYUbIXOyz76gwUyxr3FbOHQ0SuLGVJuQygTOoakBe/GslyGfPCTPC+903LTMPl0i2dV7cZCTZBShIe/Tff84WCsomq59gI2K4lVK5R8xkpA+gUXDUFX8NrpoYaqaVENY5sDt09AInN0cGWJv98DufWOFA4zzNRz5mRrA80hqQzUZBGEnmOoRK5yKcInfpfFKZoZRUyR6wgCk8NgwCHwMpGSOi8AonWP99eA4FnKm5VoO05gJLyYiYegykxs1icPvkbX+3sU6Zty8Wv4BQPuIwjSoNjED8DOJW5w+tcDUoqpJu7OfJgALop5lLVAVgClChe9Azmrww7ESzJ1JLiOtDqKjWfM9tutxNKPffBKS2gc9xlbeqq+6t9IwmWDPB3N+/KEnATbE1cZEppULWKh4dSAUlmH8wmcD5hbAedQy97PewoWfyeXdOCVTQmg1oZ98dhWBI9TIBOBonXW2liXnyd/MJjgXqfJRmHQned8B32Ui6Enk9P1BYyPhWfekjr+veUwnI3PMW//aNzGVfPTFkiw9IcTEgaRaI9tq2oU3mRlUtdBur7+sLn5q+t6wn0un+UxU/tYdkobqvAuq/pLQgvfG/1uFHjZC3t1aQIYXA9hHfwIdGKyWsubUhsVH0uC76TbiQE4fyPLlWc43em5qon/1FgnF8B5elRF70Z14kav8Rux5re1fbAyoqYmk0hFCMzlQaxEH70iREPJrl+FCougNmextS/KlrWLH9Maq+ukA9G2p17RTi9pajLQv3x0poko+xNRfMB2HQ+em1FAXHf8KOjRClxkgApNrc3G/h2ezZKhcQoOzJKfKTjqR9Wf4OIdp6cXva9atzcFcl30FNBC2Cy6dx4dQ3eL7Q+U+ACdBQhOOML+TQWG68BbwCJVnsmQILtZ5xTS8FHVQDx7b13CO4VdRMyQMqLAwFC7TjiBB2qeZkaEoAOelgXKgD0AHPH2301IvlZOl5+8yhTefUWfuFJ3WZscinsVV8g6bOJbZR0NXT2WFsU/bIMydzWOYZ4ezK/LJ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 387bb53b-8f07-497a-3860-08d971dbb83e 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:35.4409 (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: tCQgJC0znNP9ospML8q+/K8PHdjz7W04q28VThBqEIHD8uC3qHLWBqlcaNVcxZ5uSG2/GYgOfkoSVC00imykOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8935 Subject: [dpdk-dev] [PATCH v3 03/10] 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 4f5d9d7f49..dab0ad28c0 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -524,6 +524,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); } @@ -2165,6 +2173,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); @@ -2246,6 +2258,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); @@ -2685,8 +2701,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: