From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8726442B98; Thu, 25 May 2023 10:53:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1DBF740DDB; Thu, 25 May 2023 10:53:18 +0200 (CEST) Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2087.outbound.protection.outlook.com [40.107.117.87]) by mails.dpdk.org (Postfix) with ESMTP id 02F6F40A82 for ; Thu, 25 May 2023 10:53:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OlKbkGeNhj61NZ64HncYWQsCFI0fNMrdPqc/AGJxCCmAD34efHPM8Q6yoC3khEKhxKP/2PqKjIIi330/QJQ8hVyuGZmeLQ8yTt1uiD3WW7WejcAFgwOjVdc//JzUvdRpjZ+cgBHOyAgHskyJB94Qyog7jwXw+LZIbitleCRxi/5Hiv1ROI6Tv6C0gGZPFng98MnLgD/X430GntXe6PyfjdrFdyUOy2aQBRdNvQzWykH5Av7ELnqBkYj2beidy1R3xbyZB5HBABA+A96nR1pWBe1oLUy8aJK5nQaEvA/s2n92x7qa8gF49/SX204YmQ3g4d8GByk0TEw42T3mLO3DGQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8Gp3i3b/vLUfD5TMcX50p77eBWjPVjhw1u2c32SsNis=; b=CsdRfuznXaIfe+P4SJwnb05t8U1RN0A9nq+3jWI1dvmMNsL1t07sZvNC7n0YWLfuZ8ZresQToeHkmu6OTgoLTbe8kded0MzFK1hvljYSJ3PsbG3Y3fYyjty0Z28KyroLR4ZDkFCLC+CYnVivgui/N72xEVod13v8vnymzhrhClNBzSthCw1YuNSiBnjnPZsDv3te5pTk9sSeK0Ht2BHQti3zY06betyS98NgTyFwZZG6xYRfiDi22kBnF7AM9Z5Rf0df2PoHfonLA3CvgmeJDzK0YRsKcfCpPtqQMq2bN4+9bCHEgOjZEKckNYVbNkuqYeCDebfBdW2UJ2SvmJ6eRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jaguarmicro.com; dmarc=pass action=none header.from=jaguarmicro.com; dkim=pass header.d=jaguarmicro.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jaguarmicro.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8Gp3i3b/vLUfD5TMcX50p77eBWjPVjhw1u2c32SsNis=; b=bc5BFU8McqVcUULD8v8Fi64ejwccGiVTFoWmjuhUDNvp0LNBsdRwNc1z4ev0x0MxkGZJuVzNddV4B13R+ngRQYJW5l5w+plcxDTlYHejSFweCyc3vG4ZYDP/w1u6GoMs4GFA49BOn3c66WHdW/4HqRvNENGGCDGGk3MkgApoxTYfqIDaZPRFqn4mIYl5W6Bmriap3OqHJE0E60SKS7buGjb08caTq/YYT5KCII7OvRvFC7aW5+EBMUWkHoGb63YtXzbVX+FN0tNd+Il2kWgkTqUa+rYjnu1AB1L3H1HAmveQ6Vrc5qygOAfbN1NNCeBIMJvUINCL3/1hEQLQN7+gZQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=jaguarmicro.com; Received: from KL1PR0601MB5567.apcprd06.prod.outlook.com (2603:1096:820:c5::14) by TYZPR06MB5345.apcprd06.prod.outlook.com (2603:1096:400:1f2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.27; Thu, 25 May 2023 08:53:12 +0000 Received: from KL1PR0601MB5567.apcprd06.prod.outlook.com ([fe80::fc7c:ec5e:aa02:44e9]) by KL1PR0601MB5567.apcprd06.prod.outlook.com ([fe80::fc7c:ec5e:aa02:44e9%7]) with mapi id 15.20.6411.029; Thu, 25 May 2023 08:53:12 +0000 From: Sunyang Wu To: dev@dpdk.org Cc: kai.ji@intel.com, gakhil@marvell.com Subject: [PATCH 1/2] lib/cryptodev/: Add SM3_HMAC/SM4_CFB/SM4_OFB support in DPDK Date: Thu, 25 May 2023 16:52:57 +0800 Message-Id: <20230525085258.14800-1-sunyang.wu@jaguarmicro.com> X-Mailer: git-send-email 2.19.0.rc0.windows.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0004.apcprd02.prod.outlook.com (2603:1096:4:1f7::12) To KL1PR0601MB5567.apcprd06.prod.outlook.com (2603:1096:820:c5::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB5567:EE_|TYZPR06MB5345:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e06a500-71a8-4464-4c23-08db5cfd7888 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GpN/F7+6vrBcWUwqWxhUOKtljSVuyOo+FlCOjaJ+wh62heoRDgbWT50lKnMoWJrqsj1IrM+FhFYxCw5HSbYVYZMom3dE8KsT3TK41G+s+LyNqx6O0mNc8e//VDLcJU+qfMB3mv6XnAKRGexs5jx7HIcjfSj9FhDHtCmH+hSvSdMkAVx45Za0SaBLPyahT5Vlga8+Jq3ktKvm4dYVJQW1fm8W7NaSuMhxyiEcjSo3x77LjIBA/Azn/PE08Wa5j1DSeGcZkrc34cFjx+Rw4GfvErrw6S8tftO0uT3KXjC63YQxRXgzzpidECzb4sK1ZJjZQKH2YXmd+UgxAFnylBaNyQtLymfr6mrnLg/SVFA6TDGz54M1x9EXbqKgVrZbrxfHuvh+gFfBEqCs1MOd26Oos3m9TbVtKznMG+anhHGgRwrNi1S2T7gi8Gi+E7iMlM65hNLcQS9YMfXFfSHXOZsfOm8oBJhnmEsp73SinbFG+SaxcnX8UL3ozfbG161hnkh+bOnUEmriQYgxeZOHvYihW5ikZt93+G9XKTW59J4ZoK1p/5M1XLSmTh4QZoYoXa1YFb2QGIqt3uFMp+HXZPZzbrJUfVjTZct71KPwLMoseNy7oczOc6NXITD9pxLCFenh X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:KL1PR0601MB5567.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(136003)(396003)(366004)(376002)(39830400003)(346002)(451199021)(6486002)(41300700001)(52116002)(44832011)(4326008)(316002)(1076003)(26005)(6512007)(6506007)(6666004)(8676002)(5660300002)(38100700002)(8936002)(36756003)(38350700002)(86362001)(478600001)(2616005)(83380400001)(2906002)(66946007)(66556008)(186003)(66476007)(6916009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?0WLoasoUK2L3LNWhHqSV62BYOJJtjk+YBuxrSO11MZP36V12Z8VGZR6dFPCf?= =?us-ascii?Q?GQyUgv89GjCkEvWWWQEi4qevJwxd1WWZ2jcBG7vSMlOxhOErk7L3QW+1iPP9?= =?us-ascii?Q?p5C6kHrr2h4SPdG39DtH5AVCfCnpdUureD1WCSYXhLmWWrmOgn23Row7aLSC?= =?us-ascii?Q?yjGDpl1B+fhhqlkO+TBW5VmaIxPHC+E51Vd/KHnbMLozErNkCf2ds90vrrKm?= =?us-ascii?Q?fQfmn4NKwz1VXseUZUlRRm/9V8Sk3qnnFP/a2J8PfCBu5BQqx6HpbWGJVsHZ?= =?us-ascii?Q?Iw64GtoAqqGFR5L5xLeBzIpXNZx4lWOC6OI7FwZpCLxUeOADen8eQVlWoxZI?= =?us-asc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1tYjhC9k117qmJ4z3nAvlHolN?= =?us-ascii?Q?BB6lDzrmUFjcqyyyAsDNBAXA8obo66AvGpcDgToNwn7KVydQ+tbQ0fjLy+5W?= =?us-ascii?Q?7LCMHRKU4DnlTLKY6S+MlyN4/XePrNPrcaw+8z1883+ryHE4r1YSGvRClNQa?= =?us-ascii?Q?4XKSN3VSf48jdbAKkNYbfGNNpmPoVaxmdOFYQJP1dEtp4a0fxg7T6jFOWZ+a?= =?us-ascii?Q?SuIxQepk7ETtT/Sm7E4CzihcDgvjOrOpsc61fIuiP6Ou0GQ6bxOw23qdPC84?= =?us-ascii?Q?aBplVMES4/2houPO07AYHqRrz2hgyo6WwRV0Ty9WShT78aIR1aprEkX9A9te?= =?us-ascii?Q?TqqSKSf+yydXCuTxjM02aACPR8h3ED324VR2r2xF8iNhaTKm5v1tRU1rWyTS?= =?us-ascii?Q?sw=3D=3D?= X-OriginatorOrg: jaguarmicro.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e06a500-71a8-4464-4c23-08db5cfd7888 X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB5567.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2023 08:53:12.4183 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 1e45a5c2-d3e1-46b3-a0e6-c5ebf6d8ba7b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zFSHPDwoBhwr0YOnqTY9Ty9QzHlaAwi0q+lTldRhfzz30ypf8HrYvnZccE9UDqpFkulIqeiZFlUnRxMv7RycHJW0HXx2uJLWmxqjyAFkq10= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5345 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 Add crypto mode: SM4_CFB/SM4_OFB support in DPDK. Add auth mode: SM3_HMAC support in DPDK. Signed-off-by: Sunyang Wu --- doc/guides/cryptodevs/features/default.ini | 3 +++ lib/cryptodev/rte_crypto_sym.h | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini index 523da0cfa8..8f54d4a2a5 100644 --- a/doc/guides/cryptodevs/features/default.ini +++ b/doc/guides/cryptodevs/features/default.ini @@ -64,6 +64,8 @@ ZUC EEA3 = SM4 ECB = SM4 CBC = SM4 CTR = +SM4 CFB = +SM4 OFB = ; ; Supported authentication algorithms of a default crypto driver. @@ -99,6 +101,7 @@ SHA3_384 HMAC = SHA3_512 = SHA3_512 HMAC = SM3 = +SM3 HMAC = SHAKE_128 = SHAKE_256 = diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h index b43174dbec..428603d06e 100644 --- a/lib/cryptodev/rte_crypto_sym.h +++ b/lib/cryptodev/rte_crypto_sym.h @@ -172,8 +172,12 @@ enum rte_crypto_cipher_algorithm { /**< ShangMi 4 (SM4) algorithm in ECB mode */ RTE_CRYPTO_CIPHER_SM4_CBC, /**< ShangMi 4 (SM4) algorithm in CBC mode */ - RTE_CRYPTO_CIPHER_SM4_CTR + RTE_CRYPTO_CIPHER_SM4_CTR, /**< ShangMi 4 (SM4) algorithm in CTR mode */ + RTE_CRYPTO_CIPHER_SM4_OFB, + /**< ShangMi 4 (SM4) algorithm in OFB mode */ + RTE_CRYPTO_CIPHER_SM4_CFB + /**< ShangMi 4 (SM4) algorithm in CFB mode */ }; /** Cipher algorithm name strings */ @@ -376,6 +380,8 @@ enum rte_crypto_auth_algorithm { /**< HMAC using 512 bit SHA3 algorithm. */ RTE_CRYPTO_AUTH_SM3, /**< ShangMi 3 (SM3) algorithm */ + RTE_CRYPTO_AUTH_SM3_HMAC, + /** < HMAC using ShangMi 3 (SM3) algorithm */ RTE_CRYPTO_AUTH_SHAKE_128, /**< 128 bit SHAKE algorithm. */ -- 2.19.0.rc0.windows.1