ocs_aes_set_key(9)
π ocs_aes_set_key(9) π
okay so bestie, welcome to the kernel API manual β this one's ocs_aes_set_key(9) and it's literally the glow-up moment where you hand your key over to the OCS AES hardware. no cap, it's a tiny little function but she's iconic and you're gonna slay it π
β¨ NAME β¨
ocs_aes_set_key β write a key into the OCS AES hardware. that's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
int ocs_aes_set_key (struct ocs_aes_dev *aes_dev , u32 key_size , const
u8 *key , enum ocs_cipher cipher );
look at her go π she takes four args and returns an int, periodt.
π¦ ARGUMENTS π¦
aes_devβ the OCS AES device you're writing the key to. like, which hardware bestie are we talking to πkey_sizeβ how big the key is, measured in bytes. yes, bytes, not bits, don't come for me πkeyβ the actual key you're writing. the secret sauce π₯cipherβ which cipher this key is for. matters, because the rules differ iykyk π
π DESCRIPTION π
here's the tea β and it's genuinely important, not just vibes:
- for AES,
key_sizemust be either 16 or 32. - for SM4,
key_sizemust be 16.
that's the whole constraint, ngl it's giving "short but strict" π
β RETURN β
0 on success π β or a negative error code otherwise π.
like, zero means we ate, anything negative means something went sideways. no in-between, bestie.
π SEE ALSO π
- kernel file
./drivers/crypto/intel/keembay/ocs-aes.c struct ocs_dma_linked_list(9)ocs_aes_op(9)ocs_aes_gcm_op(9)ocs_aes_ccm_op(9)ocs_create_linked_list_from_sg(9)
go read those too, the whole squad is worth your time π«Ά
okay that's the page!! sourced straight from ./drivers/crypto/intel/keembay, dated October 2026, and indexed under ocs_aes_set_key(9) β mwah, go set some keys bestie ππ§ββοΈ
π¦ 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