gnutls_crypto_register_mac(3)

✨ gnutls_crypto_register_mac(3) ✨

okay bestie, gather round πŸ’– this one lives in the gnutls manual, and it's literally called gnutls_crypto_register_mac β€” say that five times fast, I dare you 🫢


🌸 NAME 🌸

gnutls_crypto_register_mac β€” it's an API function, bestie. that's the whole vibe ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/crypto.h>

int gnutls_crypto_register_mac(gnutls_mac_algorithm_t algorithm, int
priority, gnutls_mac_init_func init, gnutls_mac_setkey_func setkey,
gnutls_mac_setnonce_func setnonce, gnutls_mac_hash_func hash,
gnutls_mac_output_func output, gnutls_mac_deinit_func deinit,
gnutls_mac_fast_func hash_fast);

look at all those parameters. she's high maintenance and honestly? valid πŸ’…


πŸ’œ ARGUMENTS πŸ’œ

  • gnutls_mac_algorithm_t algorithm β€” this is the gnutls MAC identifier, like her little name tag at the party πŸŽ€
  • int priority β€” the priority of the algorithm. yes it matters, keep reading πŸ”₯
  • gnutls_mac_init_func init β€” a function that initializes the MAC. first step, always πŸ’–
  • gnutls_mac_setkey_func setkey β€” a function that sets the key of the MAC πŸ”‘
  • gnutls_mac_setnonce_func setnonce β€” a function that sets the nonce for the mac. lowkey optional β€” it may be NULL for common MAC algorithms πŸ™ˆ
  • gnutls_mac_hash_func hash β€” performs the hash operation ✨
  • gnutls_mac_output_func output β€” provides the output of the MAC, aka the reveal 🎁
  • gnutls_mac_deinit_func deinit β€” a function that deinitializes the MAC. clean up after yourself, queen πŸ‘‘
  • gnutls_mac_fast_func hash_fast β€” performs the MAC operation in one go. no cap, all in one πŸƒβ™€οΈ

🌈 DESCRIPTION 🌈

so here's the tea β˜• this function will register a MAC algorithm to be used by gnutls. like, you're adding your own fave to the roster πŸ’–

any algorithm you register will override the included algorithms β€” yes, it's giving main character energy πŸ‘‘ β€” and by convention, kernel implemented algorithms have priority of 90 and CPU-assisted of 80. write that down πŸ“

and the plot twist: the algorithm with the lowest priority will be used by gnutls. lowest wins. make it make sense, I know, but that's the rule bestie πŸ’€


πŸ’€ DEPRECATED πŸ’€

since 3.7.0 it is no longer possible to override cipher implementation

ngl this one's basically retired. she's living in the past, still iconic, but retired 😭


⭐ RETURNS ⭐

GNUTLS_E_SUCCESS on success πŸŽ‰ otherwise a negative error code πŸ™ƒ (so, if it's negative, something went wrong, bestie, go check your vibes)


πŸ¦‹ SINCE πŸ¦‹

3.4.0 β€” she's been around a minute πŸ’œ


πŸ“ REPORTING BUGS πŸ“

found a bug? spill the tea, not to me though, to these people:

Report bugs to <bugs@gnutls.org>.

Home page: https://www.gnutls.org


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 you can copy it, no you don't have to pay, 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/

go forth and read, bestie, it's giving academic but make it cute πŸ“šπŸ’…


and that's the whole page fr fr 🫢 this was gnutls_crypto_register_mac(3) from the gnutls manual, version 3.8.13 β€” periodt πŸ’–βœ¨πŸŒˆ

πŸ“¦ where this page comes from