gnutls_dh_params_export_raw(3)

✨ gnutls_dh_params_export_raw ✨

okay bestie, welcome to the gnutls manual β€” this one's a lil function page, and it's lowkey iconic. no cap. πŸ’…


πŸŽ€ NAME πŸŽ€

gnutls_dh_params_export_raw β€” API function

so like. it's an API function. that's the name. slay.


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

int gnutls_dh_params_export_raw(gnutls_dh_params_t params,
gnutls_datum_t * prime, gnutls_datum_t * generator, unsigned int *
bits);

yes she's a whole signature. look at her. ✨


πŸ’– ARGUMENTS πŸ’–

  • gnutls_dh_params_t params β€” this one's holding the DH parameters. she's the source of truth, the main character, the keeper of the vibes. πŸ‘‘
  • gnutls_datum_t * prime β€” will hold the new prime. that's the assignment. she comes out of this function holding it. 🫢
  • gnutls_datum_t * generator β€” will hold the new generator. same deal, she gets the generator, no stress.
  • unsigned int * bits β€” if non null will hold the secret key's number of bits. note the if non null β€” that's a real condition, bestie, so if you pass NULL she's just not gonna fill it in, and that's fine and legal. 🌈

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. this function will export the pair of prime and generator for use in the Diffie-Hellman key exchange. it's giving "here's the two numbers you need, go do your little key exchange, mwah." πŸ’–

and listen β€” the new parameters will be allocated using gnutls_malloc() and will be stored in the appropriate datum. so that memory? not yours to just casually free(), bestie. that's the whole point. read the docs, live the docs. πŸ™ˆ


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned. otherwise a negative error code is returned. so like, zero is the good one here, which is a fun little twist because usually zero is giving nothing. not here. here zero is everything. 🌟


😭 REPORTING BUGS 😭

found a bug? not the vibe, but okay, report bugs 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 yes you may, just keep the receipts. that's the rule. 🫢)


πŸ’€ 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/

go forth and read. iykyk. 🌸


and that's the page, babe β€” this was gnutls 3.8.13, the gnutls_dh_params_export_raw(3) manual, brought to you by the gnutls peeps. ty for coming to my ted talk, ily, go export some DH params responsibly. βœ¨πŸ’œπŸŽ€

πŸ“¦ where this page comes from