gnutls_dh_get_prime_bits(3)

✨ gnutls_dh_get_prime_bits ✨

okay bestie, welcome to the gnutls manual, we're doing the whole tour πŸ’– this one's a little function that tells you how thicc your Diffie-Hellman prime was. iconic behaviour honestly.


πŸŽ€ NAME πŸŽ€

gnutls_dh_get_prime_bits β€” an API function, and yes it does exactly what the name says 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/gnutls.h>

int gnutls_dh_get_prime_bits(gnutls_session_t session);

🌈 ARGUMENTS 🌈

  • gnutls_session_t session β€” it's a gnutls session, babes. that's the whole vibe. hand it your session and it'll spill the tea πŸ«–

πŸ’… DESCRIPTION πŸ’…

so this function returns the bits of the prime that got used in the last Diffie-Hellman key exchange with the peer. main character energy ✨

use it for both anonymous and ephemeral Diffie-Hellman, fr fr, it's got you either way 🫢

⚠️ but listen β€” some ciphers, like RSA and DSA without DHE, literally do not do a Diffie-Hellman key exchange at all. so for those, this function just returns 0. not a bug, just not that kind of party πŸ’€

⭐ RETURNS ⭐

you get the Diffie-Hellman bit strength back, slay πŸ‘‘

  • if no Diffie-Hellman key exchange was done β†’ it returns 0
  • if things go sideways β†’ it returns a negative error code 😭

πŸ™ˆ REPORTING BUGS πŸ™ˆ

found something cursed? report bugs to <bugs@gnutls.org> and they'll handle it πŸ’Œ

home page: https://www.gnutls.org β€” go say hi 🌐


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. (basically: go off, just keep the receipts 🧾✨)


πŸ” 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, no notes πŸ’…

this was gnutls version 3.8.13, and the page itself goes by gnutls_dh_get_prime_bits(3) β€” mwah, take care of her πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from