gnutls_crypto_register_cipher(3)
π gnutls_crypto_register_cipher β bestie edition π
okay so you're in the gnutls manual, section 3, and today's main character is gnutls_crypto_register_cipher(3). buckle up π
β¨ NAME β¨
gnutls_crypto_register_cipher β it's an API function, bestie, and it's here to let you register a cipher algorithm. iykyk.
πΈ SYNOPSIS πΈ
#include <gnutls/crypto.h>
int gnutls_crypto_register_cipher(gnutls_cipher_algorithm_t algorithm,
int priority, gnutls_cipher_init_func init, gnutls_cipher_setkey_func
setkey, gnutls_cipher_setiv_func setiv, gnutls_cipher_encrypt_func
encrypt, gnutls_cipher_decrypt_func decrypt, gnutls_cipher_deinit_func
deinit);
like, that's a LOT of arguments, and every single one of them matters. no skipping π
π¦ ARGUMENTS π¦
gnutls_cipher_algorithm_t algorithmβ this is the gnutls algorithm identifier. it's the "who am i" of your cipher β¨int priorityβ the priority of the algorithm. yes bestie, priority matters here, keep reading πgnutls_cipher_init_func initβ a function which initializes the cipher π±gnutls_cipher_setkey_func setkeyβ a function which sets the key of the cipher πgnutls_cipher_setiv_func setivβ a function which sets the nonce/IV of the cipher (non-AEAD)gnutls_cipher_encrypt_func encryptβ a function which performs encryption (non-AEAD) πgnutls_cipher_decrypt_func decryptβ a function which performs decryption (non-AEAD) πgnutls_cipher_deinit_func deinitβ a function which deinitializes the cipher π§Ή
π DESCRIPTION π
so basically this function will register a cipher algorithm to be used by gnutls. any algorithm you register will override the included algorithms, and by convention kernel implemented algorithms have priority of 90 and CPU-assisted of 80. and here's the plot twist: the algorithm with the lowest priority will be used by gnutls. yes, lowest. not highest. that's the vibe, don't fight it π
in the case that the registered init or setkey functions return GNUTLS_E_NEED_FALLBACK, GnuTLS will attempt to use the next in priority registered cipher. slay, it's got a backup plan π«Ά
the functions which are marked as non-AEAD β they are not required when registering a cipher to be used with the new AEAD API introduced in GnuTLS 3.4.0. internally GnuTLS uses the new AEAD API. so those ones are giving optional, lowkey.
π DEPRECATED π
since 3.7.0 it is no longer possible to override cipher implementation. yeah. it's giving deprecated, bestie. mourn it, then move on. π
π RETURNS π
GNUTLS_E_SUCCESS on success, otherwise a negative error code. standard behavior, no cap.
β SINCE β
3.4.0 β so it's been around for a minute π
π REPORTING BUGS π
found a bug? don't be shy, report bugs to <bugs@gnutls.org> π
home page: https://www.gnutls.org
π 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. iconic of them honestly π«Ά
π§ 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/
and that's the whole page, bestie β¨ this was gnutls_crypto_register_cipher(3) from the gnutls manual, version 3.8.13. go forth and cipher responsibly π
ππΈ
π¦ 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