STRUCT OCS_AES_RCTX(9)
π NAME π
struct ocs_aes_rctx β the OCS AES Request context, bestie. it's the little struct that holds literally everything the AES request needs to know about itself π
so like, quick vibe check: this is the request context (the r is for request, iykyk), and it is not the same thing as ocs_aes_tctx β that one's a whole different girl and she lives in SEE ALSO π
β¨ SYNOPSIS β¨
struct ocs_aes_rctx {
enum ocs_instruction instruction;
enum ocs_mode mode;
int src_nents;
int dst_nents;
int src_dma_count;
int dst_dma_count;
bool in_place;
struct ocs_dll_desc src_dll;
struct ocs_dll_desc dst_dll;
u8 last_ct_blk[AES_BLOCK_SIZE];
int cts_swap;
struct ocs_dll_desc aad_src_dll;
struct ocs_dll_desc aad_dst_dll;
u8 in_tag[AES_BLOCK_SIZE];
u8 out_tag[AES_BLOCK_SIZE];
};
okay copying that struct down character for character because we do not freestyle struct definitions in this house π«Ά
πΈ Members πΈ
instructionβ the actual thing we're being asked to do, encrypt or decrypt. main character of the whole struct ngl πmodeβ which mode we're running:ECB,CBC,CTR,CCm,GCM,CTS. pick your fighter β¨src_nentsβ how many source SG entries there are.dst_nentsβ how many destination SG entries there are.src_dma_countβ the number of DMA-mapped entries of the source SG. yes, mapped, not just "entries", that distinction is real π₯dst_dma_countβ the number of DMA-mapped entries of the destination SG. same energy, destination side π«in_placeβ whether this is an in place request or not, i.e.,src_sg == dst_sg. same buffer doing double duty, we love a multitasker π¦src_dllβ the OCS DMA linked list for input data.dst_dllβ the OCS DMA linked list for output data.last_ct_blkβ buffer to hold the last cipher text block. heads up though: only used in CBC mode π don't go looking for it elsewhere, it's not there.cts_swapβ whether or not the CTS swap must be performed.aad_src_dllβ the OCS DMA linked list for input AAD data. AAD besties rise πaad_dst_dllβ the OCS DMA linked list for output AAD data.in_tagβ buffer to hold the input encrypted tag. β οΈ only used for CCM/GCM decrypt β do not come for her during encrypt, she is off duty.out_tagβ buffer to hold the output encrypted / decrypted tag. β οΈ only used for GCM encrypt / decrypt β note that's GCM only, not CCM, fr fr.
bestie please clock the array sizes:last_ct_blk,in_tagandout_tagare allu8arrays ofAES_BLOCK_SIZE. one block, no more, no notes π―
π SEE ALSO π
- Kernel file
./drivers/crypto/intel/keembay/keembay-ocs-aes-core.cβ the source of truth, go read her π struct ocs_aes_tctx(9)β the context struct's cousin, different struct, don't mix them up πkmb_ocs_aead_dma_prepare(9)β the DMA prep function, she's iconic for a reason β
and that's the whole page, no cap π§ from ./drivers/crypto/intel/keembay, dated October 2026, signing off as struct ocs_aes_rctx(9) β slay, go encrypt something responsibly π
β¨π
π¦ 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