summaryrefslogtreecommitdiff
path: root/lib/sm3.c
AgeCommit message (Collapse)Author
2026-02-11lib: sm3: fix coverity errorHeiko Schocher
Coverity scan reported: CID 449815: Memory - illegal accesses (OVERRUN) Overrunning array of 64 bytes at byte offset 64 by dereferencing pointer "sctx->buffer + partial". [Note: The source code implementation of the function has been overridden by a builtin model.] In line: 252 memset(sctx->buffer + partial, 0, SM3_BLOCK_SIZE - partial); The respective line should be: memset(sctx->buffer + partial, 0, SM3_BLOCK_SIZE - partial - 1); as partial gets incremented by one before. Signed-off-by: Heiko Schocher <[email protected]> Acked-by: Ilias Apalodimas <[email protected]> Signed-off-by: Ilias Apalodimas <[email protected]>
2025-12-04lib: sm3: implement U-Boot partsHeiko Schocher
add the U-Boot specific parts for the SM3 hash implementation: Signed-off-by: Heiko Schocher <[email protected]>
2025-12-04lib: import sm3 256 hash parts from linuxHeiko Schocher
Implement SM3_256 Hash algorithm, based on linux commit f83a4f2a4d8c: ("Merge tag 'erofs-for-6.17-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs") Therefore add the needed parts from linux. Signed-off-by: Heiko Schocher <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>