spu2_hash_pad_len(9)
π 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:
spu2_cipher_xlate(9)spu2_hash_xlate(9)spu2_fmd_init(9)spu2_fmd_ctrl0_write(9)spu2_fmd_ctrl1_write(9)spu2_fmd_ctrl2_write(9)spu2_fmd_ctrl3_write(9)spu2_ctx_max_payload(9)spu2_payload_length(9)spu2_response_hdr_len(9)spu2_gcm_ccm_pad_len(9)spu2_assoc_resp_len(9)spu2_aead_ivlen(9)spu2_hash_type(9)spu2_digest_size(9)spu2_create_request(9)spu2_cipher_req_init(9)spu2_cipher_req_finish(9)spu2_request_pad(9)spu2_xts_tweak_in_payload(9)spu2_tx_status_len(9)spu2_rx_status_len(9)spu2_status_process(9)spu2_ccm_update_iv(9)spu2_wordalign_padlen(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms