tipc_aead_mem_alloc(9)
π 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:
- the crypto context data
- the AEAD request
- the IV
- 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
- 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