gnutls_hpke_derive_keypair(3)

πŸ’– gnutls_hpke_derive_keypair β€” gnutls manual, page 3 πŸŽ€

okay bestie, sit down, hydrate, because this one is genuinely so cute: it's a whole ✨key pair generator✨ from the gnutls manual (section 3, the library functions girlies). No cap, this is the function that takes your lil seed and pops out a matching private + public key. Main character energy fr fr.


✨ NAME ✨

gnutls_hpke_derive_keypair β€” it's an API function, and it derives a key pair. That's it, that's the vibe πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/hpke.h>

int gnutls_hpke_derive_keypair(gnutls_hpke_kem_t kem, const
gnutls_datum_t * ikm, gnutls_privkey_t privkey, gnutls_pubkey_t pubkey);

like… four arguments, one int coming back at you. simple. elegant. iconic. πŸ¦‹


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_hpke_kem_t kem β€” the KEM algorithm you wanna use for generating the key pair. pick your fighter, bestie πŸ’œ
  • const gnutls_datum_t * ikm β€” a pointer to a gnutls_datum_t struct holding the input key material (IKM) that's gonna be used to generate the key pair. this is literally the seed, the origin story, the lore 🌱
  • gnutls_privkey_t privkey β€” an initialized private key. key word: initialized. don't come in here with a blank one πŸ™ˆ
  • gnutls_pubkey_t pubkey β€” an initialized public key. same rules, bestie, same rules ✨

πŸ’« DESCRIPTION πŸ’«

so what does it do? It derives a key pair β€” that's the private key AND the public key, both of them, a matching set 🫢 β€” for the KEM algorithm you specified, using the input key material (ikm) you handed over.

The ikm is used as a seed for the key generation process. and the way that means you get deterministic key pair generation if you use the same IKM again β€” same seed, same keys, every single time. no surprises, no randomness jumping out, just consistency 😌πŸ”₯

The function also checks that all the parameters you passed are valid, and that the KEM algorithm you asked for is actually supported. it's doing a vibe check on your arguments before it commits, which honestly? we love a function with boundaries πŸ’…

oh and one thing: ikm should be a non-empty byte string that serves as the seed for key pair generation. empty seed = not the move, bestie. give it something to work with πŸ“


πŸ‘‘ RETURNS πŸ‘‘

0 on success, or a negative error code on failure. that's the whole story β€” zero is the slay, negative is the "aww 😭" πŸ’€


⭐ SINCE ⭐

3.8.13

so if you're on anything older, this function is not gonna be there for you. update, bestie. it's giving ancient πŸ’€


🌈 REPORTING BUGS 🌈

found a bug? (not you, the code) β€” report it 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.

(yes bestie, you can copy it. 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, no skips, no summarising, every last detail preserved πŸ’–

signing off from the gnutls manual, version 3.8.13, on the gnutls_hpke_derive_keypair(3) page β€” go derive something beautiful, bestie πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from