From patchwork Thu Sep 1 15:22:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikhil Agarwal X-Patchwork-Id: 75183 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp200217qga; Thu, 1 Sep 2016 02:54:48 -0700 (PDT) X-Received: by 10.36.225.15 with SMTP id n15mr2561438ith.9.1472723688449; Thu, 01 Sep 2016 02:54:48 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l63si34368637ita.38.2016.09.01.02.54.45; Thu, 01 Sep 2016 02:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 5795061761; Thu, 1 Sep 2016 09:54:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DATE_IN_FUTURE_03_06, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 929636175D; Thu, 1 Sep 2016 09:54:39 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 8B9E66175E; Thu, 1 Sep 2016 09:54:37 +0000 (UTC) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0083.outbound.protection.outlook.com [104.47.33.83]) by lists.linaro.org (Postfix) with ESMTPS id 450AF60E88 for ; Thu, 1 Sep 2016 09:54:36 +0000 (UTC) Received: from BLUPR0301CA0011.namprd03.prod.outlook.com (10.162.113.149) by CY1PR0301MB2012.namprd03.prod.outlook.com (10.164.2.18) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9; Thu, 1 Sep 2016 09:54:35 +0000 Received: from BN1AFFO11FD043.protection.gbl (2a01:111:f400:7c10::187) by BLUPR0301CA0011.outlook.office365.com (2a01:111:e400:5259::21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9 via Frontend Transport; Thu, 1 Sep 2016 09:54:35 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 192.88.168.50 as permitted sender) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD043.mail.protection.outlook.com (10.58.52.190) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Thu, 1 Sep 2016 09:54:34 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u819sWiW015718 for ; Thu, 1 Sep 2016 02:54:33 -0700 From: Nikhil Agarwal To: Date: Thu, 1 Sep 2016 20:52:53 +0530 Message-ID: <20160901152253.25446-1-nikhil.agarwal@linaro.org> X-Mailer: git-send-email 2.9.3 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131171972743784804; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(199003)(189002)(36756003)(68736007)(107886002)(305945005)(19580395003)(86362001)(19580405001)(229853001)(106466001)(586003)(92566002)(97736004)(47776003)(7846002)(1076002)(356003)(87936001)(110136002)(50986999)(48376002)(77096005)(50226002)(105596002)(81156014)(81166006)(5003940100001)(11100500001)(450100001)(50466002)(8936002)(8676002)(2351001)(626004)(5660300001)(2906002)(189998001)(104016004)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB2012; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD043; 1:LTB3jn4PYIFO0hwsb99AqlByJGY3pZ2/VN0nCPVv+JbAt+EyZgVVgLxGe3pi07Oia6M7N8H3u/o8ZlYpd0bJ6Bl7cJEC1X2jX1IXylKnPELbAK3h0yfpS7EZiVC1CA63r1XHL5Ce9Kd8Z1x6fiNR+Nvhbjra0mcHi3NFKFdMbArd7+slEEZqz7GTAXxnMSmBKe9nvzlCwxBdI2QwTxhReAjNEsEnA2K9KzrP8EgYVCTv3s+aCeTEvRRlPDD5KcMt5/IT9YRBXNt7Dbt/36XfgtYMcFA8Q+KxVW1XXwZxlU9nrp42S4WdzAZK85MbpSgzE4bKiZ9mBYzl+nmnR3RmBzwV+SidoHzZIer5LPx9+Jtoi9hpsipNRsoLfEoJomPxxJK3dyihbG0GHvkZ2WouqMkKEDvSO4OWSAaYf8ILF7jU4E8W/zdLz5bM0b0fw+wfi4+eYUSnnfhAAYkYpFKM99Hi54BcDVRqBcXbfyel6UGvs8rf1MvwqzQV6NvqfS4dKPC7Mewc5Zv6qmauGoEj0bRLg7cCVQ2JkhYgIRultrx6yN9n4KzkTS0pa4NeY4nA MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 869c8b08-382e-425c-0803-08d3d24dfa56 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2012; 2:MyQ7QZDPZKLApOtdxUHpSnvge2qe45I29ZHXOgUF9rHnJ2KR9lgC7nJ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wWK93XP95P3SSGrD7ftYmAukMYglQdXl1GxGB3CKpcK983VTNw1MOM6Cl96Lvw0XCNlIpN/KyxlnWI6/2T2MFjvRkHDLl7lPFHqi3bx9Cbgz+D/35ULXpMu7MHT+NhazqrxGCNQZIpzAo= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2012; 31:w3FS7rm0gAd19SUSiifNKIpx6azgSjmdpMOXaP+Whw36s5R2x2AgSybkYrtmQBb5oaXzDsS7dgx/XCEzSPkIuhfpTWQelB22pirF9wHt4rj0FeYbMwYo1Ag7ugA3RaAdOaG1+J4GCq8xK1VJv2EZqbj331DuWqGrOPgXhJBCtGUlst9ZzURNyWvGVPLvN9p9bWuh8ldVRoByqsVUMj+lfs+CZ6LFpKX7lRQYGZE/Eps=; 4:2RTOOes5iiRYV22Ri6iyXE9w6sNRGuU8wMR31LrjDWUv52eabm0l8knJJoZ83X6WkaXtPytZ2mOMEDfJg/1IeVpWOwnTjcq1X0X26Th15/6FkIBg41nnpAcSrRo7WMXIA2idVIKL20A43mSIN6HDrxKPNADTpNUerGRueaJpiNgrHBicwtPumzoppRoMWFBJsXEnIp16sz53Mv9vuqRxXj+ZO98MnJ55XYtPVOR8Wgc98bGDAyJEqnUhQlI1D4Q7LcXqsFc8j4EP9liLPxqnEsUVrenbUEARnWb7vVWjEuUeqFzUIsP92IYcPPHMAxUZVF24rFU2CbmAfvGEv4bMvvQNaPnMvTC3RmlE1revFIL9jEaTXbfDzW0DroUU4X3A/RK1cmxVCJr3JMGVukx0d7B7gtT+Fw7E2hUXYfZU9u92JwHry3Xsn+egg3RDrEJSzgenrKMAnNV1b4+6+evvUr+f4E9gMQMzWsNTrqUcadslZaKjf81okSZWA+GuH/VFSb7BX5pgWbK4a9tp7oG+ZcVBDqinKfpDjBnZROCXYOA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13024025)(13015025)(13023025)(13018025)(13017025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:CY1PR0301MB2012; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB2012; X-Forefront-PRVS: 0052308DC6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB2012; 23:wMQ/X9AxPBTixgzDk8FBuciIq2gn9Mk1ep5WAZZ?= =?us-ascii?Q?zvUaY9dBrv+h4YwTEsMtQxgQU+dU7ntSyI07kwBMIE0CxCzQKbeDNI5IQvsx?= =?us-ascii?Q?n/Cwpb3H+qPX5RvxfArG+dB94EvL6nqF/vl+UQWy/rBmaa/ViMqxEdkO7XpO?= =?us-ascii?Q?CUFrwUg1G41JCc5hg+ipSyHdzTKtESIGuiDKpC7VQQXTAKzIhoqqPD/7cAf7?= =?us-ascii?Q?cI+Xvqtdf7DXdEyCopwDnS2IAS6A9aI1jMV+uxiNzt5HQSekr47sl2q/jDGD?= =?us-ascii?Q?Dzk8qMWny/aO9AH/FuVfWy7Dvn3xXUJ7XpwqTxuNunfVoCjP2PpplU9odYm5?= =?us-ascii?Q?9YxkrQh1BOY0rCBY65MF5f6xt5iVIOxV/wuMIT/3hXlJM4quGCybpXcfmRgH?= =?us-ascii?Q?icVZHe0p2G7/q+mxnAsbFzTbZmZ+TqooQVwJo1URJE88oM6UYRoshHtt4nCq?= =?us-ascii?Q?SUSJDhJpGJVHpKoFsfPozAXoUgCwLf0hfJU+A+naEKY3JEnCXlC2Bfa0INIe?= =?us-ascii?Q?MpeiI5EQYZtXVaDhzvxN2KKZY9xYhieNS7Wt7jsyXPjGB0V0MOWSTB9ey+/n?= =?us-ascii?Q?/f3Zop4m8DFM0k3VjpT59EdQBegVVDPkoX6WNVpxWeS7QHaVBAX62e8PXJqr?= =?us-ascii?Q?nWxPLf0DZZ5sgyHA+DB0BORbtqvqdiTtQpFGAsBhDA+Rt9ZfzmE5Fk7ey0OE?= =?us-ascii?Q?Kf2x+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:9xP8AP0v8/AGq/qFnc2zNpEcm55rDuxNi7b7xMLUhOFh8293jHegGxYMibIxawpeGX94gXyN4dVbx/4NIZ+xA6dEGt7UZZkDQUuszOWx/1ol2fsaYPjVW5vPLnkapZf/t66pAZseXMYf8uq6AwwPtQYJSf+WnSt3RG1Racj74o6ocoxNoZ78vaEdyJmQY43ER08PTCOJKHtLOaxRBzJ3JAeAIwtep6K7fe2Ixax0Z6P850IKpHyBCjlGoFHK+aWG SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2016 09:54:34.1912 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB2012 X-Topics: crypto Subject: [lng-odp] [RFC] api:crypto: Adding IPSEC protocol APIs. X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Nikhil Agarwal --- include/odp/api/spec/crypto.h | 29 +++++++++ include/odp/api/spec/crypto_ipsec.h | 114 ++++++++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 include/odp/api/spec/crypto_ipsec.h -- 2.9.3 diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index dea1fe9..b629b82 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -144,6 +144,27 @@ typedef union odp_crypto_auth_algos_t { uint32_t all_bits; } odp_crypto_auth_algos_t; + +/** + * Network security protocols in bit field structure + */ +typedef union odp_crypto_protocol_t { + /** Network security protocols */ + struct { + /** ODP_AUTH_ALG_NULL */ + uint32_t ipsec_esp : 1; + + /** ODP_AUTH_ALG_MD5_96 */ + uint32_t ipsec_ah : 1; + + } bit; + + /** All bits of the bit field structure + * + * This field can be used to set/clear all flags, or bitwise + * operations over the entire structure. */ + uint32_t all_bits; +} odp_crypto_protocol_t; /** * Crypto API key structure */ @@ -264,6 +285,8 @@ typedef enum { ODP_CRYPTO_SES_CREATE_ERR_INV_CIPHER, /** Creation failed, bad auth params */ ODP_CRYPTO_SES_CREATE_ERR_INV_AUTH, + /** Creation failed, bad protocol params */ + ODP_CRYPTO_SES_CREATE_ERR_INV_PROTO, } odp_crypto_ses_create_err_t; /** @@ -332,6 +355,12 @@ typedef struct odp_crypto_capability_t { /** Authentication algorithms implemented with HW offload */ odp_crypto_auth_algos_t hw_auths; + /** Supported authentication algorithms */ + odp_crypto_protocol_t protocols; + + /** Authentication algorithms implemented with HW offload */ + odp_crypto_protocol_t hw_protocols; + } odp_crypto_capability_t; /** diff --git a/include/odp/api/spec/crypto_ipsec.h b/include/odp/api/spec/crypto_ipsec.h new file mode 100644 index 0000000..e80e2d9 --- /dev/null +++ b/include/odp/api/spec/crypto_ipsec.h @@ -0,0 +1,114 @@ +/* Copyright (c) 2014, Linaro Limited + * Copyright (c) 2015 - 2016 Freescale Semiconductor, Inc. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP crypto IPSec extension + */ + +#ifndef ODP_API_CRYPTO_IPSEC_H_ +#define ODP_API_CRYPTO_IPSEC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef enum odp_ipsec_mode { + ODP_IPSEC_MODE_TUNNEL, /**< IPSec tunnel mode */ + ODP_IPSEC_MODE_TRANSPORT, /**< IPSec transport mode */ +} odp_ipsec_mode_t; + +typedef enum odp_ipsec_proto { + ODP_IPSEC_ESP, /**< ESP protocol */ +} odp_ipsec_proto_t; + +typedef enum odp_ipsec_outhdr_type { + ODP_IPSEC_OUTHDR_IPV4, /**< Outer header is IPv4 */ + ODP_IPSEC_OUTHDR_IPV6, /**< Outer header is IPv6 */ +} odp_ipsec_outhdr_type_t; + +typedef enum odp_ipsec_ar_ws { + ODP_IPSEC_AR_WS_NONE, /**< Anti-replay is not enabled */ + ODP_IPSEC_AR_WS_32, /**< Anti-replay window size 32 */ + ODP_IPSEC_AR_WS_64, /**< Anti-replay window size 64 */ + ODP_IPSEC_AR_WS_128, /**< Anti-replay window size 128 */ +} odp_ipsec_ar_ws_t; + +typedef struct odp_ipsec_params { + odp_ipsec_mode_t ipsec_mode; /** Transport or Tunnel */ + uint32_t spi; /** SPI value */ + uint32_t seq; /** Initial SEQ number */ + odp_ipsec_ar_ws_t ar_ws; /** Anti-replay window size - + inbound session with authentication */ + odp_bool_t esn; /** Use extended sequence numbers */ + odp_bool_t auto_iv; /** Auto IV generation for each operation. */ + uint16_t out_hdr_size; /** outer header size - tunnel mode */ + uint8_t *out_hdr; /** outer header - tunnel mode */ + odp_ipsec_outhdr_type_t out_hdr_type; /* outer header type - + tunnel mode */ + odp_bool_t ip_csum; /** update/verify ip header checksum */ + odp_bool_t ip_dttl; /** decrement ttl - tunnel mode encap & decap */ + odp_bool_t remove_outer_hdr; /** remove outer header - tunnel mode decap */ + odp_bool_t copy_dscp; /** DiffServ Copy - Copy the IPv4 TOS or + IPv6 Traffic Class byte from the inner/outer + IP header to the outer/inner IP header - + tunnel mode encap & decap */ + odp_bool_t copy_df; /** Copy DF bit - copy the DF bit from + the inner IP header to the + outer IP header - tunnel mode encap */ + odp_bool_t nat_t; /** NAT-T encapsulation enabled - tunnel mode */ + odp_bool_t udp_csum; /** Update/verify UDP csum when NAT-T enabled */ + +} odp_ipsec_esp_params_t; + +/** + * Configure crypto session for IPsec processing + * + * Configures a crypto session for IPSec protocol processing. + * Packets submitted to an IPSec enabled session will have + * relevant IPSec headers/trailers and tunnel headers + * added/removed by the crypto implementation. + * For example, the input packet for an IPSec ESP transport + * enabled session should be the clear text packet with + * no ESP headers/trailers prepared in advance for crypto operation. + * The output packet will have ESP header, IV, trailer and the ESP ICV + * added by crypto implementation. + * Depending on the particular capabilities of an implementation and + * the parameters enabled by application, the application may be + * partially or completely offloaded from IPSec protocol processing. + * For example, if an implementation does not support checksum + * update for IP header after adding ESP header the application + * should update after crypto IPSec operation. + * + * If an implementation does not support a particular set of + * arguments it should return error. + * + * @param session Session handle + * @param ipsec_proto IPSec protocol + * @param ipsec_params IPSec parameters. Parameters which are not + * relevant for selected protocol & mode are ignored - + * e.g. outer_hdr/size set for ESP transport mode. + * @retval 0 on success + * @retval <0 on failure + */ +int odp_crypto_ipsec_session_create(odp_crypto_session_params_t *ses_params, + odp_ipsec_proto_t ipsec_proto, + odp_ipsec_params_t *ipsec_params, + odp_crypto_session_t *session_out, + odp_crypto_ses_create_err_t *status); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif