From patchwork Wed Aug 25 08:18:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 502250 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp382181jab; Wed, 25 Aug 2021 01:22:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi5iQyjqNrwt9/a2vBTEo9K9FLNTwZ0cyxwiWU8l+FWBKbXfncQPr+Z9QkatcUJ9rY42Zy X-Received: by 2002:a17:906:2642:: with SMTP id i2mr46307694ejc.323.1629879741826; Wed, 25 Aug 2021 01:22:21 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id jr21si19028033ejb.14.2021.08.25.01.22.21; Wed, 25 Aug 2021 01:22:21 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=R1S9NScn; 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 8B918411CF; Wed, 25 Aug 2021 10:22:16 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20084.outbound.protection.outlook.com [40.107.2.84]) by mails.dpdk.org (Postfix) with ESMTP id EFB3740041 for ; Wed, 25 Aug 2021 10:22:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f8Os8SOIfzX82gynAc6bnztiqddIhmFP8QpTWEgG0/kdzIIUYgW6XUwoAs/cmz6GSUQXPvJQ6JYcQAWtV55I+46h9IAhRJA4U1PKMmxsZDMVFHOxnSLuPgl9WdgTbY+vUQyLLyAiaHEAMh+kByxa6FMbG1pjfae2+FxVSje6UziZV0LGWWG+zPdQ4OSowZgiKN+b+E7+VFLmIOTtK5Mzgt1SzcpMmTng+uLK2erjmD1KSRQ7vgkFjTIUGZFL0lG5Gk7YnuMXFqr+MoR37YQGsDihjAJqlAdOpNRTZYXBVRdHtt3vBLCkw+qsS2b6KRz+kNZan3F7+ZnYsPM4kYYmIg== 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=b/UZnT8J2HmsjETj4Dq6CkcWTMQaOvjpqObUQkMb2mw=; b=FVYP1O4EjMLV5oamL3KacJ7zJ5zY0QrC6LdJXYcbcOLhIyOOIDYiauNnZEFVG7Ak9umRdsE8SG2bNBSlDHoewThQiBu+a3wu/I6Uf29j+75TpjvAyO2B0KMAnR1d6ucC/SSfvgHG59oARyK5A1Iz5xW0BneERJ88dQPTxScukGlKHXbYo7Sl3cvDBvQdigiI+7wMTzoN03Mo3dmGucjIcHXe0zgh8CeIlvgfVNT1VFzI43ZNyB0dz8lrCr10lj9Ye/2aw0mFNUesYXcr7FQnufDVB8iGLCzp4DehskIF2yrzAsNvggrfYMR1Ymvqw0gztztmY5cFRkdb/ERHdDndoQ== 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=b/UZnT8J2HmsjETj4Dq6CkcWTMQaOvjpqObUQkMb2mw=; b=R1S9NScnT7gXeoe7xsmiexK6ku9sMb23igQJbw1sRwZdLLEq9C7IQHM+TufABqj0Yurzm8AS2Kov6SR+LtiV4bywpA7d5rr/irgaJRR9wspBdslOtlFqKuujbHJofDywU3jZqLPjyacDjW02EmbyYqsh7eO4K9r45sIotQffWJY= 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 DU2PR04MB8584.eurprd04.prod.outlook.com (2603:10a6:10:2db::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Wed, 25 Aug 2021 08:22:13 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 08:22:13 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Wed, 25 Aug 2021 13:48:28 +0530 Message-Id: <20210825081837.23830-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825081837.23830-1-hemant.agrawal@nxp.com> References: <20210721073920.21893-1-hemant.agrawal@nxp.com> <20210825081837.23830-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) 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 SG2PR02CA0106.apcprd02.prod.outlook.com (2603:1096:4:92::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Wed, 25 Aug 2021 08:22:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 947f1df0-c351-4232-73f3-08d967a17093 X-MS-TrafficTypeDiagnostic: DU2PR04MB8584: 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: YffYroKvPzZcncHC/oy17+xOnPuI8LlqR6KaDUBqGMzsuMqahR8Lk4bguOsw4IUfEQQoRDxjzeqTfY9M1FINpJ0wWe6iwhSty2KYByh3Y9cfZeiws8/exgN8xJH6/gWE8Hou1paucxSQ+acSji5RI5J6MdiWGnjQ1b+OguVwDggFJ0nXaxThQNMZheodY1R4gpQUIQVxs5R8/9HjErSp6SzgM1Qds4c+YjRlPG+DyytC0tD5Hiwh1cTC6nHTsxkc5xlUkxfjwSw/8/Z71u5yV3BCerAXrus9PqLYjAWIsZlwngQ+OxqRo5W/WMwH+ua1+bowqJj991pFw+H83DTj6FPkt8kslFGl1dVq/p21134ps2NwN6xdo2dzy5D/1SYz3/mNbpln9uU0ezFlgILD1XEcZ7JZkWDHrhAoCE/WLb3xl01+WGH19K4ffqM7ctYbZDh6j93IJ3wKgvV6pK/ZvWCYOuXDIJEMM3Q87+/i8NWZKmF3CpGV1TZaWgMxPKolp9LvlJB8WAATJ+xMk/oc75TGnuyMRuHn0eFmKFYvDwijBACSNAYkD+dfKx1mVVkuj71FGjAGqXKd4e2iSSoyshEu/8jFxZuHa8601NupFaYyLkxRiTHnk0eEkIqbU21zvOgpkWXPLWmzQPQRRdc0upf5vKAn4tGftB+C8FTudoJJmLnNVrdLPXMXWwNmYsKuzH9g9gzRtkeRe0qZcAJJ2A== 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)(136003)(366004)(376002)(39860400002)(346002)(396003)(6666004)(66556008)(66476007)(1076003)(26005)(8936002)(186003)(52116002)(6486002)(66946007)(6506007)(316002)(5660300002)(2906002)(44832011)(4326008)(36756003)(956004)(8676002)(478600001)(38100700002)(83380400001)(6512007)(38350700002)(2616005)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SyjkDLOHbR232b60mAW3eT10r8hEs0s4E6x1KNUnoGmBzV4Jw2skA9zy5KW2ovldfx864zMD+s04n9aAC8rgmkGYpKNp2yY+LPcALeHCX/VW/FLA1ATMLwNGow6mwVHNFj0ashRcE13+QrpTg85hvdGSH7oQXtmr6gg/yGserR1MbxYcdiyEH/m0DVXIyu3Bvwo7jZbuBW0vkBcvjIHTRMghbNX+Kv3aN8pAfO3MfKCV2rlaC93onNcnIT4KQOS72h6zfYh5TA1kWv+LNpiAdOP/rTedlmvpnV9uiBwRQs8PVO+fc7OoOI2FJKVqjOei2kkClmMO+jOqQfs6ri4JfcSjqpv2eqz8InMsj9K64J0+2K4RYSTOewmqgGncosnGNl77ZZrKea+uSHg+jsR/qO9NZIr+zjFBO3HUaxJrCBWMxxT78nyqOVc3RKKv1mTemi6Q007f4J3+1P8uzKz5pE/ZJi6Flj+FjyVF4u5uYnmMtgCSoPY8R9AjczY9s/frsOd2baz7g3dZhgxScxZZ19q2ytQpy7TjwntUStxk5W6myYpduwHGJ0okRRCX+8+pIdYPsNZw4RdSh8mB7kZyZ+tI6Wj761SGGwYcHWU62ZAwBxPgzvy1Xv25p76sQytGmz1tDuJbnmD91qpQcPVmXa0nc36BBH6KGtcNiGM6wLruCIvkQInNGoN2riq2cayB/UAtSU31gx/OA86QemKhJ5shCPJ9MaLbf/wwh6uB6bjH6Rh6V7E+zZwcsKFsDlDCe/0Qw8XqMln2Uw4Uk8GNsX357VmeyqiwbdfYO0jPgHa4D0ozDWGya9jAXG/V9HoaYwptlCoOi7sLBVrJj6KQBZ10nNPk36jLVu0IOC3wsALJ4KuSwM9k7eeSOs3LFmsfssgxkTaAn+7JRxwsC+jTooutrwCNSaahi/VsjRChA8P978nKvd4gB436Pn8klASBpE4jcoAWvvSpPSfniLYGDLT2ckLJW518nNkcPGVC3zgzV5btz/keh9RERO7sRueRazvw5oea7Hm69mHdOaw3tozPWoXhRDL24MqxeutFc6udDy6F39MZvOqXDnWiwA1Td/+tv/reTREyQNXDnBpEOzqTZYyAF4k4Lp/y66rC4M+QURZgedR20LjcZ/ak/LSFzM0QtE5xgAUPlrJBNrJsxEKUG8znhoU/RxVdqrrvam/+wCISiQhGQJEEX42IdXKNNE+WvOr12HgPNXsw6FFvbc4P1Kq01QtPRBT9AIZj2qucQm88lawuaJYGno49dttfOy0kJtSI79COY6byaIBMIkQDKLP2wY9pA+sed+lh8VMqNoWpppQJVWL7zPPkJbxa X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 947f1df0-c351-4232-73f3-08d967a17093 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 08:22:12.9177 (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: FmA5Btx7DGCjwJPGYGoxgJf2a0deZ9obVLkEVC2ZcnV7c+yyB/MLlwUzbBS85/zRMtjgCzX++H3Kv9uNuh2xdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8584 Subject: [dpdk-dev] [PATCH v2 02/11] 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 7534f80195..0a58f4e917 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -451,6 +451,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( @@ -2040,6 +2041,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; @@ -2215,6 +2220,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; @@ -2664,6 +2673,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 2e0ab93ff0..9685010f3f 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.h +++ b/drivers/crypto/dpaa_sec/dpaa_sec.h @@ -482,6 +482,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 = {