Next: Compatibility API, Previous: Abstract key API, Up: API reference [Contents][Index]
The following functions are to be used for low-level cryptographic operations. Their prototypes lie in ‘gnutls/crypto.h’.
handle: is a gnutls_cipher_hd_t structure.
text: the data to be authenticated
text_size: The length of the data
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.
Returns: Zero or a negative error code on error.
Since: 3.0
handle: is a gnutls_cipher_hd_t structure.
ciphertext: the data to encrypt
ciphertextlen: The length of data to encrypt
This function will decrypt the given data using the algorithm specified by the context.
Returns: Zero or a negative error code on error.
Since: 2.10.0
handle: is a gnutls_cipher_hd_t structure.
ciphertext: the data to encrypt
ciphertextlen: The length of data to encrypt
text: the decrypted data
textlen: The available length for decrypted data
This function will decrypt the given data using the algorithm specified by the context.
Returns: Zero or a negative error code on error.
Since: 2.12.0
handle: is a gnutls_cipher_hd_t structure.
This function will deinitialize all resources occupied by the given encryption context.
Since: 2.10.0
handle: is a gnutls_cipher_hd_t structure.
text: the data to encrypt
textlen: The length of data to encrypt
This function will encrypt the given data using the algorithm specified by the context.
Returns: Zero or a negative error code on error.
Since: 2.10.0
handle: is a gnutls_cipher_hd_t structure.
text: the data to encrypt
textlen: The length of data to encrypt
ciphertext: the encrypted data
ciphertextlen: The available length for encrypted data
This function will encrypt the given data using the algorithm specified by the context.
Returns: Zero or a negative error code on error.
Since: 2.12.0
algorithm: is an encryption algorithm
Get block size for encryption algorithm.
Returns: block size for encryption algorithm.
Since: 2.10.0
handle: is a gnutls_cipher_hd_t structure.
cipher: the encryption algorithm to use
key: The key to be used for encryption
iv: The IV to use (if not applicable set NULL)
This function will initialize an context that can be used for encryption/decryption of data. This will effectively use the current crypto backend in use by gnutls or the cryptographic accelerator in use.
Returns: Zero or a negative error code on error.
Since: 2.10.0
handle: is a gnutls_cipher_hd_t structure.
iv: the IV to set
ivlen: The length of the IV
This function will set the IV to be used for the next encryption block.
Since: 3.0
handle: is a gnutls_cipher_hd_t structure.
tag: will hold the tag
tag_size: The length of the tag to return
This function operates on authenticated encryption with associated data (AEAD) ciphers and will return the output tag.
Returns: Zero or a negative error code on error.
Since: 3.0
handle: is a gnutls_cipher_hd_t structure.
text: the data to hash
textlen: The length of data to hash
This function will hash the given data using the algorithm specified by the context.
Returns: Zero or a negative error code on error.
Since: 2.10.0
handle: is a gnutls_hash_hd_t structure.
digest: is the output value of the hash
This function will deinitialize all resources occupied by the given hash context.
Since: 2.10.0
algorithm: the hash algorithm to use
text: the data to hash
textlen: The length of data to hash
digest: is the output value of the hash
This convenience function will hash the given data and return output on a single call.
Returns: Zero or a negative error code on error.
Since: 2.10.0
algorithm: the hash algorithm to use
This function will return the length of the output data of the given hash algorithm.
Returns: The length or zero on error.
Since: 2.10.0
dig: is a gnutls_hash_hd_t structure.
algorithm: the hash algorithm to use
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.
Returns: Zero or a negative error code on error.
Since: 2.10.0
handle: is a gnutls_hash_hd_t structure.
digest: is the output value of the hash
This function will output the current hash value.
Since: 2.10.0
handle: is a gnutls_cipher_hd_t structure.
text: the data to hash
textlen: The length of data to hash
This function will hash the given data using the algorithm specified by the context.
Returns: Zero or a negative error code on error.
Since: 2.10.0
handle: is a gnutls_hmac_hd_t structure.
digest: is the output value of the MAC
This function will deinitialize all resources occupied by the given hmac context.
Since: 2.10.0
algorithm: the hash algorithm to use
key: the key to use
keylen: The length of the key
text: the data to hash
textlen: The length of data to hash
digest: is the output value of the hash
This convenience function will hash the given data and return output on a single call.
Returns: Zero or a negative error code on error.
Since: 2.10.0
algorithm: the hmac algorithm to use
This function will return the length of the output data of the given hmac algorithm.
Returns: The length or zero on error.
Since: 2.10.0
dig: is a gnutls_hmac_hd_t structure.
algorithm: the HMAC algorithm to use
key: The key to be used for encryption
keylen: The length of the key
This function will initialize an context that can be used to produce a Message Authentication Code (MAC) of data. This will effectively use the current crypto backend in use by gnutls or the cryptographic accelerator in use.
Returns: Zero or a negative error code on error.
Since: 2.10.0
handle: is a gnutls_hmac_hd_t structure.
digest: is the output value of the MAC
This function will output the current MAC value.
Since: 2.10.0
level: a security level
data: place to store random bytes
len: The requested size
This function will generate random data and store it to output buffer.
Returns: Zero or a negative error code on error.
Since: 2.12.0
Next: Compatibility API, Previous: Abstract key API, Up: API reference [Contents][Index]