STRUCT AEAD_ALG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ 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 β€” see struct 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 β€” see struct skcipher_alg πŸ”₯
  • decrypt β€” see struct 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 to init, and its whole deal is removing the various changes that got set in init. cleanup era πŸ’…
  • ivsize β€” see struct 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 β€” see struct 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