spum_request_pad(9)
β¨ spum_request_pad(9) β¨
okay so this is a page from the Kernel API Manual β yes bestie, we're in kernel land today, and honestly? it's giving cryptography main character energy π
π NAME π
spum_request_pad β literally just creates pad bytes at the end of the data. that's the whole vibe. padding. iconic. π«Ά
β¨ SYNOPSIS β¨
void spum_request_pad (u8 *pad_start , u32 gcm_ccm_padding , u32
hash_pad_len , enum hash_alg auth_alg , enum hash_mode auth_mode ,
unsigned int total_sent , u32 status_padding );
returns void, so likeβ¦ it does the thing and doesn't even brag about it. humble king π
πΈ ARGUMENTS πΈ
pad_startβ the start of the buffer where the pad bytes are gonna be written. this is where the magic happens, no cap β¨gcm_ccm_paddingβ length of the GCM/CCM padding, in bytes. we measuring, we precise πhash_pad_lenβ number of bytes of padding that extend the data to a full block. gotta fill that block up, it's giving completionist π§auth_algβ the authentication algorithm. which one? that's between you andenum hash_algauth_modeβ the authentication mode. also an enum situation. iykyktotal_sentβ the length that gets inserted at the end of the hash pad. length? inserted? at the end? yes. slaystatus_paddingβ number of bytes of padding needed to align the STATUS word. alignment is self care, fr fr π
π DESCRIPTION π
so there may be three forms of pad, and we're gonna go through all of them because we don't skip sections in this house π β¨
- GCM/CCM pad β for GCM/CCM mode ciphers, pad to 16-byte alignment. sixteen. not fifteen, not seventeen. sixteen π₯
- hash pad β pad to a block length, with a
0x80data terminator and the size at the end. terminator at the front-ish, size at the end β the way that works out is honestly beautiful π - STAT pad β to ensure the STAT field is 4-byte aligned. four bytes of pure structure. gorgeous. no notes π
bestie note: yes, the description says "STAT pad" and the argument is called status_padding. that's just how it is. we don't question the ancestors π
π¦ SEE ALSO π¦
all the siblings!! the whole friend group!! go read these too, they're all 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_hash_pad_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_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 page!! π from ./drivers/crypto/bcm, dated October 2026 β so like, future vibes, but the padding knowledge is timeless πβ¨ go forth and align your STATUS words bestie, you've got this ππ
π¦ 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