ocs_aes_op(9)
π« 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 bysrc_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) ofiv. 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:
struct ocs_dma_linked_list(9)ocs_aes_set_key(9)ocs_aes_gcm_op(9)ocs_aes_ccm_op(9)ocs_create_linked_list_from_sg(9)
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
- 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