aes_expandkey(9)
β¨ aes_expandkey β like, the AES key glow-up β¨
okay so this is a Kernel API Manual page, and we're talking about aes_expandkey(9) β the function that takes your lil baby AES key and expands it, exactly as described in FIPS-197. bestie, it's giving cryptography main character energy π₯
π NAME π
aes_expandkey β expands the AES key as described in FIPS-197 π
πΈ SYNOPSIS πΈ
int aes_expandkey (struct crypto_aes_ctx *ctx , const u8 *in_key ,
unsigned int key_len );
π¦ ARGUMENTS π¦
ctxβ where the computed key gets stored. this is the destination, the home, the moment πin_keyβ the key you're supplying. the supplied one. the raw material, if you will β¨key_lenβ the length of the supplied key. yes, the length. of the key. that you supplied π«Ά
π DESCRIPTION π
So it returns 0 on success β slay. the function fails only if an invalid key size (or pointer) is supplied, so like... give it good input and you're golden π
The expanded key size is 240 bytes β that's the max of 14 rounds with a unique 16 bytes key schedule, plus a 16 bytes key which is used before the first round. math! iconic! π₯
The decryption key is prepared for the "Equivalent Inverse Cipher" as described in FIPS-197. yes, that's the actual name, no cap.
And the layout, because this part matters: the first slot (16 bytes) of each key (enc or dec) is for the initial combination, the second slot for the first round and so on. so it's slot one, slot two, keep going. periodt π
π SEE ALSO π
- Kernel file
./include/crypto/aes.h - struct
aes_enckey(9) - struct
aes_key(9) aes_preparekey(9)aes_prepareenckey(9)aes_encrypt(9)aes_decrypt(9)
go read them, they're all part of the same friend group π
okay that's the whole page bestie π it came from ./include/crypto and the version/date situation is October 2026 β so mark your calendar, or don't, i'm not your mom π mwah π
π¦ 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