From patchwork Thu May 4 11:30:50 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: 98515 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp517745obb; Thu, 4 May 2017 04:31:02 -0700 (PDT) X-Received: by 10.55.158.16 with SMTP id h16mr6816187qke.300.1493897462137; Thu, 04 May 2017 04:31:02 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c41si1675772qta.116.2017.05.04.04.31.01; Thu, 04 May 2017 04:31:02 -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 828A66071D; Thu, 4 May 2017 11:31:01 +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=0.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, RCVD_IN_SORBS_WEB 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 58A1D60655; Thu, 4 May 2017 11:30:57 +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 CD2E560665; Thu, 4 May 2017 11:30:55 +0000 (UTC) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) by lists.linaro.org (Postfix) with ESMTPS id B37B760510 for ; Thu, 4 May 2017 11:30:54 +0000 (UTC) Received: by mail-lf0-f44.google.com with SMTP id r17so6090366lfg.0 for ; Thu, 04 May 2017 04:30:54 -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=pTNxd8sctRmcv5Natw/Zd6tUrmUamP/u2vxLSS81N7A=; b=Z2ysCo4Fb9uUvckEdFbZvTrnNi0c3Frty3BGezpECqPc4r8MXJQ3fHapK/+18tJemV sUzuiKPp3FPuOLT3oSUOHqOp8y2VbQDS/Z17d8L1zOAWtpRHb7Ap3wOgyHL73oujf0D+ bQ4qOdlc5HR28p2JWOP6MlZZWQ1Ze9j+om+0inP1pwEr+stFPwCNT1qpv9GFrJW86cTT 2EmrCPcDCWPudtItpscTjw8RLex+r449H0RSxC8OfBftFrDQudeBc3NV9fR5jmRmguNk gmTZlzBkPr4WhvaSVGKmdeCltGQ5IKZA9zOvYZ4+JsZCTaTb/OjZ+f/Emk0q7IfX8VZK aQZw== X-Gm-Message-State: AN3rC/6ZrvbvJ9ANvFG1Kmk7x3xyoE0yKsBGw1h4j989EDLZAi0UOjfT hWl/gQDP4XPUrlEX0sa78rvP X-Received: by 10.25.193.212 with SMTP id r203mr12514582lff.157.1493897453257; Thu, 04 May 2017 04:30:53 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([94.25.228.67]) by smtp.gmail.com with ESMTPSA id 27sm392264ljb.69.2017.05.04.04.30.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 May 2017 04:30:52 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Thu, 4 May 2017 14:30:50 +0300 Message-Id: <20170504113050.17686-1-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [lng-odp] [PATCH API-NEXT v2] 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 Reviewed-by: Petri Savolainen diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 181c0cc4..4b0ee039 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -21,6 +21,8 @@ extern "C" { #endif +#include + /** @defgroup odp_crypto ODP CRYPTO * Macros, enums, types and operations to utilise crypto. * @{ @@ -243,15 +245,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; +typedef odp_packet_data_range_t ODP_DEPRECATE(odp_crypto_data_range_t); /** * Crypto API session creation parameters @@ -370,10 +367,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 db380c23..24ea4932 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 @@ -72,8 +72,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 },