crypto_shash_tfm_digest(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– crypto_shash_tfm_digest(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this one's a little crypto baddie and she's honestly so convenient πŸŽ€


✨ NAME ✨

crypto_shash_tfm_digest β€” calculate message digest for buffer πŸ’…


🌸 SYNOPSIS 🌸

int crypto_shash_tfm_digest(struct crypto_shash *tfm, const u8 *data,
                            unsigned int len, u8 *out);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • tfm β€” the hash transformation object, aka the main character of this whole operation πŸ‘‘
  • data β€” see crypto_shash_update
  • len β€” see crypto_shash_update
  • out β€” see crypto_shash_final

πŸ’œ DESCRIPTION πŸ’œ

So this is the simplified version of crypto_shash_digest for users who do not want to allocate their own hash descriptor (shash_desc). Like, why would you when she'll do it for you? πŸ™ˆ

Instead, crypto_shash_tfm_digest takes a hash transformation object (crypto_shash) directly, and it allocates a hash descriptor on the stack internally. Slay, right? ✨

but ngl bestie β€” note that this stack allocation may be fairly large 😭 so keep that in mind, fr fr.

🌈 CONTEXT 🌈

Softirq or process context. That's it, that's the vibe 🫢


⭐ RETURN ⭐

0 on success; < 0 if an error occurred. Simple as that, no cap πŸ’€


πŸŽ€ SEE ALSO πŸŽ€


and that's the whole page, bestie β€” go forth and digest πŸ’–βœ¨

source: ./include/crypto Β· version/date: October 2026 Β· crypto_shash_tfm_digest(9) β€” mwah, luv u, bye πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from