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 a gnutls_hmac_hd_t type, 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 Β© 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