gnutls_hmac_copy(3)

πŸ’– gnutls_hmac_copy β€” from the gnutls manual, bestie πŸ’–

okay so real talk, this one is a little sleeper hit. gnutls_hmac_copy sounds basic but it's actually doing something kinda iconic: it clones a MAC context so you can keep the vibe going in two directions at once. let's get into it ✨


🌸 NAME 🌸

gnutls_hmac_copy β€” an API function, and yes that's literally all it says, she's mysterious like that πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/crypto.h>

gnutls_hmac_hd_t gnutls_hmac_copy(gnutls_hmac_hd_t handle);

like. one include. one function. clean. no cap. πŸŽ€


⭐ ARGUMENTS ⭐

  • gnutls_hmac_hd_t handle β€” bestie this is a gnutls_hmac_hd_t type. that's the whole description. she said "you already know." πŸ™ˆ

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's the tea β˜• β€” this function creates a copy of the MAC context, containing all its current state. every last bit of it. it's giving "save file" energy but for crypto state. so slay. πŸ’–

BUT. and this is important, listen up:

  • Copying contexts for MACs registered using gnutls_crypto_register_mac() is not supported and will always result in an error. not "sometimes", not "depends on the moon phase" β€” always. periodt. πŸ’€
  • On top of that, some of the MAC implementations do not support this operation either. so it's lowkey a vibe check every single time.
so applications should check the return value and provide a proper fallback. fr fr, do not skip the return check, i'm begging 🫢

🌈 RETURNS 🌈

new MAC context or NULL in case of an error. that's it. that's the whole deal. if you got NULL, something said no and you need a plan B ✨


πŸŽ€ SINCE πŸŽ€

3.6.9 β€” so she's been around a minute, respect the elders πŸ’œ


πŸ› REPORTING BUGS πŸ›

found something cursed? report bugs to <bugs@gnutls.org>. πŸ¦‹

Home page: https://www.gnutls.org β€” go say hi, she's lovely 🌸


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 bestie, you can share it, 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/

like, the whole lore is right there, go read it 🧚


and that's the page!! πŸ’– this was the gnutls manual, page gnutls_hmac_copy(3), version 3.8.13, dated gnutls β€” mwah, sending you a copy of my whole current state, no error, promise πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from