spu2_request_pad(9)
π spu2_request_pad β the Kernel API Manual page, but make it make sense
okay bestie, so this one lives in the Kernel API Manual and it's literally the function that handles the β¨leftoversβ¨ β the pad bytes at the end of your data. Yes, padding. It's not glamorous but it IS load-bearing, so let's get into it π
β¨ NAME β¨
spu2_request_pad β create pad bytes at the end of the data. that's it, that's the whole vibe π«Ά
πΈ SYNOPSIS πΈ
void spu2_request_pad (u8 *pad_start , u32 gcm_padding , u32
hash_pad_len , enum hash_alg auth_alg , enum hash_mode auth_mode ,
unsigned int total_sent , u32 status_padding );
π¦ ARGUMENTS π¦
pad_startβ start of the buffer where the pad bytes are gonna be written. this is the spot, the location, the moment π«gcm_paddingβ the length of the GCM padding, in bytes. numbers, we love herhash_pad_lenβ how many bytes of padding it takes to extend the data to a full block. the glow-up-to-full-block count β¨auth_algβ the authentication algorithm. which one? that's theenum hash_algof it allauth_modeβ the authentication mode. again,enum hash_mode, we don't make the rulestotal_sentβ the length that gets inserted at the end of the hash pad πstatus_paddingβ how many bytes of padding it takes to align the STATUS word π₯
π DESCRIPTION π
so there may be three forms of pad, and honestly? each one is serving a different purpose. it's giving "three sisters, three destinies" π
- GCM pad β for GCM mode ciphers, pad to 16-byte alignment. sixteenth-byte alignment is the standard, no cap π
- hash pad β pad to a block length, with
0x80data terminator and size at the end. note the0x80terminator, bestie, it's not optional, it's the whole personality π - STAT pad β to ensure the STAT field is 4-byte aligned β
fr fr, these three are the only forms of pad described here β don't go inventing a fourth, i'm begging π
π SEE ALSO π
kernel file ./drivers/crypto/bcm/spu2.c, plus the whole friend group:
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_hash_pad_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_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!! π sourced from ./drivers/crypto/bcm, dated October 2026 β go forth and pad responsibly, ily, mwah ππ§
π¦ 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