cnstr_shdsc_aead_encap(9)
πΈ cnstr_shdsc_aead_encap β NAME π
okay so bestie, welcome to the Kernel API Manual β¨ β this page is literally all about cnstr_shdsc_aead_encap, which is the IPSec ESP encapsulation shared descriptor builder, and no cap, it's the non-protocol one π«Ά. That's the whole vibe. iykyk.
β¨ SYNOPSIS β¨
void cnstr_shdsc_aead_encap (u32 * const desc , struct alginfo *cdata ,
struct alginfo *adata , unsigned int ivsize , unsigned int icvsize ,
const bool is_rfc3686 , u32 *nonce , const u32 ctx1_iv_off , const bool
is_qi , int era );
like, that's the whole signature π copy it exactly, don't be weird about it.
π¦ ARGUMENTS π¦
okay this is the part where we go through every single param one by one, no skipping, no "tl;dr" β we eat every bite π
descβ pointer to the buffer used for descriptor construction. it's giving "the canvas, the main character" π¨cdataβ pointer to the block cipher transform definitions. valid algorithm values are one ofOP_ALG_ALGSEL_{AES, DES, 3DES}ANDed withOP_ALG_AAI_CBCorOP_ALG_AAI_CTR_MOD128. like, pick one and AND it, that's the assignment πadataβ pointer to the authentication transform definitions. heads up bestie: a split key is required for SEC Era < 6, and in that case the size of the split key is specified in this field. valid algorithm values are one ofOP_ALG_ALGSEL_{MD5, SHA1, SHA224, SHA256, SHA384, SHA512}ANDed withOP_ALG_AAI_HMAC_PRECOMP. same deal, ANDed, not OR'd, don't try it πivsizeβ initialization vector size. that's it, that's the whole thing β¨icvsizeβ integrity check value (ICV) size, and it can be truncated or full. your call, queen πis_rfc3686βtruewhenctr(aes)is wrapped by the rfc3686 template. so like, the little rfc3686 wrapper jacket for ctr(aes) π§₯nonceβ pointer to the rfc3686 nonce. yes it's a real word, yes it's iconic βctx1_iv_offβ IV offset in the CONTEXT1 register. register lore, fr fr π₯is_qiβtruewhen called fromcaam/qi. context matters, bestie πeraβ SEC Era. the era. the moment. the timeline π (remember,adata's split key requirement depends on this being< 6, so don't sleep on it)
lowkey important: those algorithm values incdataandadataare ANDed with the AAI flag β that's not a suggestion, that's the spec π keep the exact constants, no renaming, no "fixing."
π SEE ALSO π
in the kernel file ./drivers/crypto/caam/caamalg_desc.c β that's where the source lives, go look, it's giving homework but make it fun π
and then the whole friend group, literally the entire squad of descriptor builders:
cnstr_shdsc_aead_null_encap(9)cnstr_shdsc_aead_null_decap(9)cnstr_shdsc_aead_decap(9)cnstr_shdsc_aead_givencap(9)cnstr_shdsc_gcm_encap(9)cnstr_shdsc_gcm_decap(9)cnstr_shdsc_rfc4106_encap(9)cnstr_shdsc_rfc4106_decap(9)cnstr_shdsc_rfc4543_encap(9)cnstr_shdsc_rfc4543_decap(9)cnstr_shdsc_chachapoly(9)cnstr_shdsc_skcipher_encap(9)cnstr_shdsc_skcipher_decap(9)cnstr_shdsc_xts_skcipher_encap(9)cnstr_shdsc_xts_skcipher_decap(9)
all of them, together, slaying in their own lanes π
and that's the page!! πΈ this lil manual came from the source tree at ./drivers/crypto/caam, dated October 2026, living under the Kernel API Manual umbrella, and it's all about cnstr_shdsc_aead_encap(9) β stan the ESP encapsulation descriptor builder, periodt πππ¦
π¦ 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