1 @node Using GnuTLS as a cryptographic library
2 @chapter Using GnuTLS as a cryptographic library
4 @acronym{GnuTLS} is not a low-level cryptographic library, i.e.,
5 it does not provide access to basic cryptographic primitives. However
6 it abstracts the internal cryptographic back-end (see @ref{Cryptographic Backend}),
7 providing symmetric crypto, hash and HMAC algorithms, as well access
8 to the random number generation.
11 * Symmetric cryptography::
12 * Hash and HMAC functions::
13 * Random number generation::
16 @node Symmetric cryptography
17 @section Symmetric cryptography
18 @cindex symmetric cryptography
20 The available functions to access symmetric crypto algorithms operations
21 are shown below. The supported algorithms are the algorithms required by the TLS protocol.
22 They are listed in @ref{tab:ciphers}.
24 @showfuncE{gnutls_cipher_init,gnutls_cipher_encrypt2,gnutls_cipher_decrypt2,gnutls_cipher_set_iv,gnutls_cipher_deinit}
26 In order to support authenticated encryption with associated data (AEAD) algorithms the following
27 functions are provided to set the associated data and retrieve the authentication tag.
29 @showfuncB{gnutls_cipher_add_auth,gnutls_cipher_tag}
31 @node Hash and HMAC functions
32 @section Hash and HMAC functions
33 @cindex hash functions
34 @cindex HMAC functions
36 The available operations to access hash functions and hash-MAC (HMAC) algorithms
37 are shown below. HMAC algorithms provided keyed hash functionality. They supported HMAC algorithms are listed in @ref{tab:macs}.
39 @showfuncF{gnutls_hmac_init,gnutls_hmac,gnutls_hmac_output,gnutls_hmac_deinit,gnutls_hmac_get_len,gnutls_hmac_fast}
41 The available functions to access hash functions are shown below. The supported hash functions
42 are the same as the HMAC algorithms.
44 @showfuncF{gnutls_hash_init,gnutls_hash,gnutls_hash_output,gnutls_hash_deinit,gnutls_hash_get_len,gnutls_hash_fast}
46 @node Random number generation
47 @section Random number generation
48 @cindex random numbers
50 Access to the random number generator is provided using the @funcref{gnutls_rnd}
51 function. It allows obtaining random data of various levels.
53 @showenumdesc{gnutls_rnd_level_t,The random number levels.}
54 @showfuncdesc{gnutls_rnd}