do_shash(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… do_shash(9) β€” a little love letter from the Kernel API Manual

Okay bestie, listen πŸ‘‚βœ¨ this one lives in the Kernel API Manual, page do_shash(9), and it does exactly what it says on the tin: it's about doing a synchronous hash operation in software. Iconic. Let's get into it 🫢


🌸 SYNOPSIS 🌸

int do_shash(unsigned char *name, unsigned char *result, const u8 *data1,
             unsigned int data1_len, const u8 *data2, unsigned int data2_len,
             const u8 *key, unsigned int key_len);

That's a lot of args, I know, but we're gonna go through every single one, no skipping, fr fr πŸ’–


πŸŽ€ ARGUMENTS πŸŽ€

  • name β€” the name of the hash algorithm. Like, the algorithm's whole identity. main character energy πŸ‘‘
  • result β€” the buffer where the digest gets written. This is where the magic lands, bestie ✨
  • data1 β€” first part of the data to hash. It may be NULL, so don't stress if you've got nothing for it πŸ™ˆ
  • data1_len β€” length of data1, in bytes. Gotta measure, always πŸ“
  • data2 β€” second part of the data to hash. Also may be NULL. Two chunks, one hash, we love a split πŸ¦‹
  • data2_len β€” length of data2, in bytes
  • key β€” the key, but like, if it's a keyed hash. Non-keyed? Don't worry abt it πŸ”‘
  • key_len β€” length of key, in bytes β€” or 0 if it's a non-keyed hash. Zero means no key, periodt πŸ’…

⭐ DESCRIPTION ⭐

So here's the tea, and it's an important lil' caveat β˜•: the crypto API is not gonna pick this driver's own transform, because this driver only registers asynchronous algos. So, like, don't expect it to grab itself. It won't. It literally can't. No cap πŸ’€


πŸ”₯ RETURN πŸ”₯

  • 0 β€” slay! The hash was successfully stored in result βœ…
  • < 0 β€” not slay 😭 something went wrong

🧚 SEE ALSO 🧚

Kernel file ./drivers/crypto/bcm/util.c, plus these very good friends:

Go read them, iykyk πŸ“šπŸ’œ


And that's the whole vibe check, bestie 🌈 this page came to you from ./drivers/crypto/bcm, dated October 2026 β€” mwah, love u, go hash something πŸ’‹πŸŽ€

πŸ“¦ where this page comes from