ocs_aes_op(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« ocs_aes_op(9) β€” the Kernel API Manual, but make it make sense πŸ’«

okay bestie, so this is a page from the Kernel API Manual (yes, section 9, the kernel-functions girlies) and today's main character is ocs_aes_op β€” a little function that literally just performs an AES/SM4 operation. That's it. That's the vibe. ✨


🌸 NAME 🌸

ocs_aes_op β€” Perform AES/SM4 operation.


πŸŽ€ SYNOPSIS πŸŽ€

int ocs_aes_op (struct ocs_aes_dev *aes_dev , enum ocs_mode mode , enum
ocs_cipher cipher , enum ocs_instruction instruction , dma_addr_t
dst_dma_list , dma_addr_t src_dma_list , u32 src_size , u8 *iv , u32
iv_size );

πŸ¦‹ ARGUMENTS πŸ¦‹

like nine whole arguments, she's high maintenance but she delivers πŸ’…

  • aes_dev β€” The OCS AES device to use. the actual device bestie, you gotta tell her which one.
  • mode β€” The mode to use (ECB, CBC, CTR, or CTS). pick your fighter.
  • cipher β€” The cipher to use (AES or SM4). two icons, both valid.
  • instruction β€” The instruction to perform (encrypt or decrypt). are we locking it in or unlocking it πŸ‘€
  • dst_dma_list β€” The OCS DMA list mapping output memory. this is where the results go live, rent free.
  • src_dma_list β€” The OCS DMA list mapping input payload data. the source material. the origin story.
  • src_size β€” The amount of data mapped by src_dma_list. how much data we're actually talking about here.
  • iv β€” The IV vector. yes she's just called "The IV vector," no notes.
  • iv_size β€” The size (in bytes) of iv. because the IV also needs a size, obviously.

⭐ RETURN ⭐

0 on success, negative error code otherwise. so bestie: zero = slay, negative = something went sideways 😭


πŸ”₯ SEE ALSO πŸ”₯

go read the kernel file ./drivers/crypto/intel/keembay/ocs-aes.c plus these icons:


no cap: that SEE ALSO list is basically the group chat β€” every one of them is relevant and every one of them has lore. go look at them all, iykyk 🫢

okay that's the whole page, and fr fr the source/version bit is ./drivers/crypto/intel/keembay dated October 2026 β€” so go forth, perform an AES/SM4 operation, and remember: stay iconic, keep your error codes negative, and never skip the IV πŸŒˆπŸ‘‘πŸ’œ

πŸ“¦ where this page comes from