STRUCT AEAD_ALG(9)
π struct aead_alg(9) β the Kernel API Manual glow-up
okay so this is struct aead_alg(9), bestie β it lives in the Kernel API Manual and it's literally the blueprint for an AEAD cipher definition. like, this struct is the vibe check for your cipher. no cap. π¦
β¨ NAME β¨
struct aead_alg β AEAD cipher definition π
β¨ SYNOPSIS β¨
here's the whole struct, character for character, don't touch a thing:
struct aead_alg {
int (*setkey)(struct crypto_aead *tfm, const u8 *key, unsigned int
keylen);
int (*setauthsize)(struct crypto_aead *tfm, unsigned int authsize);
int (*encrypt)(struct aead_request *req);
int (*decrypt)(struct aead_request *req);
int (*init)(struct crypto_aead *tfm);
void (*exit)(struct crypto_aead *tfm);
unsigned int ivsize;
unsigned int maxauthsize;
unsigned int chunksize;
struct crypto_alg base;
};
πΈ Members πΈ (the cast, the main characters)
setkeyβ seestruct skcipher_algπsetauthsizeβ sets the authentication size for the AEAD transformation. this one's whole job is to specify the size of the authentication tag the consumer is asking for β either the size of the tag the transformation generates during encryption, or the size of the tag that gets supplied during the decryption operation. and yes, it's also the one responsible for checking that the authentication tag size is actually valid. so it's giving bodyguard energy π«Άencryptβ seestruct skcipher_algπ₯decryptβ seestruct skcipher_algπ₯initβ initializes the cryptographic transformation object. literally that's its whole thing β it initializes the cryptographic transformation object. it gets called only once, at instantiation time, right after the transformation context was allocated. and if the crypto hardware has some special requirements that need handling by software, this function has to check for the precise requirement of the transformation and put any software fallbacks in place. lowkey a lot of responsibility πexitβ deinitializes the cryptographic transformation object. it's the counterpart toinit, and its whole deal is removing the various changes that got set ininit. cleanup era πivsizeβ seestruct skcipher_algβ¨maxauthsizeβ sets the maximum authentication tag size that the transformation supports. a transformation may support smaller tag sizes, so don't assume. and since the authentication tag is a message digest that ensures the integrity of the encrypted data, a consumer typically wants the largest authentication tag possible as defined by this variable β go big or go home energy πchunksizeβ seestruct skcipher_algπbaseβ definition of a generic crypto cipher algorithm π«
π Description π
bestie listen: all fields except ivsize is mandatory and must be filled. that's the rule. everything else, fill it in. no skipping. periodt.
π¨ okay this is important β ivsize is the only one you can leave out. every other field is mandatory, so don't come for me when it doesn't compile.
π§ SEE ALSO π§ (the whole friend group, fr fr)
Kernel file ./include/crypto/aead.h Authenticated Encryption With Associated Data (AEAD) Cipher API(9), struct aead_request(9), crypto_alloc_aead(9), crypto_free_aead(9), crypto_has_aead(9), crypto_aead_ivsize(9), crypto_aead_authsize(9), crypto_aead_blocksize(9), crypto_aead_setkey(9), crypto_aead_setauthsize(9), crypto_aead_encrypt(9), crypto_aead_decrypt(9), Asynchronous AEAD Request Handle(9), crypto_aead_reqsize(9), aead_request_set_tfm(9), aead_request_alloc(9), aead_request_free(9), aead_request_set_callback(9), aead_request_set_crypt(9), aead_request_set_ad(9)
k that's the whole page, mwah π this one came from ./include/crypto, dated October 2026, and the header on the tin says struct aead_alg(9). go build something iconic with it, bestie πβ¨
π¦ 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