aes_xts_decrypt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… aes_xts_decrypt(9) β€” the Kernel API Manual, but make it cute πŸŽ€

okay so bestie, welcome to aes_xts_decrypt</pub> β€” she lives in the Kernel API Manual and she's here to Decrypt data using AES-XTS. that's the whole vibe. decryption. AES-XTS. iconic behavior only. ✨


🌸 NAME 🌸

aes_xts_decrypt β€” Decrypt data using AES-XTS


πŸ¦‹ SYNOPSIS πŸ¦‹

void aes_xts_decrypt (u8 *dst , const u8 *src , size_t len , u8
tweak[static AES_BLOCK_SIZE] , const struct aes_xts_key *key , bool cont
);

like, look at her. six params. zero drama (okay, some drama, we'll get to the overlaps). πŸ’œ


πŸŽ€ ARGUMENTS πŸŽ€

  • dst β€” the destination buffer, aka where the decrypted goodness lands. it can be in-place or out-of-place, both slay. for any other overlaps? the behavior is unspecified β€” so like, don't, bestie. πŸ™ˆ
  • src β€” The source data. the raw material. the moment before the glow-up. 🌈
  • len β€” number of bytes to decrypt. on non-final calls it must be a nonzero multiple of AES_BLOCK_SIZE. on the final call it can be any value >= AES_BLOCK_SIZE β€” which is a fancy way of saying ciphertext stealing is supported. she's flexible, we love that. πŸ’…
  • tweak β€” the tweak. she gets updated with the next value, unless len isn't a multiple of AES_BLOCK_SIZE, in which case the value is unspecified β€” so don't go reading her after that, k? 😭
  • key β€” the key, already prepared using aes_xts_preparekey. do NOT hand her a raw key, she will simply not know what to do with it. 🫢
  • cont β€” false to begin decrypting a new message (do the tweak encryption); true to continue decrypting a message (skip tweak encryption). yes it's basically a "new convo or same convo" button. πŸ’¬

✨ DESCRIPTION ✨

so this function supports both one-shot and incremental decryption. both. at once. main character energy tbh. πŸ‘‘

on the first call, pass cont = false. on any later calls, pass cont = true and the updated tweak. all earlier len must have been multiples of AES_BLOCK_SIZE β€” that's non-negotiable, fr fr. ⭐

okay tiny warning moment 🚨 the "all earlier len were multiples of AES_BLOCK_SIZE" thing is a must. if you fed her a weird length mid-message and then tried to continue, that's on you, not her. πŸ™

🧚 CONTEXT 🧚

Any context. that's it. that's the section. she's lowkey available everywhere and honestly? relatable. πŸ’–


πŸ”₯ SEE ALSO πŸ”₯

go read these, they're the besties she runs with. iykyk. πŸ’œ


cutest little sign-off ever: this page ships out of ./include/crypto, dated October 2026 🌸 β€” mwah, take care of her, and remember: tweak goes in, tweak comes out, you literally cannot explain that. πŸ’…βœ¨πŸŽ€
πŸ“¦ where this page comes from