aes_cmac_init(9)
π aes_cmac_init β the kernel API manual, bestie edition π
okay so you're looking at aes_cmac_init(9) from the Kernel API Manual and honestly? she's a little starter-queen function. let's get into it β¨
πΈ NAME πΈ
aes_cmac_init β start computing an AES-CMAC or AES-XCBC-MAC value π
π¦ SYNOPSIS π¦
void aes_cmac_init (struct aes_cmac_ctx *ctx , const struct aes_cmac_key
*key );
like, that's the whole vibe. two pointers, no return value, she just does it π
β ARGUMENTS β
ctxβ (output) the context you're initializing. this is the girl you're filling in π«Άkeyβ the key to use. β οΈ and listen, a pointer to the key is saved in the context, so the key must live at least as long as the context does. no cap, don't let your key expire early or you're gonna have a bad time π
π₯ DESCRIPTION π₯
this one supports both AES-CMAC and AES-XCBC-MAC. which one you actually get depends on whether aes_cmac_preparekey or aes_xcbcmac_preparekey was called first. so like, the choice was made before you got here, she's just following through πββοΈ
also: the caller should ensure that the context is zeroized at the end of its lifetime, e.g. by callingaes_cmac_finaloraes_cmac_zeroize_ctx. that's the responsible main-character move, do not skip it π
π SEE ALSO π
- Kernel file
./include/crypto/aes-cbc-macs.h struct aes_cmac_key(9)aes_cmac_zeroize_key(9)struct aes_cmac_ctx(9)aes_cmac_zeroize_ctx(9)aes_cmac_preparekey(9)aes_xcbcmac_preparekey(9)aes_cmac_update(9)aes_cmac_final(9)aes_cmac(9)
and that's the page, bestie π sign-off time: this lil beauty lives under ./include/crypto and it's dated October 2026 β iconic, timeless, obsessed ππ§ββοΈ
π¦ 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