Top |
int | gnutls_cipher_add_auth () |
int | gnutls_cipher_decrypt () |
int | gnutls_cipher_decrypt2 () |
void | gnutls_cipher_deinit () |
int | gnutls_cipher_encrypt () |
int | gnutls_cipher_encrypt2 () |
unsigned | gnutls_cipher_get_block_size () |
int | gnutls_cipher_init () |
void | gnutls_cipher_set_iv () |
int | gnutls_cipher_tag () |
int | gnutls_hash () |
void | gnutls_hash_deinit () |
unsigned | gnutls_hash_get_len () |
int | gnutls_hash_init () |
void | gnutls_hash_output () |
int | gnutls_hmac () |
void | gnutls_hmac_deinit () |
unsigned | gnutls_hmac_get_len () |
void | gnutls_hmac_output () |
int | gnutls_rnd () |
typedef | gnutls_cipher_hd_t |
typedef | gnutls_hash_hd_t |
typedef | gnutls_hmac_hd_t |
enum | gnutls_rnd_level_t |
int gnutls_cipher_add_auth (gnutls_cipher_hd_t handle
,const void *text
,size_t text_size
);
This function operates on authenticated encryption with associated data (AEAD) ciphers and authenticate the input data. This function can only be called once and before any encryption operations.
Since: 3.0
int gnutls_cipher_decrypt (const gnutls_cipher_hd_t handle
,void *ciphertext
,size_t ciphertextlen
);
This function will decrypt the given data using the algorithm specified by the context.
Note that in AEAD ciphers, this will not check the tag. You will
need to compare the tag sent with the value returned from gnutls_cipher_tag()
.
Since: 2.10.0
int gnutls_cipher_decrypt2 (gnutls_cipher_hd_t handle
,const void *ciphertext
,size_t ciphertextlen
,void *text
,size_t textlen
);
This function will decrypt the given data using the algorithm
specified by the context. For block ciphers the ctext_len
must be
a multiple of the block size. For the supported ciphers the plaintext
data length will equal the ciphertext size.
Note that in AEAD ciphers, this will not check the tag. You will
need to compare the tag sent with the value returned from gnutls_cipher_tag()
.
Since: 2.12.0
void
gnutls_cipher_deinit (gnutls_cipher_hd_t handle
);
This function will deinitialize all resources occupied by the given encryption context.
Since: 2.10.0
int gnutls_cipher_encrypt (const gnutls_cipher_hd_t handle
,void *text
,size_t textlen
);
This function will encrypt the given data using the algorithm specified by the context.
Since: 2.10.0
int gnutls_cipher_encrypt2 (gnutls_cipher_hd_t handle
,const void *text
,size_t textlen
,void *ciphertext
,size_t ciphertextlen
);
This function will encrypt the given data using the algorithm
specified by the context. For block ciphers the ptext_len
must be
a multiple of the block size. For the supported ciphers the encrypted
data length will equal the plaintext size.
Since: 2.12.0
int gnutls_cipher_init (gnutls_cipher_hd_t *handle
,gnutls_cipher_algorithm_t cipher
,const gnutls_datum_t *key
,const gnutls_datum_t *iv
);
This function will initialize the handle
context to be usable
for encryption/decryption of data. This will effectively use the
current crypto backend in use by gnutls or the cryptographic
accelerator in use.
handle |
is a gnutls_cipher_hd_t type |
|
cipher |
the encryption algorithm to use |
|
key |
the key to be used for encryption/decryption |
|
iv |
the IV to use (if not applicable set NULL) |
Since: 2.10.0
void gnutls_cipher_set_iv (gnutls_cipher_hd_t handle
,void *iv
,size_t ivlen
);
This function will set the IV to be used for the next encryption block.
Since: 3.0
int gnutls_cipher_tag (gnutls_cipher_hd_t handle
,void *tag
,size_t tag_size
);
This function operates on authenticated encryption with associated data (AEAD) ciphers and will return the output tag.
handle |
is a gnutls_cipher_hd_t type |
|
tag |
will hold the tag |
|
tag_size |
the length of the tag to return |
Since: 3.0
int gnutls_hash (gnutls_hash_hd_t handle
,const void *text
,size_t textlen
);
This function will hash the given data using the algorithm specified by the context.
Since: 2.10.0
void gnutls_hash_deinit (gnutls_hash_hd_t handle
,void *digest
);
This function will deinitialize all resources occupied by the given hash context.
Since: 2.10.0
unsigned
gnutls_hash_get_len ();
This function will return the length of the output data of the given hash algorithm.
Since: 2.10.0
int gnutls_hash_init (gnutls_hash_hd_t *dig
,gnutls_digest_algorithm_t algorithm
);
This function will initialize an context that can be used to produce a Message Digest of data. This will effectively use the current crypto backend in use by gnutls or the cryptographic accelerator in use.
Since: 2.10.0
void gnutls_hash_output (gnutls_hash_hd_t handle
,void *digest
);
This function will output the current hash value and reset the state of the hash.
Since: 2.10.0
int gnutls_hmac (gnutls_hmac_hd_t handle
,const void *text
,size_t textlen
);
This function will hash the given data using the algorithm specified by the context.
Since: 2.10.0
void gnutls_hmac_deinit (gnutls_hmac_hd_t handle
,void *digest
);
This function will deinitialize all resources occupied by the given hmac context.
Since: 2.10.0
unsigned
gnutls_hmac_get_len ();
This function will return the length of the output data of the given hmac algorithm.
Since: 2.10.0
void gnutls_hmac_output (gnutls_hmac_hd_t handle
,void *digest
);
This function will output the current MAC value and reset the state of the MAC.
Since: 2.10.0
int gnutls_rnd (gnutls_rnd_level_t level
,void *data
,size_t len
);
This function will generate random data and store it to output
buffer. The value of level
should be one of GNUTLS_RND_NONCE
,
GNUTLS_RND_RANDOM
and GNUTLS_RND_KEY
. See the manual and
gnutls_rnd_level_t
for detailed information.
This function is thread-safe and also fork-safe.
Since: 2.12.0