STRUCT SM3_CTX(9)
๐ NAME ๐
struct sm3_ctx โ bestie, this is literally the context struct for hashing a message with SM3 โจ like it holds all the little state bits while you're feeding data through the hash ๐ซถ
โจ SYNOPSIS โจ
struct sm3_ctx {
struct sm3_block_state state;
u64 bytecount;
u8 buf[SM3_BLOCK_SIZE];
};
okay so that's the whole shape of it ๐ three members, no cap, and every single one of them matters ๐ฅ
๐ธ Members ๐ธ
stateโ the compression function state ๐ this is the internal mood of the hash, the actual churning part, the main character energy of the whole struct ๐bytecountโ number of bytes processed so far ๐งฎ literally keeping count of every byte that's gone through, so the hash knows where it's at ๐bufโ partial block buffer ๐ and here's the detail you cannot skip: exactlybytecount % SM3_BLOCK_SIZEbytes are valid in there โจ so like, it's not always full, only that many bytes actually count ๐
fr fr do not assume the whole buffer is live โ only bytecount % SM3_BLOCK_SIZE bytes are valid, iykyk ๐
๐ฆ SEE ALSO ๐ฆ
Kernel file ./include/crypto/sm3.h plus the whole squad: sm3_init(9), sm3_update(9), sm3_final(9), sm3(9) ๐ go read those next, they're iconic โญ
and that's the page, bestie ๐ซถ this was the Kernel API Manual version of struct sm3_ctx(9), coming at you from ./include/crypto, dated October 2026 ๐ธ slay, now go hash something ๐
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms