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 agnutls_hmac_hd_ttype. 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 π
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
- 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