aes_gcm_preparekey(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to aes_gcm_preparekey(9) β€” your Kernel API Manual moment for prepping an AES-GCM key for encryption and decryption. slay. πŸ’…

✨ NAME ✨

aes_gcm_preparekey β€” Prepare a key for AES-GCM encryption and decryption. that's the whole assignment, and it ate. πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

int aes_gcm_preparekey (struct aes_gcm_key *key , const u8 *in_key ,
size_t key_len , size_t authtag_len );

πŸŽ€ ARGUMENTS πŸŽ€

  • key β€” (output) The key structure to initialize. this is the glow-up target, bestie.
  • in_key β€” The raw AES-GCM key. the actual key material, no cap.
  • key_len β€” Length of the raw key in bytes: 16, 24, or 32. pick one of those, periodt.
  • authtag_len β€” Length of the authentication tag in bytes: 4, 8, 12, 13, 14, 15, or 16. 16 is recommended. yes, 16 is the main character here. πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

users should use memzero_explicit to zeroize the key struct at the end of its lifetime. (but if this function fails, zeroization is unnecessary.) like, that's the documented cleanup vibe β€” and the fail-case caveat is literally right there. 🫢

🌸 CONTEXT 🌸

Any context. literally any. ✨

πŸ”₯ RETURN πŸ”₯

  • 0 on success. we love a win. πŸ’–
  • -EINVAL if either of the lengths is invalid. not the lengths being messy. 😭

🌈 SEE ALSO 🌈

the kernel file ./include/crypto/aes-gcm.h and this whole related cast:


mwah πŸ’‹ β€” sourced from ./include/crypto, dated October 2026. now go be iconic. 🫢

πŸ“¦ where this page comes from