gnutls_crypto_register_digest(3)

πŸŽ€ gnutls_crypto_register_digest β€” API function πŸŽ€

okay so bestie, this one lives in the gnutls manual and it's literally called gnutls_crypto_register_digest. she's giving "let me plug my own hash into the crypto stack" energy, and honestly? iconic. let's get into it πŸ’–


✨ NAME ✨

gnutls_crypto_register_digest β€” API function. yeah that's it, that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <gnutls/crypto.h>

int gnutls_crypto_register_digest(gnutls_digest_algorithm_t algorithm,
int priority, gnutls_digest_init_func init, gnutls_digest_hash_func
hash, gnutls_digest_output_func output, gnutls_digest_deinit_func
deinit, gnutls_digest_fast_func hash_fast);

πŸ’œ ARGUMENTS πŸ’œ

  • gnutls_digest_algorithm_t algorithm β€” the gnutls digest identifier, aka which digest you're claiming. no cap. πŸ”₯
  • int priority β€” the priority of the algorithm. yes queen, she has a rank.
  • gnutls_digest_init_func init β€” a function which initializes the digest. warm-up era. ✨
  • gnutls_digest_hash_func hash β€” perform the hash operation. the main character moment. πŸ‘‘
  • gnutls_digest_output_func output β€” provide the output of the digest. serving results, periodt.
  • gnutls_digest_deinit_func deinit β€” a function which deinitializes the digest. she's logging off, respectfully. 🫢
  • gnutls_digest_fast_func hash_fast β€” perform the digest operation in one go. speedrun mode fr fr. ⭐

🌈 DESCRIPTION 🌈

so basically this function will register a digest algorithm to be used by gnutls. your algorithm, your rules, your moment πŸ’…

any algorithm you register will override the included algorithms β€” and by convention, kernel implemented algorithms have a priority of 90 and CPU-assisted have a priority of 80. noting that down, bestie, because it matters:

the algorithm with the lowest priority will be used by gnutls. lowest = winner. yes it's backwards from what you'd expect and yes it's still the rule. 🧚

😭 DEPRECATED 😭

not me having to tell you this… since 3.7.0 it is no longer possible to override cipher implementation. πŸ’€

read that again, bestie. deprecated. the override door? closed. πŸ™ˆ

⭐ RETURNS ⭐

GNUTLS_E_SUCCESS on success, otherwise a negative error code. so if you see a negative number, that's not a vibe check you passed. 😭


πŸ¦‹ SINCE πŸ¦‹

3.4.0 β€” she's been around a minute, an OG. πŸŽ€


πŸ› REPORTING BUGS πŸ›

found a bug? spill it, don't sit on it:


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. free as in go off, but 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/

iykyk. go read the whole manual, she's long but she's worth it. 🌸


okay that's the whole page, bestie β€” every flag, every default, every warning, all of it, nothing skipped. and for the cute sign-off: this was gnutls version 3.8.13, serving gnutls_crypto_register_digest(3) realness. mwah. πŸ’…βœ¨

πŸ“¦ where this page comes from