Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+11 -14
-13
include/crypto/sm3.h
··· 46 46 * For details see lib/crypto/sm3.c 47 47 */ 48 48 49 - static inline void sm3_init(struct sm3_state *sctx) 50 - { 51 - sctx->state[0] = SM3_IVA; 52 - sctx->state[1] = SM3_IVB; 53 - sctx->state[2] = SM3_IVC; 54 - sctx->state[3] = SM3_IVD; 55 - sctx->state[4] = SM3_IVE; 56 - sctx->state[5] = SM3_IVF; 57 - sctx->state[6] = SM3_IVG; 58 - sctx->state[7] = SM3_IVH; 59 - sctx->count = 0; 60 - } 61 - 62 49 void sm3_block_generic(struct sm3_state *sctx, u8 const *data, int blocks); 63 50 64 51 #endif
+11 -1
include/crypto/sm3_base.h
··· 21 21 22 22 static inline int sm3_base_init(struct shash_desc *desc) 23 23 { 24 - sm3_init(shash_desc_ctx(desc)); 24 + struct sm3_state *sctx = shash_desc_ctx(desc); 25 + 26 + sctx->state[0] = SM3_IVA; 27 + sctx->state[1] = SM3_IVB; 28 + sctx->state[2] = SM3_IVC; 29 + sctx->state[3] = SM3_IVD; 30 + sctx->state[4] = SM3_IVE; 31 + sctx->state[5] = SM3_IVF; 32 + sctx->state[6] = SM3_IVG; 33 + sctx->state[7] = SM3_IVH; 34 + sctx->count = 0; 25 35 return 0; 26 36 } 27 37