crypto_shash_descsize(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… crypto_shash_descsize(9) โ€” the Kernel API Manual glow-up ๐ŸŽ€

okay bestie, welcome to the Kernel API Manual corner of the universe โœจ this one's a lil function that tells you how much room your hash's operational state needs. short page, but iconic.


โœจ NAME โœจ

crypto_shash_descsize โ€” obtain the operational state size ๐Ÿซถ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

unsigned int crypto_shash_descsize (struct crypto_shash *tfm );

like, that's the whole signature. no notes. ๐Ÿ’…


๐Ÿฆ‹ ARGUMENTS ๐Ÿฆ‹

  • tfm โ€” the cipher handle ๐Ÿ’– this is the one you're asking about.

โญ DESCRIPTION โญ

so basically, this hands you back the size of the operational state that the cipher needs while it's doing its thing โ€” specifically for the hash that's referenced by that cipher handle. ๐ŸŽ€

and why do we care? because you literally need this number to work out your memory requirements, so you can allocate enough memory for that operational state. no cap, you can't skip the math. ๐Ÿงฎ

the operational state is defined with struct shash_desc, and the way you calculate the size of that data structure is:

sizeof(struct shash_desc) + crypto_shash_descsize(alg)

that's the formula, memorize it, put it on a sticky note, tattoo it on your arm, whatever works ๐Ÿ˜ญโœจ


๐Ÿ”ฅ RETURN ๐Ÿ”ฅ

size of the operational state ๐Ÿ’€ (yes, that's it. it returns the size. slay.)


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

okay this is the part where the page goes full main-character and lists, like, everyone it knows. respect the friend group ๐Ÿ™ˆ


ngl bestie, if you got all the way down here you're genuinely built different ๐Ÿ’œ go forth and allocate responsibly.

and that's a wrap on this little page ๐ŸŽ€ it lives in the source dir ./include/crypto, dated October 2026, filed under crypto_shash_descsize(9) in the Kernel API Manual โ€” mwah, bye bestie ๐Ÿ’…โœจ๐ŸŒธ

๐Ÿ“ฆ where this page comes from