gnutls_prf_raw(3)
π gnutls_prf_raw(3) π
okay bestie, welcome to the gnutls manual, this one's about gnutls_prf_raw β an API function, no cap. pull up a chair, grab a boba, we're doing crypto lore today π§β¨
β¨ NAME β¨
gnutls_prf_raw β literally just an API function, that's the whole name, short and iconic π
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
int gnutls_prf_raw(gnutls_session_t session, size_t label_size, const
char * label, size_t seed_size, const char * seed, size_t outsize, char
* out);
look at that signature. she's long, she's precise, she's giving main character energy π
π ARGUMENTS π
gnutls_session_t sessionβ bestie this is agnutls_session_ttype. that's it. that's the vibe.size_t label_sizeβ how long thelabelvariable is. count those characters, queen πconst char * labelβ the label used in the PRF computation, typically a short little string. keep it cute, keep it brief.size_t seed_sizeβ the length of theseedvariable. yes we're measuring again, we love a size_t π«Άconst char * seedβ optional extra data to seed the PRF with. optional! she's flexible!size_t outsizeβ the size of the pre-allocated output buffer that's gonna hold the output. know your limits, bestie.char * outβ a pre-allocated buffer to hold the generated data. you bring the bucket, the function brings the water π§
π¦ DESCRIPTION π¦
so what are we even doing here? we're applying the TLS Pseudo-Random-Function (PRF) on the master secret and the data you hand over. periodt.
the label variable usually contains a string denoting the purpose for the generated data. like a lil name tag for your bytes π·οΈ
the seed usually contains data such as the client and server random, perhaps together with some additional data that is added to guarantee uniqueness of the output for a particular purpose.
β οΈ now listen up because this part is important: because the output is not guaranteed to be unique for a particular session unless seed includes the client random and server random fields (the PRF would output the same data on another connection resumed from the first one), it is not recommended to use this function directly. π
the gnutls_prf() function seeds the PRF with the client and server random fields directly, and is recommended if you want to generate pseudo random data unique for each session. so likeβ¦ use that one instead, fr fr. this raw one is giving "I can fix him" energy and you should NOT try to fix him π
π NOTE π
this function will only operate under TLS versions prior to 1.3. in TLS1.3 the use of PRF is replaced with HKDF and the generic exporters like gnutls_prf_rfc5705() should be used instead. under TLS1.3 this function returns GNUTLS_E_INVALID_REQUEST.
so if you're on TLS1.3 and you're like "why isn't this working" β bestie, that's the whole point. she said no. π
β RETURNS β
GNUTLS_E_SUCCESS on success, or an error code. slay when it works, error code when it doesn't. no in-between, we love a clear boundary π
π REPORTING BUGS π
found a bug? don't gatekeep, report bugs 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.
(translation: share the love, 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, bestie!! thanks for reading, you ate that π«Άβ¨ this was gnutls 3.8.13, signing off β stay hydrated, use gnutls_prf() instead of raw, and don't talk to TLS1.3 about PRF, she's moved on π
π
π¦ 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