aes_ccm_preparekey(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, or 32. pick one, those are the only valid ones πŸ‘‘
  • authtag_len β€” length of the authentication tag in bytes: 4, 6, 8, 10, 12, 14, or 16. and like… 16 is recommended. fr fr, go with 16 πŸ’…

🌈 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 πŸ’œ

  • 0 on success πŸŽ‰
  • -EINVAL if either of the lengths is invalid πŸ’€ (you gave it a bad key_len or authtag_len, be so serious rn)

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/crypto/aes-ccm.h and its whole friend group, iykyk:


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