* accelerator in use.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.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)
+ const gnutls_datum_t * key, const gnutls_datum_t * iv)
{
- *handle = gnutls_malloc(sizeof(cipher_hd_st));
- if (*handle == NULL) {
- gnutls_assert();
- return GNUTLS_E_MEMORY_ERROR;
- }
-
- return _gnutls_cipher_init(((cipher_hd_st*)*handle), cipher, key, iv);
+ *handle = gnutls_malloc (sizeof (cipher_hd_st));
+ if (*handle == NULL)
+ {
+ gnutls_assert ();
+ return GNUTLS_E_MEMORY_ERROR;
+ }
+
+ return _gnutls_cipher_init (((cipher_hd_st *) * handle), cipher, key, iv);
}
/**
* specified by the context.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
-int gnutls_cipher_encrypt (gnutls_cipher_hd_t handle, void *text, int textlen)
+int
+gnutls_cipher_encrypt (gnutls_cipher_hd_t handle, void *text, int textlen)
{
- return _gnutls_cipher_encrypt((cipher_hd_st*)handle, text, textlen);
+ return _gnutls_cipher_encrypt ((cipher_hd_st *) handle, text, textlen);
}
/**
* specified by the context.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
int
gnutls_cipher_decrypt (gnutls_cipher_hd_t handle, void *ciphertext,
- int ciphertextlen)
+ int ciphertextlen)
{
- return _gnutls_cipher_decrypt((cipher_hd_st*)handle, ciphertext,
- ciphertextlen);
+ return _gnutls_cipher_decrypt ((cipher_hd_st *) handle, ciphertext,
+ ciphertextlen);
}
/**
*
* This function will deinitialize all resources occupied by the given
* encryption context.
+ *
+ * Since: 2.10.0
**/
void
gnutls_cipher_deinit (gnutls_cipher_hd_t handle)
{
- return _gnutls_cipher_deinit((cipher_hd_st*)handle);
+ return _gnutls_cipher_deinit ((cipher_hd_st *) handle);
}
* cryptographic accelerator in use.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
int
gnutls_hmac_init (gnutls_hmac_hd_t * dig,
gnutls_digest_algorithm_t algorithm,
const void *key, int keylen)
{
- *dig = gnutls_malloc(sizeof(digest_hd_st));
- if (*dig == NULL) {
- gnutls_assert();
- return GNUTLS_E_MEMORY_ERROR;
- }
+ *dig = gnutls_malloc (sizeof (digest_hd_st));
+ if (*dig == NULL)
+ {
+ gnutls_assert ();
+ return GNUTLS_E_MEMORY_ERROR;
+ }
- return _gnutls_hmac_init(((digest_hd_st*)*dig), algorithm, key, keylen);
+ return _gnutls_hmac_init (((digest_hd_st *) * dig), algorithm, key, keylen);
}
/**
* specified by the context.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
-int gnutls_hmac (gnutls_hmac_hd_t handle, const void *text, size_t textlen)
+int
+gnutls_hmac (gnutls_hmac_hd_t handle, const void *text, size_t textlen)
{
- return _gnutls_hmac((digest_hd_st*)handle, text, textlen);
+ return _gnutls_hmac ((digest_hd_st *) handle, text, textlen);
}
/**
* @digest: is the output value of the MAC
*
* This function will output the current MAC value.
+ *
+ * Since: 2.10.0
**/
void
gnutls_hmac_output (gnutls_hmac_hd_t handle, void *digest)
{
- return _gnutls_hmac_output((digest_hd_st*)handle, digest);
+ return _gnutls_hmac_output ((digest_hd_st *) handle, digest);
}
/**
*
* This function will deinitialize all resources occupied by
* the given hmac context.
+ *
+ * Since: 2.10.0
**/
-void gnutls_hmac_deinit (gnutls_hmac_hd_t handle, void *digest)
+void
+gnutls_hmac_deinit (gnutls_hmac_hd_t handle, void *digest)
{
- _gnutls_hmac_deinit((digest_hd_st*)handle, digest);
+ _gnutls_hmac_deinit ((digest_hd_st *) handle, digest);
}
/**
*
* Returns: The length or zero on error.
*
+ * Since: 2.10.0
**/
-int gnutls_hmac_get_len( gnutls_mac_algorithm_t algorithm)
+int
+gnutls_hmac_get_len (gnutls_mac_algorithm_t algorithm)
{
- return _gnutls_hmac_get_algo_len(algorithm);
+ return _gnutls_hmac_get_algo_len (algorithm);
}
/**
* on a single call.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
-int gnutls_hmac_fast (gnutls_mac_algorithm_t algorithm,
- const void* key, int keylen,
- const void* text, size_t textlen, void* digest)
+int
+gnutls_hmac_fast (gnutls_mac_algorithm_t algorithm,
+ const void *key, int keylen,
+ const void *text, size_t textlen, void *digest)
{
- return _gnutls_hmac_fast(algorithm, key, keylen, text, textlen, digest);
+ return _gnutls_hmac_fast (algorithm, key, keylen, text, textlen, digest);
}
/* HASH */
* accelerator in use.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
-int gnutls_hash_init (gnutls_hash_hd_t * dig,
- gnutls_digest_algorithm_t algorithm)
+int
+gnutls_hash_init (gnutls_hash_hd_t * dig, gnutls_digest_algorithm_t algorithm)
{
- *dig = gnutls_malloc(sizeof(digest_hd_st));
- if (*dig == NULL) {
- gnutls_assert();
- return GNUTLS_E_MEMORY_ERROR;
- }
+ *dig = gnutls_malloc (sizeof (digest_hd_st));
+ if (*dig == NULL)
+ {
+ gnutls_assert ();
+ return GNUTLS_E_MEMORY_ERROR;
+ }
- return _gnutls_hash_init(((digest_hd_st*)*dig), algorithm);
+ return _gnutls_hash_init (((digest_hd_st *) * dig), algorithm);
}
/**
* specified by the context.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
-int gnutls_hash (gnutls_hash_hd_t handle, const void *text, size_t textlen)
+int
+gnutls_hash (gnutls_hash_hd_t handle, const void *text, size_t textlen)
{
- return _gnutls_hash((digest_hd_st*)handle, text, textlen);
+ return _gnutls_hash ((digest_hd_st *) handle, text, textlen);
}
/**
* @digest: is the output value of the hash
*
* This function will output the current hash value.
+ *
+ * Since: 2.10.0
**/
-void gnutls_hash_output (gnutls_hash_hd_t handle, void *digest)
+void
+gnutls_hash_output (gnutls_hash_hd_t handle, void *digest)
{
- return _gnutls_hash_output((digest_hd_st*)handle, digest);
+ return _gnutls_hash_output ((digest_hd_st *) handle, digest);
}
/**
*
* This function will deinitialize all resources occupied by
* the given hash context.
+ *
+ * Since: 2.10.0
**/
void
gnutls_hash_deinit (gnutls_hash_hd_t handle, void *digest)
{
- _gnutls_hash_deinit((digest_hd_st*)handle, digest);
+ _gnutls_hash_deinit ((digest_hd_st *) handle, digest);
}
/**
*
* Returns: The length or zero on error.
*
+ * Since: 2.10.0
**/
-int gnutls_hash_get_len( gnutls_digest_algorithm_t algorithm)
+int
+gnutls_hash_get_len (gnutls_digest_algorithm_t algorithm)
{
- return _gnutls_hash_get_algo_len(algorithm);
+ return _gnutls_hash_get_algo_len (algorithm);
}
/**
* on a single call.
*
* Returns: Zero or a negative value on error.
+ *
+ * Since: 2.10.0
**/
-int gnutls_hash_fast (gnutls_digest_algorithm_t algorithm,
- const void *text, size_t textlen, void *digest)
+int
+gnutls_hash_fast (gnutls_digest_algorithm_t algorithm,
+ const void *text, size_t textlen, void *digest)
{
- return _gnutls_hash_fast(algorithm, text, textlen, digest);
+ return _gnutls_hash_fast (algorithm, text, textlen, digest);
}