gnutls_hpke_open(3)
π gnutls_hpke_open(3) π
okay bestie, welcome to the gnutls girlies' corner of the manual, where today's main character is gnutls_hpke_open(3) β the function that opens your HPKE ciphertext like it's a lil gift π no cap.
β¨ NAME β¨
gnutls_hpke_open β API function. that's it, that's the name, slay π
πΈ SYNOPSIS πΈ
#include <gnutls/hpke.h>
int gnutls_hpke_open(gnutls_hpke_context_t ctx, const gnutls_datum_t *
aad, const gnutls_datum_t * ciphertext, gnutls_datum_t * plaintext);
π¦ ARGUMENTS π¦
gnutls_hpke_context_t ctxβ the HPKE context you're using to open stuff. it's the vibe, the whole setup, the moment.const gnutls_datum_t * aadβ the associated data (AAD) that got authenticated back when the sender was sealing. it's the receipts of the operation, fr fr.const gnutls_datum_t * ciphertextβ the ciphertext the sender sent you. the locked-up lil secret π«Άgnutls_datum_t * plaintextβ a pointer to agnutls_datum_tstruct where the resulting plaintext is gonna live. this is where the tea gets poured β
π DESCRIPTION π
so basically this function does the opening operation of HPKE. it takes the ciphertext from the sender and uses the keys and nonces that were set up in the HPKE context (after decapsulation, bestie, after) to decrypt that ciphertext and verify the authentication tag. if the decryption and the authentication both go off without a hitch, the resulting plaintext gets stored in plaintext. π
and if the decryption or authentication fails?? the function securely erases any allocated plaintext and returns an error code. it's giving clean-up-on-the-way-out, iconic behavior honestly, no leftover mess π
you can totally use this function multiple times with the same HPKE context, but heads up β the decapsulation function gnutls_hpke_decap() must be called once before the first call to this function. that's the entry fee, bestie, pay it once π
aad should be the exact same AAD that was provided to gnutls_hpke_seal() on the sender's side. same AAD, same energy.
ciphertext should be the same ciphertext that gnutls_hpke_seal() generated on the sender's side. like, the literal same one. don't switch it up on me π
and yes, the function will allocate memory for the plaintext, so the caller (that's you, babe) is responsible for freeing that memory using gnutls_free() when it's no longer needed. don't leave it hanging, that's a memory leak and memory leaks are NOT the vibe π
β RETURNS β
0 on success, or a negative error code on failure. simple as that, periodt.
π SINCE π
3.8.13 β she's been here since then and she's been eating ever since π
π REPORTING BUGS π
found a bug? don't be shy, 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. free as in freedom, and also free as in free β¨
π₯ 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_open(3) from the gnutls manual, version 3.8.13, dated 3.8.13. go forth and decrypt responsibly π«Άπ
π¦ 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