gnutls_aead_cipher_encrypt(3)
π gnutls_aead_cipher_encrypt β bestie edition π
okay so. this is gnutls_aead_cipher_encrypt(3) from the gnutls manual, and it's genuinely one of my faves. it's an API function, it lives in the gnutls crypto world, and it's giving "let me scramble your secrets and also hand you a little proof tag". π
β¨ SYNOPSIS β¨
#include <gnutls/crypto.h>
int gnutls_aead_cipher_encrypt(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 * ptext, size_t ptext_len, void * ctext,
size_t * ctext_len);
likeβ¦ look at her. eight-ish params, all doing their little job. no cap. π
πΈ ARGUMENTS πΈ
gnutls_aead_cipher_hd_t handleβ bestie this is agnutls_aead_cipher_hd_ttype. that's it. that's the whole description. the handle. your girl.const void * nonceβ the nonce we're setting. the little one-time number that keeps things fresh β¨size_t nonce_lenβ how long that nonce is.const void * authβ additional data that gets authenticated. it's not encrypted, it's just verified, and honestly? iconic behaviour.size_t auth_lenβ the length of that data.size_t tag_sizeβ how big you want the tag to be. and listen: use zero for the default, okay?0= let gnutls pick. π«Άconst void * ptextβ the data you wanna encrypt. the plaintext. the tea. πsize_t ptext_lenβ the length of the data to encrypt.void * ctextβ the encrypted data, including the authentication tag. yes, the tag rides along in here. it's a package deal.size_t * ctext_lenβ the length of the encrypted data. and here's the catch bestie: initially this must hold the maximum available size, including space for the tag. you gotta tell it up front how much room you have, fr fr. π
π DESCRIPTION π
this function encrypts the data you give it, using the algorithm specified by the context. and then β the fun part β the output data will contain the authentication tag too. so you get your ciphertext and the proof that it's legit, all in one. slay. π₯
β RETURNS β
zero on success, or a negative error code on error. that's the whole vibe check.
π¦ SINCE π¦
3.4.0 β she's been around a minute, and she's aged beautifully. π
π REPORTING BUGS π
found a bug? don't be shy, tell the gnutls girlies:
- 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. (translation: keep the receipts, bestie, and you're golden. π)
π 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, go visit:
https://www.gnutls.org/manual/
ok that's the whole page, no notes, every option and arg accounted for, nothing skipped. π
and that's a wrap, bestie!! this was gnutls version 3.8.13, page dated gnutls_aead_cipher_encrypt(3) β go encrypt something cute and stay hydrated. ππβ¨
π¦ 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