From nobody Tue Oct 7 08:34:24 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 033B523BD05; Sat, 12 Jul 2025 23:26:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752362787; cv=none; b=tyDoMSqTK3nvw4UoYgu44dDivDI7KjDRGc5sXNBsOkwQxrWqOSi/TGOzARykff0lVx1EHSmWz8NswrTmlbILVSz7ztA8ilG8wdW8nLJCafBoPOUyaDGAX1mH+1mR/Z6DBmP9NtuBi0DEliTC9w6DK3jQ1Ca3wtqD67p6y9t5bEI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752362787; c=relaxed/simple; bh=GJ7nKp2NVjns7Vn/yd3vh/j/wSpE2hgTFf8rr99laVc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A/1UQL5oMF2ThLRNR7LSX3jk8wVAHacJgx3zbgUnbpY884tOuBsSGzC8gwZ/n0McOtsyPFxgTAYrgquSDYabWtQlmwUu6B/K6Dons5yyp5MztbStLUCocbliy83IQwKq8rBnpx/FHr/F2c5Wc+XCdaz5R0mJovycPXHcx+Gy2gI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rz40jc33; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rz40jc33" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89025C4CEF7; Sat, 12 Jul 2025 23:26:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752362786; bh=GJ7nKp2NVjns7Vn/yd3vh/j/wSpE2hgTFf8rr99laVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rz40jc33/xphGqSYpQPco+3iJDZjL56YDYjR8lxUDvHZC9qTvA05p/dSIALTZNGLa yXvMs5aBqkFHImLl8aUETc28cZI9qr1/dmBFyRLyOgDtANWvrLelg0XRsRp+H1fo49 2DXRpbcKWE/DMscKaQTB1MFDsjuADixByyVL5OJsS9GQAlJAw6f+QBrnQF+UwZ7wEq b+hYHp4Q85Y8NjEOgve5GU4izy0luLiGraER+1MUi9nok4+Y53XmfRQ4/acQ0DDxuF YuAIzEJHyD9PML6iIifGmew7AXaHbdsozX5EIyYP5MW3xQ6bkeFEF23ba0B568EVUx Tvva3Jqe3BFgg== From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel , "Jason A . Donenfeld" , linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, Eric Biggers Subject: [PATCH 14/26] crypto: sha1 - Remove sha1_base.h Date: Sat, 12 Jul 2025 16:23:05 -0700 Message-ID: <20250712232329.818226-15-ebiggers@kernel.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250712232329.818226-1-ebiggers@kernel.org> References: <20250712232329.818226-1-ebiggers@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" sha1_base.h is no longer used, so remove it. Signed-off-by: Eric Biggers --- include/crypto/sha1_base.h | 82 -------------------------------------- 1 file changed, 82 deletions(-) delete mode 100644 include/crypto/sha1_base.h diff --git a/include/crypto/sha1_base.h b/include/crypto/sha1_base.h deleted file mode 100644 index 62701d136c793..0000000000000 --- a/include/crypto/sha1_base.h +++ /dev/null @@ -1,82 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * sha1_base.h - core logic for SHA-1 implementations - * - * Copyright (C) 2015 Linaro Ltd - */ - -#ifndef _CRYPTO_SHA1_BASE_H -#define _CRYPTO_SHA1_BASE_H - -#include -#include -#include -#include -#include -#include - -typedef void (sha1_block_fn)(struct sha1_state *sst, u8 const *src, int bl= ocks); - -static inline int sha1_base_init(struct shash_desc *desc) -{ - struct sha1_state *sctx =3D shash_desc_ctx(desc); - - sctx->state[0] =3D SHA1_H0; - sctx->state[1] =3D SHA1_H1; - sctx->state[2] =3D SHA1_H2; - sctx->state[3] =3D SHA1_H3; - sctx->state[4] =3D SHA1_H4; - sctx->count =3D 0; - - return 0; -} - -static inline int sha1_base_do_update_blocks(struct shash_desc *desc, - const u8 *data, - unsigned int len, - sha1_block_fn *block_fn) -{ - unsigned int remain =3D len - round_down(len, SHA1_BLOCK_SIZE); - struct sha1_state *sctx =3D shash_desc_ctx(desc); - - sctx->count +=3D len - remain; - block_fn(sctx, data, len / SHA1_BLOCK_SIZE); - return remain; -} - -static inline int sha1_base_do_finup(struct shash_desc *desc, - const u8 *src, unsigned int len, - sha1_block_fn *block_fn) -{ - unsigned int bit_offset =3D SHA1_BLOCK_SIZE / 8 - 1; - struct sha1_state *sctx =3D shash_desc_ctx(desc); - union { - __be64 b64[SHA1_BLOCK_SIZE / 4]; - u8 u8[SHA1_BLOCK_SIZE * 2]; - } block =3D {}; - - if (len >=3D bit_offset * 8) - bit_offset +=3D SHA1_BLOCK_SIZE / 8; - memcpy(&block, src, len); - block.u8[len] =3D 0x80; - sctx->count +=3D len; - block.b64[bit_offset] =3D cpu_to_be64(sctx->count << 3); - block_fn(sctx, block.u8, (bit_offset + 1) * 8 / SHA1_BLOCK_SIZE); - memzero_explicit(&block, sizeof(block)); - - return 0; -} - -static inline int sha1_base_finish(struct shash_desc *desc, u8 *out) -{ - struct sha1_state *sctx =3D shash_desc_ctx(desc); - __be32 *digest =3D (__be32 *)out; - int i; - - for (i =3D 0; i < SHA1_DIGEST_SIZE / sizeof(__be32); i++) - put_unaligned_be32(sctx->state[i], digest++); - - return 0; -} - -#endif /* _CRYPTO_SHA1_BASE_H */ --=20 2.50.1