From patchwork Tue Nov 14 20:00:10 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: 118889 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3467475qgn; Tue, 14 Nov 2017 12:07:13 -0800 (PST) X-Google-Smtp-Source: AGs4zMbSAH/5KCLG/tDcZ3PKUXgE0K6vDWDN67Xf2vpuLLG+a86nvrXAKUfYnTtLkkdxaj/TFFds X-Received: by 10.107.134.227 with SMTP id q96mr11411469ioi.197.1510690033874; Tue, 14 Nov 2017 12:07:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510690033; cv=none; d=google.com; s=arc-20160816; b=0uJ3a8eV/F99HYy38oiCj34Oj6Ik/rqPmBxRytlQ6PEgLd+zd9zGDqsSZVvF/C/M28 +CCGZG4UrAnPcXbHWgDgkdiY4TC9AbBhSFcP0I8TCuTeNn8UgNPFbiUffGH1cuTxrA0A fuDek4AOiZ2x1u9DtbAHQoyxTk0ij3lf4YKyDPoG300CypW67jpDykCiWbQswrYOdQLi xIkUcQfdvXyPGsL4kHgOPYJ5XjlUuCx04OZYhIKnmTQ0tgbSMiYf5qGYtqu8dDE1pJL9 vmTddwQpECzGRvxZZSbf6ojBfhUgt3J/HRfI+TCcz02WR45iVyqe98UWP3SafP7RZEwL Tb6A== 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=48KxYprJFIyNCMmtUpHAFQudYJFv5TCRrj7qmsKmRK8=; b=U3JyG8HqC+HziQ3mNycPjNMegFZQbaBBBOfDfSBegmCoM3M131XPaAnyO9Yuj1rymL Dj2OHvmgcFGoM84KZL4VPf6IdcqhYAsRE0KUIRMQZhNcBAzzeGTwxU3ENOKm9mhGx0PC CRvJRi2t05zzkHAoTVcSI7U3H2m6PU01W3ITG4iLoXR6WG5oJBhYU9yT+k979KuOQg5/ YEljj1dkRGa8YnTxQb91omhcdc+iLcbbpaIrDr0lotiZbpxg4cBa9YGGagkN+sObnk8h eafGbE3C6AV729+AHbiYQvYjfnbAAiGQUeS+c+PwqiigKivckYfsviKKQ29OTV94kSJu AaOQ== 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 a139si8531922ita.115.2017.11.14.12.07.13; Tue, 14 Nov 2017 12:07:13 -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 308766072F; Tue, 14 Nov 2017 20:07:13 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 2DD576074A; Tue, 14 Nov 2017 20:01:10 +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 6F9C8606A7; Tue, 14 Nov 2017 20:00:36 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 1BCFB60655 for ; Tue, 14 Nov 2017 20:00:18 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward103o.mail.yandex.net (Yandex) with ESMTP id C5CC6588320E for ; Tue, 14 Nov 2017 23:00:16 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id qpv0h9zqxJ-0GHeInvs; Tue, 14 Nov 2017 23:00:16 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ZsDLds7hfB-0Gp4NMsl; Tue, 14 Nov 2017 23:00:16 +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, 14 Nov 2017 23:00:10 +0300 Message-Id: <1510689611-17861-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510689611-17861-1-git-send-email-odpbot@yandex.ru> References: <1510689611-17861-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 288 Subject: [lng-odp] [PATCH API-NEXT v8 9/10] linux-gen: crypto: drop duplicate authentication field 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 session->auth.bytes duplicates session->p.auth_digest_len, so let's drop first field. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 288 (lumag:gmac) ** https://github.com/Linaro/odp/pull/288 ** Patch: https://github.com/Linaro/odp/pull/288.patch ** Base sha: ba93e355ddf151215aa18b59cbfca08fe175fe65 ** Merge commit sha: 8363c3a4073075d0f3dd68864b9a33819005aab4 **/ platform/linux-generic/include/odp_crypto_internal.h | 1 - platform/linux-generic/odp_crypto.c | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/platform/linux-generic/include/odp_crypto_internal.h b/platform/linux-generic/include/odp_crypto_internal.h index 21174daa4..32178d9de 100644 --- a/platform/linux-generic/include/odp_crypto_internal.h +++ b/platform/linux-generic/include/odp_crypto_internal.h @@ -50,7 +50,6 @@ struct odp_crypto_generic_session { struct { uint8_t key[EVP_MAX_KEY_LENGTH]; uint32_t key_length; - uint32_t bytes; union { const EVP_MD *evp_md; const EVP_CIPHER *evp_cipher; diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 1cc2d7018..6d0ad709a 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -207,7 +207,7 @@ odp_crypto_alg_err_t auth_gen(odp_packet_t pkt, /* Copy to the output location */ odp_packet_copy_from_mem(pkt, param->hash_result_offset, - session->auth.bytes, + session->p.auth_digest_len, hash); return ODP_CRYPTO_ALG_ERR_NONE; @@ -218,7 +218,7 @@ odp_crypto_alg_err_t auth_check(odp_packet_t pkt, const odp_crypto_packet_op_param_t *param, odp_crypto_generic_session_t *session) { - uint32_t bytes = session->auth.bytes; + uint32_t bytes = session->p.auth_digest_len; uint8_t hash_in[EVP_MAX_MD_SIZE]; uint8_t hash_out[EVP_MAX_MD_SIZE]; @@ -703,8 +703,7 @@ static int process_auth_param(odp_crypto_generic_session_t *session, session->auth.evp_md = evp_md; /* Number of valid bytes */ - session->auth.bytes = session->p.auth_digest_len; - if (session->auth.bytes < (unsigned)EVP_MD_size(evp_md) / 2) + if (session->p.auth_digest_len < (unsigned)EVP_MD_size(evp_md) / 2) return -1; /* Convert keys */