STRUCT SM3_CTX(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐ŸŽ€ 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: exactly bytecount % SM3_BLOCK_SIZE bytes 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