aes_ccm_preparekey(9)
π aes_ccm_preparekey(9) π
okay so bestie, this is a page from the Kernel API Manual and it's literally all about getting your AES-CCM key ready to slay β¨
πΈ NAME πΈ
aes_ccm_preparekey β prepare a key for AES-CCM encryption and decryption π
β¨ SYNOPSIS β¨
int aes_ccm_preparekey (struct aes_ccm_key *key , const u8 *in_key ,
size_t key_len , size_t authtag_len );
π«Ά ARGUMENTS π«Ά
keyβ (output) the key structure you're initializing, bestie. this is the glow-up destination πin_keyβ the raw AES-CCM key. the actual key material, no filter π¦key_lenβ length of the raw key in bytes:16,24, or32. pick one, those are the only valid ones πauthtag_lenβ length of the authentication tag in bytes:4,6,8,10,12,14, or16. and likeβ¦16is recommended. fr fr, go with16π
π DESCRIPTION π
okay so here's the vibe: you call this, it preps everything for AES-CCM encryption AND decryption. main character energy for your crypto setup π₯
and listen β users should use memzero_explicit to zeroize the key struct at the end of its lifetime. literally do not skip this, it's the cleanup era and it matters π
tiny plot twist though: if this function fails, zeroization is unnecessary. so like, no pressure on the cleanup if it already flopped π
π§ CONTEXT π§
Any context. any. go off wherever you are β
π RETURN π
0on success π-EINVALif either of the lengths is invalid π (you gave it a badkey_lenorauthtag_len, be so serious rn)
π¦ SEE ALSO π¦
Kernel file ./include/crypto/aes-ccm.h and its whole friend group, iykyk:
struct aes_ccm_key(9)struct aes_ccm_ctx(9)aes_ccm_encrypt(9)aes_ccm_decrypt(9)aes_ccm_init(9)aes_ccm_auth_update(9)aes_ccm_encrypt_update(9)aes_ccm_decrypt_update(9)aes_ccm_encrypt_final(9)aes_ccm_decrypt_final(9)
okay that's the whole page, bestie π it lives in ./include/crypto and the version-on-record is October 2026 β go forth and prepare those keys, you're literally iconic for reading the docs πβ¨π
π¦ 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