aes_gcm_preparekey(9)
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, or32. pick one of those, periodt.authtag_lenβ Length of the authentication tag in bytes:4,8,12,13,14,15, or16.16is recommended. yes,16is 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 π₯
0on success. we love a win. π-EINVALif 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:
struct aes_gcm_key(9)struct aes_gcm_ctx(9)aes_gcm_encrypt(9)aes_gcm_decrypt(9)aes_gcm_init(9)aes_gcm_auth_update(9)aes_gcm_encrypt_update(9)aes_gcm_decrypt_update(9)aes_gcm_encrypt_final(9)aes_gcm_decrypt_final(9)
mwah π β sourced from ./include/crypto, dated October 2026. now go be iconic. π«Ά
π¦ 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