diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2026-03-21 07:09:24 +0300 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2026-03-24 03:50:58 +0300 |
| commit | 2a6b2dda5c324041e9e7db29a4eb8358c7ac8f9c (patch) | |
| tree | ee7854efc1aefbfa7c6fa168e5ddedc17f62bffd /include | |
| parent | ea0c746ffa1e6e701d39a564f6286a3f5740826b (diff) | |
| download | linux-2a6b2dda5c324041e9e7db29a4eb8358c7ac8f9c.tar.xz | |
crypto: sm3 - Fold sm3_init() into its caller
Fold sm3_init() into its caller to free up the name for use in a library
API mirroring the other hash function APIs.
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20260321040935.410034-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/crypto/sm3.h | 13 | ||||
| -rw-r--r-- | include/crypto/sm3_base.h | 12 |
2 files changed, 11 insertions, 14 deletions
diff --git a/include/crypto/sm3.h b/include/crypto/sm3.h index c8d02c86c298..c09f6bf4c0bf 100644 --- a/include/crypto/sm3.h +++ b/include/crypto/sm3.h @@ -46,19 +46,6 @@ struct sm3_state { * For details see lib/crypto/sm3.c */ -static inline void sm3_init(struct sm3_state *sctx) -{ - sctx->state[0] = SM3_IVA; - sctx->state[1] = SM3_IVB; - sctx->state[2] = SM3_IVC; - sctx->state[3] = SM3_IVD; - sctx->state[4] = SM3_IVE; - sctx->state[5] = SM3_IVF; - sctx->state[6] = SM3_IVG; - sctx->state[7] = SM3_IVH; - sctx->count = 0; -} - void sm3_block_generic(struct sm3_state *sctx, u8 const *data, int blocks); #endif diff --git a/include/crypto/sm3_base.h b/include/crypto/sm3_base.h index 7c53570bc05e..9fa995617495 100644 --- a/include/crypto/sm3_base.h +++ b/include/crypto/sm3_base.h @@ -21,7 +21,17 @@ typedef void (sm3_block_fn)(struct sm3_state *sst, u8 const *src, int blocks); static inline int sm3_base_init(struct shash_desc *desc) { - sm3_init(shash_desc_ctx(desc)); + struct sm3_state *sctx = shash_desc_ctx(desc); + + sctx->state[0] = SM3_IVA; + sctx->state[1] = SM3_IVB; + sctx->state[2] = SM3_IVC; + sctx->state[3] = SM3_IVD; + sctx->state[4] = SM3_IVE; + sctx->state[5] = SM3_IVF; + sctx->state[6] = SM3_IVG; + sctx->state[7] = SM3_IVH; + sctx->count = 0; return 0; } |
