gnutls_hmac_init(3)
π gnutls_hmac_init π
okay bestie, we're in the gnutls manual β page gnutls_hmac_init(3) β and honestly? this one is a lil bop. it's an API function, she's been around since forever, and she's here to set you up to make MACs. let's get into it π«Ά
β¨ NAME β¨
gnutls_hmac_init β the API function that starts the whole MAC party π
πΈ SYNOPSIS πΈ
#include <gnutls/crypto.h>
int gnutls_hmac_init(gnutls_hmac_hd_t * dig, gnutls_mac_algorithm_t
algorithm, const void * key, size_t keylen);
yes, that's the whole vibe. four args, one int back. slay π
π¦ ARGUMENTS π¦
gnutls_hmac_hd_t * digβ this one is agnutls_hmac_hd_ttype, bestie. she's the handle, she's the one holding the state, main character energy fr.gnutls_mac_algorithm_t algorithmβ the HMAC algorithm you wanna use. pick your fighter πconst void * keyβ the key that's gonna be used for encryption πsize_t keylenβ the length of the key. yes, you gotta tell it. no, it will not guess. periodt.
π« DESCRIPTION π«
So what this does is it initializes a context that you can then use to produce a Message Authentication Code (MAC) of data. and the way it does that? it uses whatever crypto backend gnutls currently has in play, or the cryptographic accelerator that's in use. like, it just taps into the current setup, no cap β¨
Important lil note, and I mean it: despite the name of this function β and yes the name says HMAC β it can be used for other MAC algorithms than HMAC. the name is not the whole story. she contains multitudes π
π RETURNS π
Zero, or a negative error code on error. that's it, that's the tea. 0 means we're good, anything negative means something went sideways π
β SINCE β
2.10.0 β an icon. been here since 2.10.0 and she's still thriving π§
π REPORTING BUGS π
Found something cursed? Report bugs to <bugs@gnutls.org>.
Home page: https://www.gnutls.org
(the devs are lovely, they wanna hear about it, fr fr)
π 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.
like. free to copy, just keep the receipts. respect the notice and we're all good π«Ά
π 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/
go read the whole thing, it's giving encyclopedic and I'm obsessed π
okay that's the page!! this was gnutls_hmac_init(3) from the gnutls manual, 3.8.13 energy, and yeah β she ate, no crumbs. now go initialize that context and MAC some data, 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