ocs_aes_set_key(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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_size must be either 16 or 32.
  • for SM4, key_size must 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 🌟

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