STRUCT GHASH_CTX(9)
β¨ struct ghash_ctx β Context for computing a GHASH value β¨
okay so bestie, welcome to struct ghash_ctx(9) from the Kernel API Manual π
this is the lil' data structure that holds all the state while you're computing a GHASH value, and honestly? it's giving "small but essential." let's get into it π«Ά
πΈ SYNOPSIS πΈ
struct ghash_ctx {
const struct ghash_key *key;
struct polyval_elem acc;
size_t partial;
};
that's the whole vibe. three fields, no cap. π
π¦ Members π¦
keyβ a pointer to the prepared GHASH key, bestie. β οΈ and here's the part where you gotta pay attention: 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. don't let that key dip out while the context still needs it, fr fr πaccβ the accumulator, aka where the math actually accumulates. plot twist: it's stored in POLYVAL format rather than GHASH format, because most implementations want it in POLYVAL format anyway. it's giving efficiency π like why convert back and forth when everyone wants the same thing?partialβ the number of data bytes processed so far, moduloGHASH_BLOCK_SIZE. so like, how far into the current block are we? that kind of energy. π₯
π SEE ALSO π
- Kernel file
./include/crypto/gf128hash.h struct polyval_elem(9)struct ghash_key(9)struct polyval_key(9)struct polyval_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)
like, the whole GHASH/POLYVAL friend group is linked here β go read the rest of the lore, iykyk πβ¨
ok that's the whole page, no filler, no fluff, every field accounted for. go keep that key alive, bestie. π«Άπ
and finally, a cute lil' sign-off: this masterpiece lives under the source path ./include/crypto, dated October 2026, and yeah β it's literally titled struct ghash_ctx(9). slay π
π
π¦ 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