lib/crypto: sha256: Reorder some code
authorEric Biggers <ebiggers@kernel.org>
Mon, 30 Jun 2025 16:06:34 +0000 (09:06 -0700)
committerEric Biggers <ebiggers@kernel.org>
Fri, 4 Jul 2025 17:18:52 +0000 (10:18 -0700)
commit3135d5be7c27841526d98150c245304ab312e9f4
tree2b1ed76871efb8f1da75604f80af86aceb3410f5
parent85de1929e17e71fafc51473ba1d14101e80180f5
lib/crypto: sha256: Reorder some code

First, move the declarations of sha224_init/update/final to be just
above the corresponding SHA-256 code, matching the order that I used for
SHA-384 and SHA-512.  In sha2.h, the end result is that SHA-224,
SHA-256, SHA-384, and SHA-512 are all in the logical order.

Second, move sha224_block_init() and sha256_block_init() to be just
below crypto_sha256_state.  In later changes, these functions as well as
struct crypto_sha256_state will no longer be used by the library
functions.  They'll remain just for some legacy offload drivers.  This
gets them into a logical place in the file for that.

No code changes other than reordering.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20250630160645.3198-4-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
include/crypto/sha2.h
lib/crypto/sha256.c