aes_gcm_decrypt_final(9)
π aes_gcm_decrypt_final(9) β like, the finale of your AES-GCM decrypt arc
Okay bestie, welcome to aes_gcm_decrypt_final, straight out of the Kernel API Manual (section 9, kernel API, iykyk). This is the last little step when you're decrypting a message with AES-GCM and you need to check the vibe β er, the authentication tag β before you trust anything you just decrypted. β¨
β¨ SYNOPSIS β¨
int aes_gcm_decrypt_final (struct aes_gcm_ctx *ctx , const u8 *authtag
);
That's the whole signature, no cap. Returns an int, takes your context and the tag. Simple. Iconic. π
πΈ ARGUMENTS πΈ
ctxβ An AES-GCM context. Like, the whole state of your operation lives in here, and spoiler alert: it's about to get zeroized (more on that in a sec π).authtagβ The stored authentication tag. And its length? It's theauthtag_lenthat was passed toaes_gcm_preparekey. So whatever length you toldaes_gcm_preparekeyabout back at the start, that's the length here. Matching energy only, fr fr. π
π¦ DESCRIPTION π¦
This is the "wrap it up" call β you finish decrypting and it checks your authentication tag.
And here's the cute little bonus: this also zeroizes ctx, so the caller doesn't need to do it. The function cleans up after itself. Main character energy, honestly. π§Ήβ¨
π CONTEXT π
Any context. Literally any. No restrictions, go off. π«Ά
β RETURN β
0on success. And listen β this is the only case where any decrypted or associated data can be used. Like, periodt. If you didn't get0, that data stays in the group chat unsent. π-EBADMSGif the message is inauthentic. Not authentic, not usable, do not pass go. π
Bestie please internalize this: if the return value isn't 0, the decrypted data is not trustworthy. That's the whole point of the authentication tag. Don't be out here using unverified plaintext. π
π SEE ALSO π
All the siblings in the AES-GCM family, plus the header they live in:
- Kernel file
./include/crypto/aes-gcm.h struct aes_gcm_key(9)struct aes_gcm_ctx(9)aes_gcm_preparekey(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)
π Okay that's the whole page, bestie β go forth and verify your tags. This lil' cutie came from ./include/crypto, dated October 2026, and it's filed under aes_gcm_decrypt_final(9). Slay, stay safe, and always check your return value. πβ¨π₯
π¦ 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