spu2_ctx_max_payload(9)
π¦ spu2_ctx_max_payload(9) β a Kernel API Manual moment
okay so bestie, welcome to the Kernel API Manual, where today's main character is spu2_ctx_max_payload π
like yes we're doing kernel crypto documentation and yes it's iconic.
β¨ NAME β¨
spu2_ctx_max_payload β literally just figures out the maximum length of the payload for a SPU message, for a given cipher and hash alg context π
πΈ SYNOPSIS πΈ
u32 spu2_ctx_max_payload (enum spu_cipher_alg cipher_alg , enum
spu_cipher_mode cipher_mode , unsigned int blocksize );
π ARGUMENTS π
cipher_algβ the cipher algorithm, the vibe of the cipher basically π₯cipher_modeβ the cipher mode, like which mode it's inblocksizeβ the size of a block of data for this algo, no cap
π DESCRIPTION π
so here's the tea for SPU2 β the hardware generally ignores the PayloadLen field in ctrl3 of FMD and just keeps computing until it receives a DMA descriptor with the EOF flag set. it's giving "I'll stop when I feel like it" energy honestly π
so because of that, we consider the max payload to be infinite π like, boundless, no ceiling, infinite scroll but make it hardware.
but wait β AES CCM is an exception π¨ don't forget the exception bestie, it's the one that breaks the pattern.
β RETURN β
Max payload length in bytes π that's the whole answer, she said what she said.
π SEE ALSO π
Kernel file ./drivers/crypto/bcm/spu2.c β and honestly the whole friend group is here, say hi to everyone π«Ά
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_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_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)
that's the page bestie, go read your kernel source π
sign-off szn π this one lives in ./drivers/crypto/bcm, dated October 2026, and it's the spu2_ctx_max_payload(9) page from the Kernel API Manual β slay, 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