STRUCT POLYVAL_CTX(9)
π struct polyval_ctx(9) β the Kernel API Manual, bestie edition π
okay so this is a page from the Linux Kernel API Manual, and today's main character is struct polyval_ctx β no cap, the literal context for computing a POLYVAL value. she's giving "I hold your state so you don't have to" energy β¨
πΈ NAME πΈ
struct polyval_ctx β Context for computing a POLYVAL value π
Like, she's the lil' workspace where the POLYVAL math happens. Obsessed.
β¨ SYNOPSIS β¨
struct polyval_ctx {
const struct polyval_key *key;
struct polyval_elem acc;
size_t partial;
};
that's the whole struct, bestie β three members, zero drama π¦
π«Ά Members π«Ά
so here's the breakdown of every field, and yes I'm doing all of them:
keyβ a pointer to the prepared POLYVAL key. ποΈ important! the user of the API is responsible for ensuring that the key lives as long as the context. that's on you, not on the kernel β if the key dips out early, that's a you problem, fr fr. πaccβ the accumulator. π she accumulates. that's her job. that's her whole vibe.partialβ the number of data bytes processed so far, moduloPOLYVAL_BLOCK_SIZE. so like, the leftover-bytes counter. the "how far into the current block are we" situation. π
π SEE ALSO π
okay this list is long but every single one of these is iconic in her own right, no skips:
- Kernel file
./include/crypto/gf128hash.hβ the β¨sourceβ¨ struct polyval_elem(9)struct ghash_key(9)struct polyval_key(9)struct ghash_ctx(9)ghash_preparekey(9)polyval_preparekey(9)ghash_init(9)polyval_init(9)polyval_import_blkaligned(9)polyval_export_blkaligned(9)ghash_update(9)polyval_update(9)ghash_final(9)polyval_final(9)ghash(9)polyval(9)
the ghash girlies and the polyval girlies, side by side. π we love a crossover episode.
π lowkey reminder: key has to outlive the context. I said what I said. don't come crying to me when your pointer is dangling. π
and that's the page! this one came out of ./include/crypto, dated October 2026, and it's literally titled struct polyval_ctx(9) β so yeah, go forth and hash responsibly, bestie π§πβ¨
π¦ 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