polyval_preparekey(9)
π polyval_preparekey β prepare a POLYVAL key, bestie
Ok so real talk, this is polyval_preparekey(9) from the Kernel API Manual and it's genuinely one of the more chill functions you'll meet β but don't let the chill fool you, it's doing actual prep work behind the scenes. Let's get into it π
β¨ SYNOPSIS β¨
void polyval_preparekey (struct polyval_key *key , const u8
raw_key[POLYVAL_BLOCK_SIZE] );
That's it. That's the whole vibe. No return value (void, so nothing to catch, she just does her thing) πΈ
π«Ά ARGUMENTS π«Ά
keyβ (output) this is the key structure you're initializing. She's the main character here, she gets filled in. β¨raw_keyβ the raw hash key. Straight-up the raw material, no filter, exactly as it comes. π
π₯ DESCRIPTION π₯
So what this does: it initializes a POLYVAL key structure from a raw key. Lowkey elegant, ngl.
Here's the thing though β how it does that is platform-dependent, and the manpage is very clear about it: it may be a simple copy, or it may involve precomputing powers of the key, all depending on the platform's POLYVAL implementation. So likeβ¦ don't assume it's just a memcpy, bestie. The platform decides. Slay for portability, but don't count on the internals. π
π¦ CONTEXT π¦
Any context. That's it. No special locks, no "only from process context," no "must be called with interrupts disabled" drama. Call it wherever, she's flexible. π
π SEE ALSO π
- Kernel file
./include/crypto/gf128hash.h struct polyval_elem(9)struct ghash_key(9)struct polyval_key(9)struct ghash_ctx(9)struct polyval_ctx(9)ghash_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)
π¨ Quick vibe check: the "may be a simple copy, or it may involve precomputing powers of the key" thing is the whole catch. If you're writing code that assumes anything about what key contains afterwards beyond "it's initialized and ready," you're guessing, and we don't guess. iykyk π
Ok that's the page!! This one's brought to you by ./include/crypto, dated October 2026, and yeah β the header at the top said polyval_preparekey(9) and the footer said the same thing, so bestie really said "consistency" πβ¨ Go forth and prepare those keys, you absolute icon π§ββοΈπ
π¦ 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