gnutls_privkey_decrypt_data2(3)

✨ gnutls_privkey_decrypt_data2 ✨

okay bestie, so we're in the gnutls manual, and today's main character is gnutls_privkey_decrypt_data2 πŸ’… it's an API function, it's iconic, and it's about decrypting stuff in the most paranoid-but-make-it-chic way possible. let's get into it 🫢


🌸 SYNOPSIS 🌸

#include <gnutls/abstract.h>

int gnutls_privkey_decrypt_data2(gnutls_privkey_t key, unsigned int
flags, const gnutls_datum_t * ciphertext, unsigned char * plaintext,
size_t plaintext_size);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_privkey_t key β€” holds the key, like literally the whole point, it's giving key holder energy πŸ”‘
  • unsigned int flags β€” zero for now. that's it. that's the tea. zero. for now. πŸ™ˆ
  • const gnutls_datum_t * ciphertext β€” this is holding the data that's about to get decrypted πŸ¦‹
  • unsigned char * plaintext β€” a preallocated buffer, and it will get filled with the plaintext, no cap ✨
  • size_t plaintext_size β€” the size of the plaintext, and heads up, it's in/out πŸ‘€

πŸ’– DESCRIPTION πŸ’–

so this function decrypts the data you give it, using whatever algorithm your private key supports. simple, slay.

BUT. here's the plot twist that makes her special: unlike gnutls_privkey_decrypt_data(), this one operates in constant time and constant memory access β±οΈπŸ‘‘ which is the cryptographic way of saying "she does not leak your secrets through side channels, she is a professional, she is unbothered, she is moored."


⭐ RETURNS ⭐

if it worked? you get GNUTLS_E_SUCCESS (which is 0), and honestly that's the vibe check passing 🌈

otherwise? a negative error value. 😭 rude but informative.


πŸ¦‹ SINCE πŸ¦‹

3.6.5 β€” so she's been around a minute, she's established, she's got seniority πŸŽ€


🧚 REPORTING BUGS 🧚

found a bug? spill to <bugs@gnutls.org> πŸ“§

home page: https://www.gnutls.org


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, go off, redistribute responsibly 🫢


🌈 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 whole page bestie πŸ’… this was gnutls version 3.8.13, page gnutls_privkey_decrypt_data2(3), and she ate, no crumbs. stay constant-time, stay iconic βœ¨πŸ‘‘

πŸ“¦ where this page comes from