gnutls_hpke_export(3)

✨ gnutls_hpke_export(3) ✨

okay bestie, welcome to the gnutls manual page for gnutls_hpke_export β€” yes it's an API function, yes it's giving crypto main character energy, and yes we're gonna get through it together πŸ’–


🌸 NAME 🌸

gnutls_hpke_export β€” literally an API function, that's the whole vibe


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/hpke.h>

int gnutls_hpke_export(gnutls_hpke_context_t ctx, const gnutls_datum_t *
exporter_context, size_t length, gnutls_datum_t * secret);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_hpke_context_t ctx β€” the HPKE context you're using to export the secret. like, the whole reason we're here πŸ’…
  • const gnutls_datum_t * exporter_context β€” the application-specific context that gets included in the export. it's your lil personalized touch ✨
  • size_t length β€” how many bytes of secret you want exported. the requested length, bestie, in bytes, exactly as asked πŸ“
  • gnutls_datum_t * secret β€” a pointer to a gnutls_datum_t struct where the exported secret is gonna land. that's its home now 🏠

πŸ’œ DESCRIPTION πŸ’œ

so this function? it performs the export operation of HPKE. iconic behaviour honestly.

It derives a secret of length bytes from the exporter secret in the HPKE context, using the application-specific context you handed over plus the KDF specified in the context. The resulting secret gets stored in secret. And before it does any of that, it checks that the parameters you passed are valid, that the context is properly initialized, and that there's actually an exporter secret available in the context β€” no secret, no service πŸ™ˆ

length should be a positive integer that does not exceed the maximum allowed size for HPKE exports. don't be greedy, the limit is real 😭

heads up: The function will allocate memory for secret, and you β€” yes you, the caller β€” are responsible for freeing this memory using gnutls_free() when it is no longer needed. don't leak, it's not cute 🫢

⭐ RETURNS ⭐

0 on success, or a negative error code on failure. that's it, that's the whole mood πŸ’€


🌈 SINCE 🌈

3.8.13 β€” vintage, but make it fresh ✨


πŸ’€ REPORTING BUGS πŸ’€

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. slay, legally speaking πŸ’…


🧚 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_hpke_export(3), straight outta the gnutls manual, version 3.8.13. go export those secrets responsibly, mwah πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from