gnutls_cipher_decrypt2(3)

πŸ’– gnutls_cipher_decrypt2 β€” NAME πŸ’–

okay so bestie, this is a page from the gnutls manual (section 3, the library-functions section, iykyk) and it's all about gnutls_cipher_decrypt2 β€” an API function that does exactly what it says on the tin. no cap. πŸ’…


✨ SYNOPSIS ✨

#include <gnutls/crypto.h>

int gnutls_cipher_decrypt2(gnutls_cipher_hd_t handle, const void *
ctext, size_t ctext_len, void * ptext, size_t ptext_len);

like, that's the whole vibe. one include, one function call, four args. iconic. πŸŽ€


🫢 ARGUMENTS 🫢

  • gnutls_cipher_hd_t handle β€” it's a gnutls_cipher_hd_t type. that's your cipher handle, your main character, the whole setup. she's carrying the algorithm for you. πŸ’œ
  • const void * ctext β€” the data to decrypt. the mystery text. the locked box. πŸ”
  • size_t ctext_len β€” the length of data to decrypt, like how much of the locked box we're actually opening.
  • void * ptext β€” the decrypted data. this is where the good stuff lands. 🌸
  • size_t ptext_len β€” the available length for decrypted data. how much room you've given the output buffer to exist in. not a suggestion, bestie, it's the actual limit. 😭

🌈 DESCRIPTION 🌈

so this function will decrypt the given data using the algorithm specified by the context. literally just vibes in, plaintext out. ✨

for block ciphers, ctext_len must be a multiple of the block size. like, it's not optional, it's not "close enough", it's giving math class and you will respect the block size. 🧚 for the supported ciphers, the plaintext data length will equal the ciphertext size. so no surprises on the output length, periodt.

🚨 okay this next part is the one you cannot skip, bestie. note that in AEAD ciphers, this will not check the tag. like, at all. zero authentication happening here, she is just decrypting and trusting you. you will need to compare the tag sent with the value returned from gnutls_cipher_tag(). that's on you. no cap. πŸ’€

πŸ‘‘ RETURNS πŸ‘‘

zero, or a negative error code on error. that's it, that's the whole scale. zero = slay, negative = not slay. πŸ’…


⭐ SINCE ⭐

2.12.0 β€” she's been around for a minute, an elder icon honestly. 🫢


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found something cursed? report bugs to <bugs@gnutls.org>. πŸ“§

home page: https://www.gnutls.org β€” go say hi, tell them we sent you. 🌈


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 like, share it, remix it, put it in your group chat, just keep the receipts attached. πŸŽ€


πŸ¦‹ 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/

and that's the page!! gnutls 3.8.13, and this whole thing is dated alongside the gnutls_cipher_decrypt2(3) page itself. mwah. πŸ’– go forth and decrypt responsibly, bestie β€” and for the love of everything, check your AEAD tags. πŸ”₯✨
πŸ“¦ where this page comes from