STRUCT OCS_AES_RCTX(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ 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_tag and out_tag are all u8 arrays of AES_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