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 agnutls_datum_tstruct 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 π
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
- 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