From patchwork Tue Dec 19 17:00:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122396 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4418814qgn; Tue, 19 Dec 2017 09:04:39 -0800 (PST) X-Google-Smtp-Source: ACJfBouj9kj6+fKnP0fBTiVT6SZt8k/6dlIy2UBruttdP99hAFOvNr737SH8JhjBAgfgre4sUPO3 X-Received: by 10.55.215.144 with SMTP id t16mr5977486qkt.15.1513703079320; Tue, 19 Dec 2017 09:04:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513703079; cv=none; d=google.com; s=arc-20160816; b=Ja5UyGDPCc1ExxXoJwjsSjeMzD6YZhitQd4e5SyeYrPAJiG9azTx6auiyHaHtlwUDT Kt4eHOVg8rcn4G7VMP3m3uRhHohFebDmuVfGrVRxMWF+qURhsbInP1EItF7ucjm2zO8O q8moDNVktD524GOjw052zksFUDUM/psYtRgZfLlWLMkBSqbfLbTP/j7FqMniYb6mLAn5 fF2K4EhUlqOrppxcSAOwmV4YbmVLfYqPb8UvD/KIo4ZKOvV3issnZFjg5mqt1X7WYmAZ EwJmBBuG84oMUmO2Ln13NAySWnVRYL5fc2DF0ktxHhU8ajsPpZHcKEYo7TWzCy8okMdj SafQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=RiCQhCc7Tf5YKqBtTHY8qdWuzvM0cgeUdo49gEG+sy4=; b=mii8tpSXHPcXMQBjdvQA7VWWn4TCSsxNm2DZWJBLU6cgLESA8UXv0AnfLIasVn4mRX gMcfS/dPwfoYOpQ6SXzgQBUOtWP2fx4k4jiQa7n+LVlzVDYwyphrpmSqh7LQqz4Nox/0 b5eZ5G4UdMo+WO1m00TpT9Oh7vzHoNEeGj+pvEAXptiBU55sqUsRCYJ/kjTRUcc66hSE Z6j7XhZZuJ+zBfSb9OvtjbK7qrkGy4vF7Qv09z8kRix84WrEo7mbnB+INn9J/QZ9kG6Q TYuy5KeITTYNzNgutSaC273Gkq7QwbJVL5Xl5lB0GmjNzvxCt67vjifmLlG2+H8NBkmr YzYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id k20si4366900qta.90.2017.12.19.09.04.19; Tue, 19 Dec 2017 09:04:39 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id DBFD461507; Tue, 19 Dec 2017 17:04:19 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 73161609A2; Tue, 19 Dec 2017 17:01:59 +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 9CB8A608EE; Tue, 19 Dec 2017 17:01:54 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id 4E94F60922 for ; Tue, 19 Dec 2017 17:00:43 +0000 (UTC) Received: from mxback10o.mail.yandex.net (mxback10o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::24]) by forward106p.mail.yandex.net (Yandex) with ESMTP id EC3112D846D9 for ; Tue, 19 Dec 2017 20:00:41 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback10o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id JH64yPbltQ-0fqOHglL; Tue, 19 Dec 2017 20:00:41 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2t1pYpjnSk-0fNaRV8V; Tue, 19 Dec 2017 20:00:41 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 19 Dec 2017 20:00:37 +0300 Message-Id: <1513702837-14228-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513702837-14228-1-git-send-email-odpbot@yandex.ru> References: <1513702837-14228-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 350 Subject: [lng-odp] [PATCH API-NEXT v1 1/1] api, linux-gen, validation: crypto change api.ptr to api_ptr in packet params 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" From: Dmitry Eremin-Solenikov In new odp_crypto_packet_op_param_t change AAD from struct with a single pointer to just data pointer. This API is new, so there is no need to deprecate and/or handle old pointer in any specific way. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 350 (lumag:crypto_aad_ptr) ** https://github.com/Linaro/odp/pull/350 ** Patch: https://github.com/Linaro/odp/pull/350.patch ** Base sha: 12fd3a9224a856271934986a1bad981843915d68 ** Merge commit sha: fc4fdced93ab324c7858f25bd4b9c39ac1dfcce4 **/ include/odp/api/spec/crypto.h | 12 ++++-------- platform/linux-generic/odp_crypto.c | 6 +++--- platform/linux-generic/odp_ipsec.c | 4 ++-- test/validation/api/crypto/odp_crypto_test_inp.c | 4 ++-- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 293c15c6e..1276295eb 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -447,14 +447,10 @@ typedef struct odp_crypto_packet_op_param_t { */ uint32_t hash_result_offset; - /** Additional Authenticated Data (AAD) */ - struct { - /** Pointer to AAD. AAD length is defined by 'auth_aad_len' - * session parameter. - */ - uint8_t *ptr; - - } aad; + /** Pointer to AAD. AAD length is defined by 'auth_aad_len' + * session parameter. + */ + uint8_t *aad_ptr; /** Data range to apply cipher */ odp_packet_data_range_t cipher_range; diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index b9cc21a15..18fec60ae 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -478,7 +478,7 @@ odp_crypto_alg_err_t aes_gcm_encrypt(odp_packet_t pkt, odp_crypto_generic_session_t *session) { EVP_CIPHER_CTX *ctx; - const uint8_t *aad_head = param->aad.ptr; + const uint8_t *aad_head = param->aad_ptr; uint32_t aad_len = session->p.auth_aad_len; void *iv_ptr; int dummy_len = 0; @@ -525,7 +525,7 @@ odp_crypto_alg_err_t aes_gcm_decrypt(odp_packet_t pkt, odp_crypto_generic_session_t *session) { EVP_CIPHER_CTX *ctx; - const uint8_t *aad_head = param->aad.ptr; + const uint8_t *aad_head = param->aad_ptr; uint32_t aad_len = session->p.auth_aad_len; int dummy_len = 0; void *iv_ptr; @@ -1057,7 +1057,7 @@ odp_crypto_operation(odp_crypto_op_param_t *param, packet_param.session = param->session; packet_param.override_iv_ptr = param->override_iv_ptr; packet_param.hash_result_offset = param->hash_result_offset; - packet_param.aad.ptr = param->aad.ptr; + packet_param.aad_ptr = param->aad.ptr; packet_param.cipher_range = param->cipher_range; packet_param.auth_range = param->auth_range; diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 4f23eb17b..ff8201c44 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -424,7 +424,7 @@ static int ipsec_in_esp(odp_packet_t *pkt, state->esp.aad.seq_no = esp.seq_no; state->in.seq_no = odp_be_to_cpu_32(esp.seq_no); - param->aad.ptr = (uint8_t *)&state->esp.aad; + param->aad_ptr = (uint8_t *)&state->esp.aad; param->auth_range.offset = ipsec_offset; param->auth_range.length = state->ip_tot_len - @@ -1029,7 +1029,7 @@ static int ipsec_out_esp(odp_packet_t *pkt, state->esp.aad.spi = esp.spi; state->esp.aad.seq_no = esp.seq_no; - param->aad.ptr = (uint8_t *)&state->esp.aad; + param->aad_ptr = (uint8_t *)&state->esp.aad; memset(&esptrl, 0, sizeof(esptrl)); esptrl.pad_len = encrypt_len - ip_data_len - _ODP_ESPTRL_LEN; diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index cba472ded..0a9c10233 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -174,7 +174,7 @@ static int alg_packet_op(odp_packet_t pkt, if (op_iv_ptr) op_params.override_iv_ptr = op_iv_ptr; - op_params.aad.ptr = aad; + op_params.aad_ptr = aad; op_params.hash_result_offset = plaintext_len; @@ -232,7 +232,7 @@ static int alg_packet_op_enq(odp_packet_t pkt, if (op_iv_ptr) op_params.override_iv_ptr = op_iv_ptr; - op_params.aad.ptr = aad; + op_params.aad_ptr = aad; op_params.hash_result_offset = plaintext_len;