aes_xctr(9)
π aes_xctr(9) π
okay bestie, so this is a page from the Kernel API Manual and it's literally all about aes_xctr β AES-XCTR en/decryption β¨ buckle up, it's giving cryptography but make it cute.
πΈ NAME πΈ
aes_xctr β AES-XCTR en/decryption π
π¦ SYNOPSIS π¦
void aes_xctr (u8 *dst , const u8 *src , size_t len , u64 *ctr , const
u8 iv[static AES_BLOCK_SIZE] , aes_encrypt_arg key );
like, that's the whole signature, no cap π
π ARGUMENTS π
dstβ the destination buffer, bestie. it can be in-place or out-of-place, both are fine. for any other overlaps tho? the behavior is unspecified π so likeβ¦ don't.srcβ the source data, the actual bytes we're working with πlenβ number of bytes to en/decrypt π§ctrβ the block counter, and it's in host endianness (iykyk). for the first call, set it to:
1
and heads up β it gets incremented by ceil(len / AES_BLOCK_SIZE) π
ivβ the initialization vector πkeyβ the key, but not just any key β it's already prepared usingaes_preparekeyoraes_prepareenckeyπ
π DESCRIPTION π
so this implements AES in XOR Counter mode, as specified in the paper "Length-preserving encryption with HCTR2" over at https://eprint.iacr.org/2021/1441.pdf π
lowkey important: this exists only for use by the implementation of modes built on top of XCTR. callers are expected to know how to use XCTR mode appropriately β including choosing (key, IV) pairs appropriately to avoid keystream reuse. like, that part is not optional, fr fr π
it also supports incremental en/decryption β¨ the length of each non-final chunk must be a multiple of AES_BLOCK_SIZE, and the updated ctr must be passed in each time. no skipping, bestie π
π₯ CONTEXT π₯
Any context. literally any. slay π«Ά
β SEE ALSO β
- Kernel file
./include/crypto/aes-ctr.h aes_ctr(9)π¦
and that's the whole page, bestie β brought to you by the fine folks over at ./include/crypto, dated October 2026. periodt πβ¨π
π¦ 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