spum_hash_pad_len(9)
β¨ spum_hash_pad_len(9) β¨
okay bestie, welcome to the spum_hash_pad_len(9) page π
this is from the Kernel API Manual, and it's literally the glow-up guide for hash padding lengths. it's giving "small function, big responsibilities" ngl π«Ά
πΈ NAME πΈ
spum_hash_pad_len β calculates the length of hash padding you need to stretch your data out to a full block size β¨ like, it's the function that does the math so your data fits perfectly in the block, no awkward leftovers, periodt.
π SYNOPSIS π
u16 spum_hash_pad_len (enum hash_alg hash_alg , enum hash_mode hash_mode
, u32 chunksize , u16 hash_block_size );
that's the whole vibe right there β four arguments, one u16 coming back out π
π¦ ARGUMENTS π¦
hash_algβ the hash algorithm, iykyk π§hash_modeβ the hash mode, very much its own thingchunksizeβ the length of your data, measured in bytes πΈhash_block_sizeβ the size of one block of data for that hash algorithm β¨
π DESCRIPTION π
okay so here's the tea β this function reserves space for 1 byte (0x80) β that's the start of the pad β plus the total length, stored as a u64. that's it, that's the whole job, and it ate π
π RETURN π
the length of the hash pad, in bytes π that's the number you get back, no cap.
π SEE ALSO π
all the other icons in the family, fr fr π₯ and yes, they live in the kernel file ./drivers/crypto/bcm/spu.c:
spum_ns2_ctx_max_payload(9)spum_nsp_ctx_max_payload(9)spum_response_hdr_len(9)spum_gcm_ccm_pad_len(9)spum_assoc_resp_len(9)spum_aead_ivlen(9)spum_hash_type(9)spum_digest_size(9)spum_create_request(9)spum_cipher_req_init(9)spum_cipher_req_finish(9)spum_request_pad(9)spum_xts_tweak_in_payload(9)spum_tx_status_len(9)spum_rx_status_len(9)spum_status_process(9)spum_ccm_update_iv(9)spum_wordalign_padlen(9)
and that's the whole page, bestie π«Ά this iconic little entry lives in ./drivers/crypto/bcm and it's dated October 2026 β the spum_hash_pad_len(9) manual, signed, sealed, slayed π
β¨π
π¦ 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