From patchwork Tue Apr 25 16:30:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Eremin-Solenikov X-Patchwork-Id: 98223 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp2036963qgf; Tue, 25 Apr 2017 09:31:08 -0700 (PDT) X-Received: by 10.55.170.209 with SMTP id t200mr7585219qke.177.1493137868499; Tue, 25 Apr 2017 09:31:08 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id s28si22569469qte.60.2017.04.25.09.31.07; Tue, 25 Apr 2017 09:31:08 -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 sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C3D2260C51; Tue, 25 Apr 2017 16:31:07 +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.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, URIBL_BLOCKED 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 453F46091A; Tue, 25 Apr 2017 16:31:03 +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 7754B60B51; Tue, 25 Apr 2017 16:30:59 +0000 (UTC) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) by lists.linaro.org (Postfix) with ESMTPS id 83E326063E for ; Tue, 25 Apr 2017 16:30:57 +0000 (UTC) Received: by mail-lf0-f45.google.com with SMTP id t144so93935341lff.1 for ; Tue, 25 Apr 2017 09:30:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=vf6tBuMBRId/h1uz8NJ0vTn7g0kUteGzt1c4wsLWdlI=; b=JRig60Z/mPS09JjtFS4TOyz1HxArwEtDWvSyJjipvBUA+OUJNFoqwQSBVRQsueZhYO JNvpFE8Z9czVUZQww1Syl2pIkKHfgzagyzH4L8S/OQQSBILOyNJJwc86Yk4Bm8q/V7Bx 5ddlYonmF098PZ0lSbUlQulTXAL/HXzY41pnTMO0HlSLEg6oT339UQZ1vUiSmR9WwTzb bXmHnzYRTyTd+Yz+zgJHstPWy1buTiL6INCo5R2rohQYrXYlXrLYyNzoTdzntFv5jAGd 1L5vzklpqnnz8DSE2hma5ylbLAq5fqRwF9kFRPumVqRNoOYeUkawNtSb47pNG4oevs0V Blkg== X-Gm-Message-State: AN3rC/5Jq68/7XFJCAuBKWiBDpskgF9W2U2qh7unonkCV/VMKtzy/w6E FzYW8oblTlux8CPuFuEs14XE X-Received: by 10.25.56.65 with SMTP id d1mr10647148lfj.30.1493137855921; Tue, 25 Apr 2017 09:30:55 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([188.162.64.143]) by smtp.gmail.com with ESMTPSA id o27sm30138lfg.3.2017.04.25.09.30.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Apr 2017 09:30:53 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Tue, 25 Apr 2017 19:30:51 +0300 Message-Id: <20170425163051.19651-1-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [lng-odp] [API-NEXT PATCH] api: packet: introduce odp_packet_data_range_t 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" Rename odp_crypto_data_range_t to odp_packet_data_range_t, as it is relevant not only to the crypto interface. Signed-off-by: Dmitry Eremin-Solenikov --- include/odp/api/spec/crypto.h | 17 +++++++---------- include/odp/api/spec/packet.h | 12 ++++++++++++ .../validation/api/crypto/odp_crypto_test_inp.c | 4 ++-- test/common_plat/validation/api/crypto/test_vectors.h | 4 ++-- 4 files changed, 23 insertions(+), 14 deletions(-) -- 2.11.0 Signed-off-by: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index d30f050f..c216c017 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -19,6 +19,8 @@ extern "C" { #endif +#include + /** @defgroup odp_crypto ODP CRYPTO * Macros, enums, types and operations to utilise crypto. * @{ @@ -238,15 +240,10 @@ typedef struct odp_crypto_iv { /** * Crypto API data range specifier + * + * @deprecated Use odp_packet_data_range_t instead */ -typedef struct odp_crypto_data_range { - /** Offset from beginning of packet */ - uint32_t offset; - - /** Length of data to operate on */ - uint32_t length; - -} odp_crypto_data_range_t; +#define odp_crypto_data_range_t odp_packet_data_range_t /** * Crypto API session creation parameters @@ -365,10 +362,10 @@ typedef struct odp_crypto_op_param_t { uint32_t hash_result_offset; /** Data range to apply cipher */ - odp_crypto_data_range_t cipher_range; + odp_packet_data_range_t cipher_range; /** Data range to authenticate */ - odp_crypto_data_range_t auth_range; + odp_packet_data_range_t auth_range; } odp_crypto_op_param_t; diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 5439f234..95f5349b 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -71,6 +71,18 @@ extern "C" { * Packet is red */ +/** + * Packet API data range specifier + */ +typedef struct odp_packet_data_range { + /** Offset from beginning of packet */ + uint32_t offset; + + /** Length of data to operate on */ + uint32_t length; + +} odp_packet_data_range_t; + /* * * Alloc and free diff --git a/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c b/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c index 42149ac6..dfd4f122 100644 --- a/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c @@ -71,8 +71,8 @@ static void alg_test(odp_crypto_op_t op, odp_crypto_key_t cipher_key, odp_auth_alg_t auth_alg, odp_crypto_key_t auth_key, - odp_crypto_data_range_t *cipher_range, - odp_crypto_data_range_t *auth_range, + odp_packet_data_range_t *cipher_range, + odp_packet_data_range_t *auth_range, const uint8_t *plaintext, unsigned int plaintext_len, const uint8_t *ciphertext, diff --git a/test/common_plat/validation/api/crypto/test_vectors.h b/test/common_plat/validation/api/crypto/test_vectors.h index da4610f3..a1cf4faf 100644 --- a/test/common_plat/validation/api/crypto/test_vectors.h +++ b/test/common_plat/validation/api/crypto/test_vectors.h @@ -139,14 +139,14 @@ static uint8_t aes128_gcm_reference_iv[][AES128_GCM_IV_LEN] = { static uint32_t aes128_gcm_reference_length[] = { 84, 72, 72, 40}; -static odp_crypto_data_range_t aes128_gcm_cipher_range[] = { +static odp_packet_data_range_t aes128_gcm_cipher_range[] = { { .offset = 12, .length = 72 }, { .offset = 8, .length = 64 }, { .offset = 8, .length = 64 }, { .offset = 12, .length = 28 }, }; -static odp_crypto_data_range_t aes128_gcm_auth_range[] = { +static odp_packet_data_range_t aes128_gcm_auth_range[] = { { .offset = 0, .length = 84 }, { .offset = 0, .length = 72 }, { .offset = 0, .length = 72 },