spu2_hash_pad_len(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… spu2_hash_pad_len(9) β€” from the Kernel API Manual πŸŽ€

okay so picture this: you're deep in the kernel, specifically the spu2 crypto driver, and you need to know how many padding bytes the hardware is gonna slap onto your hash data. That's it. That's the whole function. And honestly? It's kind of a vibe. ✨


✨ NAME ✨

spu2_hash_pad_len β€” literally just calculates the length of hash padding you need to stretch your data out to a full block size. no cap, that's the job. 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

u16 spu2_hash_pad_len (enum hash_alg hash_alg , enum hash_mode hash_mode
, u32 chunksize , u16 hash_block_size );

🌸 ARGUMENTS 🌸

  • hash_alg β€” the hash algorithm you're rolling with πŸ’œ
  • hash_mode β€” the hash mode, bestie. the mode. πŸ”₯
  • chunksize β€” how long your data is, in bytes πŸ“
  • hash_block_size β€” how big one hash block is, in bytes 🌈

πŸ‘‘ DESCRIPTION πŸ‘‘

So here's the tea: the SPU2 hardware does all of the hash padding itself. Like, every last bit of it. Not you, not the driver β€” the hardware. πŸ’… So this function is out here doing the math on how much that's gonna be.


⭐ RETURN ⭐

The length of the hash pad, in bytes. that's it. that's the return value. πŸŽ€


🧚 SEE ALSO 🧚

Kernel file ./drivers/crypto/bcm/spu2.c β€” and like, honestly, the whole squad:


okay that's the page!! 🫢 this little icon lives in ./drivers/crypto/bcm, dated October 2026, and it ate. no notes. periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from