gnutls_aead_cipher_encryptv(3)

โœจ gnutls_aead_cipher_encryptv โœจ

okay bestie so this one lives in the gnutls manual, and it's literally the glow-up function that takes your plain data and turns it into AEAD-encrypted โœจmystery textโœจ with an authentication tag riding along. ๐Ÿ’–


๐ŸŒธ NAME ๐ŸŒธ

gnutls_aead_cipher_encryptv โ€” it's an API function, and it's giving "encrypt my stuff and prove nobody touched it" energy. ๐Ÿ‘‘


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

#include <gnutls/crypto.h>

int gnutls_aead_cipher_encryptv(gnutls_aead_cipher_hd_t handle, const
void * nonce, size_t nonce_len, const giovec_t * auth_iov, int
auth_iovcnt, size_t tag_size, const giovec_t * iov, int iovcnt, void *
ctext, size_t * ctext_len);

like. look at all those parameters. it's a lot but we're gonna get through it together, fr fr. ๐Ÿ’…


๐ŸŽ€ ARGUMENTS ๐ŸŽ€

  • gnutls_aead_cipher_hd_t handle โ€” it's a gnutls_aead_cipher_hd_t type, no cap. that's the whole description and honestly? iconic for being so brief.
  • const void * nonce โ€” the nonce to set. that's the little one-time-only sparkle โœจ that keeps your encryption from getting predictable.
  • size_t nonce_len โ€” The length of the nonce. gotta tell it how big your nonce is, bestie.
  • const giovec_t * auth_iov โ€” additional data to be authenticated. this part gets verified but not encrypted, iykyk.
  • int auth_iovcnt โ€” The number of buffers in auth_iov. count them. ๐Ÿงฎ
  • size_t tag_size โ€” The size of the tag to use (use zero for the default). and yes, 0 means "you pick, boo" ๐Ÿซถ
  • const giovec_t * iov โ€” the data to be encrypted. the main character of this whole situation. ๐Ÿ‘‘
  • int iovcnt โ€” The number of buffers in iov.
  • void * ctext โ€” the encrypted data including authentication tag. so it's not just the ciphertext, the tag is in there too, don't forget. ๐Ÿ˜ญ
  • size_t * ctext_len โ€” the length of encrypted data (initially must hold the maximum available size, including space for tag). and listen. INITIALLY. it has to already contain the max size you can handle plus room for the tag, before you even call this. it's an in-out param, it's doing double duty, it's booked and busy. ๐Ÿ’…

๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

This function will encrypt the provided data buffers using the algorithm specified by the context. The output data will contain the authentication tag.

that's the tea. you hand it your buffers, it hands back encrypted data with the tag baked in. ๐Ÿ“


๐ŸŒˆ RETURNS ๐ŸŒˆ

Zero or a negative error code on error.

so: 0 = slay โœ…, anything negative = something went wrong ๐Ÿ˜ญ


โญ SINCE โญ

3.6.3

been here since 3.6.3, an OG. ๐ŸŽ€


๐Ÿ™ˆ REPORTING BUGS ๐Ÿ™ˆ

Report bugs to <bugs@gnutls.org>. Home page: https://www.gnutls.org

found a bug? don't just suffer in silence, bestie, email them. they want to know. ๐Ÿซถ


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.

so basically: copy it, share it, remix it, just keep the copyright notice and this notice intact. periodt. ๐Ÿ’…


๐Ÿงš 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 if the local docs aren't giving what they need to give, the website is right there. ๐ŸŒธ


and that's the whole page!! mwah ๐Ÿ’– this was gnutls_aead_cipher_encryptv from the gnutls manual, version 3.8.13 โ€” go encrypt something responsibly, bestie, and remember the tag ๐ŸŽ€โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from