tipc_aead_mem_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– tipc_aead_mem_alloc(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this one's a function called tipc_aead_mem_alloc, and honestly? she's the backstage crew of TIPC crypto. not the main character on screen, but absolutely nothing happens without her. no cap. πŸŽ€


✨ NAME ✨

tipc_aead_mem_alloc β€” literally just allocates memory for AEAD request operations. that's it, that's the job, and she does it flawlessly πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

void * tipc_aead_mem_alloc (struct crypto_aead *tfm , unsigned int
crypto_ctx_size , u8 **iv , struct aead_request **req , struct
scatterlist **sg , int nsg );

like yes she returns a void * and takes six whole arguments, she's highkey booked and busy 🌸


🌈 ARGUMENTS 🌈

here's the cast of characters, periodt:

  • tfm β€” the cipher handle that gets registered with the request. she's the one holding the crypto identity πŸ‘‘
  • crypto_ctx_size β€” the size of the crypto context for the callback. basically how much room the callback needs to vibe 🫢
  • iv β€” a returned pointer to the IV data. yes it's an output, she hands it back to you ✨
  • req β€” a returned pointer to the AEAD request data. also handed back 🎁
  • sg β€” a returned pointer to the SG lists. yep, returned too 🌟
  • nsg β€” the number of SG lists to be allocated. tell her how many and she'll sort you out πŸ’–

🧚 DESCRIPTION 🧚

so what does she actually do? she allocates memory to store four things in one go:

  1. the crypto context data
  2. the AEAD request
  3. the IV
  4. the SG lists

and the memory layout is genuinely iconic β€” one contiguous block, laid out exactly like this:

crypto_ctx || iv || aead_req || sg[]

the way that she just packs everything in a row with || separators... obsessed 😭 it's giving very organized bestie energy. everything lined up, nothing extra, no wasted space.


⭐ RETURN ⭐

  • on success? she returns the pointer to the memory areas πŸ’œ
  • otherwise? NULL πŸ™ˆ

that's it. no in-between, no surprise drama, just success pointer or NULL, fr fr.

ngl bestie, always check for that NULL β€” she's honest about it, so respect the honesty and check before you dereference anything πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

okay so the whole squad, no one left out, this is the full group chat:

Kernel file ./net/tipc/crypto.c, struct tipc_tfm(9), struct tipc_aead(9), struct tipc_crypto_stats(9), struct tipc_crypto(9), tipc_aead_key_validate(9), tipc_aead_key_generate(9), tipc_aead_free(9), tipc_aead_tfm_next(9), tipc_aead_init(9), tipc_aead_clone(9), tipc_aead_encrypt(9), tipc_aead_decrypt(9), tipc_ehdr_validate(9), tipc_ehdr_build(9), tipc_crypto_key_init(9), tipc_crypto_key_attach(9), tipc_crypto_key_try_align(9), tipc_crypto_key_pick_tx(9), tipc_crypto_key_synch(9), tipc_crypto_xmit(9), tipc_crypto_rcv(9), tipc_crypto_msg_rcv(9), tipc_crypto_key_distr(9), tipc_crypto_key_xmit(9), tipc_crypto_key_rcv(9), tipc_crypto_work_rx(9), tipc_crypto_rekeying_sched(9), tipc_crypto_work_tx(9)

like... that's the whole roster, iykyk 🌈


that's the page bestie, hope it slayed for you πŸ’–

and a lil sign-off: this one lives in ./net/tipc, dated October 2026 β€” so go forth and allocate responsibly, mwah πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from