gnutls_aead_cipher_decrypt(3)
π gnutls_aead_cipher_decrypt(3) π
okay bestie, welcome to the gnutls manual, section 3 π β yes, the library one, not the command-line one, don't @ me. this is where we decrypt AEAD stuff, and honestly? it's giving cryptography main character energy π₯
β¨ NAME β¨
gnutls_aead_cipher_decrypt β API function π
fr fr that's it, that's the name, she's an API function and she knows it π
πΈ SYNOPSIS πΈ
#include <gnutls/crypto.h>
int gnutls_aead_cipher_decrypt(gnutls_aead_cipher_hd_t handle, const
void * nonce, size_t nonce_len, const void * auth, size_t auth_len,
size_t tag_size, const void * ctext, size_t ctext_len, void * ptext,
size_t * ptext_len);
like look at all those args. ten of them. she's high maintenance but she's worth it π
π¦ ARGUMENTS π¦
gnutls_aead_cipher_hd_t handleβ it's agnutls_aead_cipher_hd_ttype. that's the vibe, that's the type, no notes πconst void * nonceβ the nonce you wanna set β¨size_t nonce_lenβ the length of the nonce, obviously, we're not guessing here πconst void * authβ additional data to be authenticated πsize_t auth_lenβ the length of the data (theauthdata, iykyk)size_t tag_sizeβ the size of the tag to use β and listen, use zero for the default, she'll handle it πconst void * ctextβ the data to decrypt, and YES it includes the authentication tag, don't forget the tag bestie πsize_t ctext_lenβ the length of data to decrypt β this one includes the tag size too, matching the ctext vibe π«Άvoid * ptextβ the decrypted data goes here, this is the payoff πsize_t * ptext_lenβ the length of decrypted data, and ngl this one's a lil extra: it initially must hold the maximum available size. so you set it on the way in, she updates it on the way out. it's giving input-output parameter, we love a dual-purpose queen π
β DESCRIPTION β
so this function will decrypt the given data using the algorithm specified by the context. that's the whole thing. that's her job π
This function must be provided the complete data to be decrypted, including the authentication tag. like, all of it. no half-sending. π
On several AEAD ciphers, the authentication tag is appended to the ciphertext β though this is not a general rule</>, so don't go assuming that's universal, bestie, some ciphers do their own thing π
And here's the part where she gets serious: this function will fail if the tag verification fails. periodt. no negotiation, no "well maybe it's fine", no vibe check passed β if the tag doesn't verify, we're done here π
π₯ RETURNS π₯
Zero, or a negative error code on verification failure or other error.
so: 0 = slay, we ate β¨ negative = something went wrong, possibly the tag verification, possibly something else. check it. always check it. fr fr π«Ά
π SINCE π
3.4.0 β she's been around a minute, an elder icon at this point π
π REPORTING BUGS π
found a bug? not her fault, probably, but like, tell someone:
Report bugs to <bugs@gnutls.org>.
Home page: https://www.gnutls.org
π COPYRIGHT π
Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
(the legal girlies said share freely, just keep the receipts, and honestly? iconic π«Ά)
π§ SEE ALSO π§
The full documentation for gnutls is maintained as a Texinfo manual. If the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit
https://www.gnutls.org/manual/
like, go read the whole thing, there's so much more where this came from π
and that's the page bestie!! πΈ written from the gnutls manual, version 3.8.13, and this specific page is gnutls_aead_cipher_decrypt(3) β go decrypt something responsibly, verify your tags, and stay slay π
β¨π
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms