gnutls_dh_params_generate2(3)
β¨ gnutls_dh_params_generate2(3) β¨
okay bestie, welcome to the gnutls manual π this one's from the gnutls manual, and we're diving into gnutls_dh_params_generate2 β yes it's an API function, yes it's important, let's get into it π«Ά
πΈ NAME πΈ
gnutls_dh_params_generate2 β it's an API function, girlie. that's the whole vibe π
π¦ SYNOPSIS π¦
#include <gnutls/gnutls.h>
int gnutls_dh_params_generate2(gnutls_dh_params_t dparams, unsigned int
bits);
π ARGUMENTS π
gnutls_dh_params_t dparamsβ the parameters, babes. that's the thing you're filling in β¨unsigned int bitsβ literally the prime's number of bits π’
π DESCRIPTION π
so what does this actually do? it generates a brand new pair of prime and generator for use in the Diffie-Hellman key exchange. and likeβ¦ heads up: this may take a long time. not a little while, not "go grab a snack" β a long time, fr fr π
lowkey important: it is recommended not to set the number of bits directly, but to use gnutls_sec_param_to_pk_bits() instead. do that. please. π₯Ί
also, and this is the part people miss: the DH parameters are only useful to servers. since clients use the parameters sent by the server, it's literally of no use to call this on the client side. client-side girlies, this is not your moment π
the parameters generated are of the DSA form. it's also possible to generate provable parameters (following the Shawe-Taylor algorithm) by using gnutls_x509_privkey_generate2() with the DSA option and the GNUTLS_PRIVKEY_FLAG_PROVABLE flag set. those can then be imported with gnutls_dh_params_import_dsa(). iconic little workflow, no cap β¨
and the big one:
it is no longer recommended for applications to generate parameters. see the "Parameter generation" section in the manual. π
π RETURNS π
on success, GNUTLS_E_SUCCESS (0) is returned π otherwise a negative error code is returned π (cry about it, then read the error code).
π REPORTING BUGS π
found a bug? report it 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. slay, honestly π
π₯ 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/ π¦
okay that's the whole page bestie, you ate that π«Ά this was gnutls version 3.8.13, page gnutls_dh_params_generate2(3) β go forth and generate responsibly (or, like, don't, because it's no longer recommended π). mwah πβ¨π
π¦ 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