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 BF724A00BE; Mon, 25 Apr 2022 06:15:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC9B6427F6; Mon, 25 Apr 2022 06:15:09 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140057.outbound.protection.outlook.com [40.107.14.57]) by mails.dpdk.org (Postfix) with ESMTP id 726C4427F2 for ; Mon, 25 Apr 2022 06:15:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L1YiV6P4vbb5LEmbOHBorWrzGIhTwS7GNjJDoN6+i4b8TCZ/4ZqeKBpkg53lDGNDP1Flb94ytoVYzj6hJOa9v5LY8w1cVCIvC8DIqbulTjL8lFhLp+G+CRrlcS2yyxsafQnQBgSvi8fqkoyCeMK+BCxSoJpLSACc8WfoohvjEMvmsojIhsWhKWwE84p3d5jcDKb2sq4Lu8yhd0vr0N+9s2iip/9kPYsNZ4K25w735lxSz2VzfO6/OEP4HKcnagGdfL2jj5IH9mxY81YboGOrKGwdMGtlQKAopgiS4w6LHMFi2n8ExaQm9ss9QtLtXi0f6GjbttGaPAX+dE/6bDUj8A== 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=rIe7vB8XLHfNd2LZ/UZs2kQRKNCUs8qy6eqgMHdOj/g=; b=nVa2oxz6XTCHZ0pO90+DgQ2N5q6ONDxG88/lyvNwp3pkeXZsd4gi2s/YfZfDJrmNMJF9eMTvFAF2MJ98Rt5RrWft4Th819YtuT0FyA14ztTAy4qlLrkj/1JR/yvYfmUQMNLu0RJGyhn1oSaLdhlmJDNyTKD8OoWYQKh2fOZ4RtkHHq3RmlYdTbhtLalO2ICzpFajXZL9n7qNJCs5AffnIb4JmKzvqsuT7IDT/QmPPOmxVqs5YnznwFJEP4z/fBzflxsJDxQI0kMyOFIm0nw7AfPY4+0sp8hlDrZO0CsghRPa38zmkOSqfEGSIjVaMIYdqdxq2SPDklhEmndcsewiaw== 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=rIe7vB8XLHfNd2LZ/UZs2kQRKNCUs8qy6eqgMHdOj/g=; b=lWL/Ei8BmInTYr2FXNJm8Zev5nKlTqtIdr1L2fNpNBE/MWXUprGL1FjY+RSfc+NnYr5FT5rWqitbEj7T5Y+6I3LTy/460MPGLdkd3iKu/OLeJWDNCxqqS+3Bc8Y5RuWVJ+ZyLTA0DhqSWjsebnWYPIwTEo84QwoK7Eo7N7kA0Z4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by PA4PR04MB9416.eurprd04.prod.outlook.com (2603:10a6:102:2ab::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.21; Mon, 25 Apr 2022 04:15:06 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::8cf1:93b:c340:3be2]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::8cf1:93b:c340:3be2%7]) with mapi id 15.20.5186.021; Mon, 25 Apr 2022 04:15:06 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: Gagandeep Singh Subject: [PATCH 3/8] examples/ipsec-secgw: support XCBC-MAC/DES-CBC Date: Mon, 25 Apr 2022 09:44:18 +0530 Message-Id: <20220425041423.2232034-3-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220425041423.2232034-1-g.singh@nxp.com> References: <20220425041423.2232034-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0165.apcprd01.prod.exchangelabs.com (2603:1096:4:28::21) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9b560ea-1c44-437b-8f9f-08da26722dcc X-MS-TrafficTypeDiagnostic: PA4PR04MB9416:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vnD2gttTULdl8iXBpyNQL6QYa8ngxSTnIUmptxYhI4TuUGFbfRsvrx1dOEj2YBRXHzVW3H9tsON9LHCtzplK6+Ygi9URBVI49QZMW4Io4zn2in2wpAoAH8oeCTTe5y5wWva/l7W04wSQNmHxsWX5FvJH3GASSJXhK392BdnGCv20rfkAK9AogcipCZmlhGYy/KUkIaxVmxXkZs/BTP9ki6B6RiJYPH5/Lrs4/fga4CKhv8Sthc5ef/jY4Bjyt5zWhffcpfQ8t351nUZFoxrTBKtTAOMsBQFDQBUCDBLXADC5ZKXL//EcSL53uAziBEOnylul4CbfIyWZmd3C7rh/BYzgWdIIFWN39RNxlJfu/42AjJsQrGkGZoNqqCrcT2ftI6dYQZcs52AHPUueJHWPqX5rU4wAi7/6q3AxFNZg0g5E4466a3zOsK+ArsDpWGOoc3eH7D5YJ9yoMwzaCWjyH7v2hXt7ujo9y4nmJvswO3HoNx0Rw0rGw75h7v5W5xqAUewIiPM2k6rsXWn/iet5DspsQFibUPzIplx4fneEzqpxqTRM54OJZgA5GF8syiMOyH4WeDOsu8WCgWiuS6vQaZ7iGKpcGIYvl+z7isxd8JYQWCEL43TPVOQ7agvfI1Tz2skLG0uKbcMRZp/VRXVaEpifKArQIo72Ox7MoyC9M/ufGA4WA1g2qFM+BA1PqQ0BmV0lqjSb6G4xQ2g8TdMoVA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(4326008)(66556008)(6666004)(2616005)(5660300002)(66946007)(6512007)(8936002)(26005)(2906002)(38350700002)(86362001)(1076003)(38100700002)(52116002)(508600001)(6486002)(83380400001)(66476007)(8676002)(186003)(316002)(55236004)(6506007)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?yMkq8BDFtBUbwgAGG2PuewaqXaYIxH1TGhs8RX9Wn7vVBsGLvyq9CORPCW5i?= =?us-ascii?Q?Tp+vS6eRRd4IXHySz46kTrq7rhnY774Qu09daNtyQ96hPcfbLInyumqPQTww?= =?us-ascii?Q?sPwJyNag9Vvutp+PgHs8OmMqzVj4/QIwMdEO7GkBA1Lm1/P9asLtdxsVzMuj?= =?us-ascii?Q?9YiNLhZsQ52oaNpzWtl0nNTf6JADFdG8+Uwb2yP/aj5HvVi2NggTgnTNDUxC?= =?us-ascii?Q?pdmTth5NWNxXGZX6A6ZiGU0ueOvphcARMn2IT8lZ55X1Xkm/n+TwXK2q19wc?= =?us-ascii?Q?pFEqcZJ8icFk+irGEKy1CAByMrWu8VKUfXMo4W0x5JB9yqZGnAAKnmzq5WLn?= =?us-ascii?Q?DUcGOQd81tbx/X7rHsPDqztOvJ9+mXJ1h+/Fc8xWR4sFy0ZBFOvnsnD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36UKkWrEsA0D2OVvnuNgVXnGTXfjpvePFTEq?= =?us-ascii?Q?q9tBJMrjFsqNbLFsBz8VO0HDaT1qhroMMGLJtKPwPXgPpRLnnfk0QnB89z55?= =?us-ascii?Q?7E7o9ZQqNBfkWMnVg+LnKICm/P2Xl+EwuGpwhtKefgFErr+fW5krTJFIP8qh?= =?us-ascii?Q?uYhsPdguTmZofZOWIBbGR+rCVMzfP6SS0Ug53zd4NnW7jWkv6tpyzh6ZOAF3?= =?us-ascii?Q?PsUEe64Wyb05RJHkFCh4a0ehRAf9e6OU+E0TzpdsMprDh06QTkwWIUHWMw6P?= =?us-ascii?Q?l0eVAD7jwcJchYS6S4MNxS9OYHJGYwA6VmKGPdLgP8ZctqY4BVVtjVNWR6Bi?= =?us-ascii?Q?I7/gw2I9pjl9rYP6xj7WP9pz1RdmcTr14T9A7D2xvQzBKyJWfEW+XlAOdR0K?= =?us-ascii?Q?hvBv1PfXyImThdNhqLn/h0a6FYWsShbeQJ3di9/klVJWytLib/2DIFHkF31H?= =?us-ascii?Q?qjBBdwEtDA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9b560ea-1c44-437b-8f9f-08da26722dcc X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2022 04:15:06.5366 (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: uZ7xnhwakPfnVm0h5nMEyfTmX3NK1lUkqGqdCabHwAH9o8UJZDxDlbp9tx13yduE X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9416 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 ipsec-secgw application is updated to support DES-CBC ciphering and XCBC-MAC authentication based IPsec functionality. Signed-off-by: Gagandeep Singh --- examples/ipsec-secgw/esp.c | 5 +++++ examples/ipsec-secgw/sa.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c index bd233752c8..b72a5604c8 100644 --- a/examples/ipsec-secgw/esp.c +++ b/examples/ipsec-secgw/esp.c @@ -100,6 +100,7 @@ esp_inbound(struct rte_mbuf *m, struct ipsec_sa *sa, switch (sa->cipher_algo) { case RTE_CRYPTO_CIPHER_NULL: + case RTE_CRYPTO_CIPHER_DES_CBC: case RTE_CRYPTO_CIPHER_3DES_CBC: case RTE_CRYPTO_CIPHER_AES_CBC: /* Copy IV at the end of crypto operation */ @@ -121,6 +122,7 @@ esp_inbound(struct rte_mbuf *m, struct ipsec_sa *sa, case RTE_CRYPTO_AUTH_NULL: case RTE_CRYPTO_AUTH_SHA1_HMAC: case RTE_CRYPTO_AUTH_SHA256_HMAC: + case RTE_CRYPTO_AUTH_AES_XCBC_MAC: sym_cop->auth.data.offset = ip_hdr_len; sym_cop->auth.data.length = sizeof(struct rte_esp_hdr) + sa->iv_len + payload_len; @@ -336,6 +338,7 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa *sa, } else { switch (sa->cipher_algo) { case RTE_CRYPTO_CIPHER_NULL: + case RTE_CRYPTO_CIPHER_DES_CBC: case RTE_CRYPTO_CIPHER_3DES_CBC: case RTE_CRYPTO_CIPHER_AES_CBC: memset(iv, 0, sa->iv_len); @@ -399,6 +402,7 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa *sa, } else { switch (sa->cipher_algo) { case RTE_CRYPTO_CIPHER_NULL: + case RTE_CRYPTO_CIPHER_DES_CBC: case RTE_CRYPTO_CIPHER_3DES_CBC: case RTE_CRYPTO_CIPHER_AES_CBC: sym_cop->cipher.data.offset = ip_hdr_len + @@ -431,6 +435,7 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa *sa, case RTE_CRYPTO_AUTH_NULL: case RTE_CRYPTO_AUTH_SHA1_HMAC: case RTE_CRYPTO_AUTH_SHA256_HMAC: + case RTE_CRYPTO_AUTH_AES_XCBC_MAC: sym_cop->auth.data.offset = ip_hdr_len; sym_cop->auth.data.length = sizeof(struct rte_esp_hdr) + sa->iv_len + pad_payload_len; diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index 1839ac71af..8159b32a72 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -119,6 +119,13 @@ const struct supported_cipher_algo cipher_algos[] = { .iv_len = 8, .block_size = 8, .key_len = 24 + }, + { + .keyword = "des-cbc", + .algo = RTE_CRYPTO_CIPHER_DES_CBC, + .iv_len = 8, + .block_size = 8, + .key_len = 8 } }; @@ -1301,6 +1308,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[], } else { switch (sa->cipher_algo) { case RTE_CRYPTO_CIPHER_NULL: + case RTE_CRYPTO_CIPHER_DES_CBC: case RTE_CRYPTO_CIPHER_3DES_CBC: case RTE_CRYPTO_CIPHER_AES_CBC: case RTE_CRYPTO_CIPHER_AES_CTR: -- 2.25.1