fsverity_prepare_hash_state(9)
π fsverity_prepare_hash_state(9)
okay so this page lives in the Kernel API Manual (yes bestie, we're in kernel territory, drink some water π) and it's all about one little function that does your hashing homework before the hashing even starts. iconic behaviour, honestly.
πΈ NAME πΈ
fsverity_prepare_hash_state β precompute the initial hash state β¨
like, get the hash state ready ahead of time so nobody's scrambling later. main character prep energy.
π SYNOPSIS π
union fsverity_hash_ctx * fsverity_prepare_hash_state (const struct
fsverity_hash_alg *alg , const u8 *salt , size_t salt_size );
that's the whole signature, copy it exactly, no editing the source code because you think it'd look cuter with a different name π
π¦ ARGUMENTS π¦
algβ the hash algorithm. which one we're using. that's it, that's the vibe.saltβ a salt which is to be prepended to all data to be hashed π§ literally gets sprinkled on the front of everything before it goes through the hash.salt_sizeβ salt size in bytes. how many bytes of salt we're working with.
π₯ RETURN π₯
the kmalloc'ed initial hash state, or NULL if out of memory π
so like⦠check forNULL, bestie. if memory says no, this function saysNULL, and you gotta handle that. no cap.
π SEE ALSO π
- Kernel file
./fs/verity/hash_algs.c fsverity_get_hash_alg(9)fsverity_hash_block(9)fsverity_hash_buffer(9)
go read those too, iykyk π«Ά
and that's the page!! source: ./fs/verity, dated October 2026 β so go forth, precompute that hash state, and 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