Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp346654ybc; Tue, 12 Nov 2019 02:24:21 -0800 (PST) X-Google-Smtp-Source: APXvYqyjAkmpovuq0q4Yh897RH/BDP8/mHHiFLl1u9MJ6dW3l294BtJQHGyPpgHxuKjghGy/CaHk X-Received: by 2002:a17:906:2ccc:: with SMTP id r12mr25899759ejr.249.1573554261517; Tue, 12 Nov 2019 02:24:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573554261; cv=none; d=google.com; s=arc-20160816; b=ub8QMwRvJ/ABMIbcFAc5kHX/Yt0tEw8x/QyDtPsbfmh4PesJVptIVtVqr5/WN3QUyk 93l5gwt88O65el1yVAiriabJFbgW95DFEEhzXrql4CohuFSFN5AI3cdezKpZQ+znb4oV EOjj/nkzD3uK7bZqleydOjQWAHX7uNXNLsntMle4bsn5AmDazgxGkFnGffh1kcM+eK81 PLr4FNB9KpWua8+6c6vtHrDp6ji/Oc7UWzQUOJ+Oza58SziYnpjGVD2gtgLGNy9Hr8uv 3hxeObwqooOSukuUKSUCu36K/q786kZgY2yPEUVaZbFVeo6WdJPfyWH8OsWeyBPVVTT/ 0v5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1OtFhVIEuWghHs4gPbR6kN7+6a9GKAF1p3eq8FJVMis=; b=o152UX/QB9xTsCPbdk/XY+e3df0kmAoODkA/fJcvRnnxjR/0RrXvCHSuwKZugRydxt hOtsu3/9aNNZjf16apOPaNjdgoFKUmGxd37awQI51Ugxa4/wRR9Mh8UTc5E00mqK8+3q H4hn9Nig60ljpl53/U4+fj5AUmW9yhUmF8gw4Q6SxnM4OQss4XElq0tcA9telQj/1RAV C1IG6ak/HXUEycBv/JDoi1wZj3P4HP4RU/jCagtDzLqQpJ0Do5/t9a3KU4acGgcXB8WH mO8r/aVGwTed9Nb3xfAJBfxZrSd2C8uLHWGMWiKbZY3Y96tCh8CIKhPtJUYM4AoxQNwM 4nCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si15056765edc.69.2019.11.12.02.23.56; Tue, 12 Nov 2019 02:24:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727196AbfKLKUn (ORCPT + 99 others); Tue, 12 Nov 2019 05:20:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:56810 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727183AbfKLKUm (ORCPT ); Tue, 12 Nov 2019 05:20:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2DA3BB3EA; Tue, 12 Nov 2019 10:20:41 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 85443DA7AF; Tue, 12 Nov 2019 11:20:45 +0100 (CET) From: David Sterba To: linux-crypto@vger.kernel.org Cc: ebiggers@kernel.org, David Sterba Subject: [PATCH v2 4/7] crypto: blake2b: delete unused structs or members Date: Tue, 12 Nov 2019 11:20:27 +0100 Message-Id: <39e1029a1b1dfb3132268829474c1ca166fb46cc.1573553665.git.dsterba@suse.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org All the code for param block has been inlined, last_node and outlen from the state are not used or have become redundant due to other code. Remove it. Signed-off-by: David Sterba --- crypto/blake2b_generic.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/crypto/blake2b_generic.c b/crypto/blake2b_generic.c index fd0fbb076058..442c639c9ad9 100644 --- a/crypto/blake2b_generic.c +++ b/crypto/blake2b_generic.c @@ -32,10 +32,7 @@ enum blake2b_constant { BLAKE2B_BLOCKBYTES = 128, - BLAKE2B_OUTBYTES = 64, BLAKE2B_KEYBYTES = 64, - BLAKE2B_SALTBYTES = 16, - BLAKE2B_PERSONALBYTES = 16 }; struct blake2b_state { @@ -44,25 +41,8 @@ struct blake2b_state { u64 f[2]; u8 buf[BLAKE2B_BLOCKBYTES]; size_t buflen; - size_t outlen; - u8 last_node; }; -struct blake2b_param { - u8 digest_length; /* 1 */ - u8 key_length; /* 2 */ - u8 fanout; /* 3 */ - u8 depth; /* 4 */ - __le32 leaf_length; /* 8 */ - __le32 node_offset; /* 12 */ - __le32 xof_length; /* 16 */ - u8 node_depth; /* 17 */ - u8 inner_length; /* 18 */ - u8 reserved[14]; /* 32 */ - u8 salt[BLAKE2B_SALTBYTES]; /* 48 */ - u8 personal[BLAKE2B_PERSONALBYTES]; /* 64 */ -} __packed; - static const u64 blake2b_IV[8] = { 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, @@ -85,16 +65,8 @@ static const u8 blake2b_sigma[12][16] = { { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } }; -static void blake2b_set_lastnode(struct blake2b_state *S) -{ - S->f[1] = (u64)-1; -} - static void blake2b_set_lastblock(struct blake2b_state *S) { - if (S->last_node) - blake2b_set_lastnode(S); - S->f[0] = (u64)-1; } @@ -334,8 +306,6 @@ static struct shash_alg blake2b_algs[] = { static int __init blake2b_mod_init(void) { - BUILD_BUG_ON(sizeof(struct blake2b_param) != BLAKE2B_OUTBYTES); - return crypto_register_shashes(blake2b_algs, ARRAY_SIZE(blake2b_algs)); } -- 2.23.0