From patchwork Mon Nov 13 14: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: 118757 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1841329qgn; Mon, 13 Nov 2017 06:11:43 -0800 (PST) X-Google-Smtp-Source: AGs4zMa7yov2VO5shNrh4CMcWZkOnic6UQnsD7xJE5sltvFNG278F0X8HxNHAEycOiX/jA7BGA4k X-Received: by 10.200.27.200 with SMTP id m8mr6131251qtk.102.1510582303170; Mon, 13 Nov 2017 06:11:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510582303; cv=none; d=google.com; s=arc-20160816; b=euOMacb3zs74SKajb10jwKc0HRr7V7DhsCRMXQM/9FUkkDVAgBgh+Q8kiQ2t9/tAGM MR36EmFOOBmYZO69OHprjiNHKitprvqJ/2uPZqcYBgJCg7jvqIN+Rgr5/rM+YgyQHIxC pwB14dq69VZCKkUUgapkxx5eCU11bJX+3cQvTWm4/x8j9vdkdcyhnXMtIq7YjeMGMCP+ 2gjP9Q0p+Kr/EfybItaf1QJSpskq2NS3t4zu7QCf/Fo/SMFkLT5EPaVZv3u7j4kQNhNu HjX2j14aZSDHItpAny8w/Bbc4zRIHqzC+5mmHInaPxby0U8/z7REsoHYIso+e4HmUHZx qhPg== 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=F/rMoi/PXrC/qbuT0nOrikwNmyFIuzxvOm8y+UeJbwo=; b=wBiwX+nf+mYbNzwZxaxe7VIn52TlN+CFePelATQQTbuLWC78NmcX8hT6Jl3zwz/QGO 1kdVl2OrwKm1tLW8V+DuVzOxXDwz0wqtKIUVZitCRFf7cXwC8e0PjQcXqIdYOL6cX9SE sbHBqIJ3N14Gu/BIizgfeTxd8ablwOcGiM02pj1688X6x8xUX85ExW9kV1eg7GNvRcE9 iafXxhu7YPYuE97+od9MtvTvhklQcBd4Lwgz4anYO/9IDUyB1GCt2JT8Sjne0bAPlGml 8tiiIOGuKKxWkLlOIJGn3Aty5lhhcAjpFGi5+5+ZxsWh6JAnn6YMB+G6zOxw1nsh3DXi WsMg== 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 n3si3998866qkb.427.2017.11.13.06.11.42; Mon, 13 Nov 2017 06:11:43 -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 DE69D60BDF; Mon, 13 Nov 2017 14:11:42 +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 136C060C47; Mon, 13 Nov 2017 14:01:45 +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 145FB61003; Mon, 13 Nov 2017 14:00:38 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id A9E3C60C47 for ; Mon, 13 Nov 2017 14:00:21 +0000 (UTC) Received: from mxback14g.mail.yandex.net (mxback14g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:93]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 8A8105D810DA for ; Mon, 13 Nov 2017 17:00:20 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback14g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id TVPB97wcW2-0KBqISf5; Mon, 13 Nov 2017 17:00:20 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id eBFPNklri7-0K8mxgsm; Mon, 13 Nov 2017 17:00:20 +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: Mon, 13 Nov 2017 17:00:10 +0300 Message-Id: <1510581611-13870-12-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510581611-13870-1-git-send-email-odpbot@yandex.ru> References: <1510581611-13870-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 288 Subject: [lng-odp] [PATCH API-NEXT v6 11/12] 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: a908a4dead95321e84d6a8a23de060051dcd8969 ** Merge commit sha: 60f2c36c67f6b216666f85876af63f7091b1bff0 **/ 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 */