fsverity_prepare_hash_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 for NULL, bestie. if memory says no, this function says NULL, and you gotta handle that. no cap.

🌈 SEE ALSO 🌈

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