mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
crypto: sm3 - Remove the original "sm3_block_generic()"
Since the architecture-optimized SM3 code was migrated into lib/crypto/, sm3_block_generic() is no longer called. Remove it. Then, since this frees up the name, rename sm3_transform() to sm3_block_generic() (matching the naming convention used in other hash algorithms). Acked-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20260321040935.410034-12-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
This commit is contained in:
parent
9d7f2a6ed5
commit
ef01e1eafb
|
|
@ -31,8 +31,6 @@ struct sm3_state {
|
|||
u8 buffer[SM3_BLOCK_SIZE];
|
||||
};
|
||||
|
||||
void sm3_block_generic(struct sm3_state *sctx, u8 const *data, int blocks);
|
||||
|
||||
/* State for the SM3 compression function */
|
||||
struct sm3_block_state {
|
||||
u32 h[SM3_DIGEST_SIZE / 4];
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ static const u32 ____cacheline_aligned K[64] = {
|
|||
^ rol32(W[(i-13) & 0x0f], 7) \
|
||||
^ W[(i-6) & 0x0f])
|
||||
|
||||
static void sm3_transform(struct sm3_block_state *state,
|
||||
const u8 data[SM3_BLOCK_SIZE], u32 W[16])
|
||||
static void sm3_block_generic(struct sm3_block_state *state,
|
||||
const u8 data[SM3_BLOCK_SIZE], u32 W[16])
|
||||
{
|
||||
u32 a, b, c, d, e, f, g, h, ss1, ss2;
|
||||
|
||||
|
|
@ -177,26 +177,13 @@ static void sm3_transform(struct sm3_block_state *state,
|
|||
#undef W1
|
||||
#undef W2
|
||||
|
||||
void sm3_block_generic(struct sm3_state *sctx, u8 const *data, int blocks)
|
||||
{
|
||||
u32 W[16];
|
||||
|
||||
do {
|
||||
sm3_transform((struct sm3_block_state *)sctx->state, data, W);
|
||||
data += SM3_BLOCK_SIZE;
|
||||
} while (--blocks);
|
||||
|
||||
memzero_explicit(W, sizeof(W));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(sm3_block_generic);
|
||||
|
||||
static void __maybe_unused sm3_blocks_generic(struct sm3_block_state *state,
|
||||
const u8 *data, size_t nblocks)
|
||||
{
|
||||
u32 W[16];
|
||||
|
||||
do {
|
||||
sm3_transform(state, data, W);
|
||||
sm3_block_generic(state, data, W);
|
||||
data += SM3_BLOCK_SIZE;
|
||||
} while (--nblocks);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user