1gnutls_crypto_register_cipher(3) gnutls gnutls_crypto_register_cipher(3)
2
3
4
6 gnutls_crypto_register_cipher - API function
7
9 #include <gnutls/crypto.h>
10
11 int gnutls_crypto_register_cipher(gnutls_cipher_algorithm_t algorithm,
12 int priority, gnutls_cipher_init_func init, gnutls_cipher_setkey_func
13 setkey, gnutls_cipher_setiv_func setiv, gnutls_cipher_encrypt_func en‐
14 crypt, gnutls_cipher_decrypt_func decrypt, gnutls_cipher_deinit_func
15 deinit);
16
18 gnutls_cipher_algorithm_t algorithm
19 is the gnutls algorithm identifier
20
21 int priority
22 is the priority of the algorithm
23
24 gnutls_cipher_init_func init
25 A function which initializes the cipher
26
27 gnutls_cipher_setkey_func setkey
28 A function which sets the key of the cipher
29
30 gnutls_cipher_setiv_func setiv
31 A function which sets the nonce/IV of the cipher (non-AEAD)
32
33 gnutls_cipher_encrypt_func encrypt
34 A function which performs encryption (non-AEAD)
35
36 gnutls_cipher_decrypt_func decrypt
37 A function which performs decryption (non-AEAD)
38
39 gnutls_cipher_deinit_func deinit
40 A function which deinitializes the cipher
41
43 This function will register a cipher algorithm to be used by gnutls.
44 Any algorithm registered will override the included algorithms and by
45 convention kernel implemented algorithms have priority of 90 and
46 CPU-assisted of 80. The algorithm with the lowest priority will be
47 used by gnutls.
48
49 In the case the registered init or setkey functions return
50 GNUTLS_E_NEED_FALLBACK, GnuTLS will attempt to use the next in priority
51 registered cipher.
52
53 The functions which are marked as non-AEAD they are not required when
54 registering a cipher to be used with the new AEAD API introduced in
55 GnuTLS 3.4.0. Internally GnuTLS uses the new AEAD API.
56
58 since 3.7.0 it is no longer possible to override cipher implementation
59
61 GNUTLS_E_SUCCESS on success, otherwise a negative error code.
62
64 3.4.0
65
67 Report bugs to <bugs@gnutls.org>.
68 Home page: https://www.gnutls.org
69
70
72 Copyright © 2001- Free Software Foundation, Inc., and others.
73 Copying and distribution of this file, with or without modification,
74 are permitted in any medium without royalty provided the copyright no‐
75 tice and this notice are preserved.
76
78 The full documentation for gnutls is maintained as a Texinfo manual.
79 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
80 visit
81
82 https://www.gnutls.org/manual/
83
84gnutls 3.7.8 gnutls_crypto_register_cipher(3)