aes_cbc_encrypt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… aes_cbc_encrypt(9) β€” Kernel API Manual ✨

okay so bestie, welcome to the glow-up of aes_cbc_encrypt, straight out of the Kernel API Manual. this is the one that encrypts your data with AES-CBC, and she is lowkey iconic. let's get into it πŸŽ€


🌸 NAME 🌸

aes_cbc_encrypt β€” encrypt data using AES-CBC. that's it, that's the vibe. πŸ’–


✨ SYNOPSIS ✨

void aes_cbc_encrypt (u8 *dst , const u8 *src , size_t len , u8
iv[static AES_BLOCK_SIZE] , aes_encrypt_arg key );

she takes five args and returns void, no cap. literally the whole signature, untouched, because we do not mess with code in this house πŸ™Œ


🫢 ARGUMENTS 🫢

  • dst β€” the destination buffer. she can be in-place or out-of-place, either is fine, live your truth. but for any other overlaps? the behavior is unspecified, so don't come crying to me if you get weird with it 😭
  • src β€” the source data. the actual thing you're encrypting, the main character of this operation πŸ’…
  • len β€” number of bytes to encrypt. must be a multiple of AES_BLOCK_SIZE, no exceptions, periodt. ✨
  • iv β€” the initialization vector. it gets updated with the next value, i.e. the last ciphertext block, so it's carrying the state forward for you like the queen it is πŸ‘‘. (or left unchanged if len == 0, in which case she simply did not attend the function πŸ¦‹)
  • key β€” the key, already prepared using aes_preparekey or aes_prepareenckey. do NOT just hand her a raw key, she needs the prepared one, iykyk πŸ”‘

🌈 DESCRIPTION 🌈

this one supports incremental encryption, which is honestly such a serve. 🧚

the way that it works: the length of each chunk must be a multiple of AES_BLOCK_SIZE, and the updated iv must be passed in each time. so you're feeding it chunk by chunk, and the iv keeps getting refreshed by the previous call. keep that chain alive bestie, or the whole thing falls apart πŸ’€


⭐ CONTEXT ⭐

any context. she's flexible like that. πŸ“


πŸ’œ SEE ALSO πŸ’œ

go read those too, they're the rest of the friend group and they all ate πŸ’–πŸ’…


and that's the whole page, bestie! πŸŽ€ this gem is from the Kernel API Manual, source/version ./include/crypto, dated October 2026. mwah, go encrypt responsibly ✨🫢🌟

πŸ“¦ where this page comes from