ciphertextlen);
}
+/**
+ * gnutls_cipher_encrypt2:
+ * @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 value on error.
+ *
+ * Since: 2.10.0
+ **/
+int
+gnutls_cipher_encrypt2 (gnutls_cipher_hd_t handle, void *text, size_t textlen,
+ void* ciphertext, size_t ciphertextlen)
+{
+ return _gnutls_cipher_encrypt2 ((cipher_hd_st *) handle, text, textlen,
+ ciphertext, ciphertextlen);
+}
+
+/**
+ * gnutls_cipher_decrypt2:
+ * @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 value on error.
+ *
+ * Since: 2.10.0
+ **/
+int
+gnutls_cipher_decrypt2 (gnutls_cipher_hd_t handle, const void *ciphertext,
+ size_t ciphertextlen, void* text, size_t textlen)
+{
+ return _gnutls_cipher_decrypt2 ((cipher_hd_st *) handle, ciphertext,
+ ciphertextlen, text, textlen);
+}
+
/**
* gnutls_cipher_deinit:
* @handle: is a #gnutls_cipher_hd_t structure.
return 0;
}
+int _gnutls_cipher_encrypt2 (const cipher_hd_st * handle, const void *text, int textlen,
+ void* ciphertext, int ciphertextlen)
+{
+ if (handle != NULL && handle->handle != NULL)
+ {
+ return handle->encrypt(handle->handle, text, textlen, ciphertext, ciphertextlen);
+ }
+ return 0;
+}
+
+int _gnutls_cipher_decrypt2 (const cipher_hd_st * handle, const void *ciphertext,
+ int ciphertextlen, void* text, int textlen)
+{
+ if (handle != NULL && handle->handle != NULL)
+ {
+ return handle->decrypt(handle->handle, ciphertext, ciphertextlen,
+ text, textlen);
+ }
+ return 0;
+}
+
void _gnutls_cipher_deinit (cipher_hd_st * handle)
{
if (handle != NULL && handle->handle != NULL)
int textlen);
int _gnutls_cipher_decrypt (const cipher_hd_st * handle, void *ciphertext,
int ciphertextlen);
+int _gnutls_cipher_encrypt2 (const cipher_hd_st * handle, const void *text,
+ int textlen, void* ciphertext, int ciphertextlen);
+int _gnutls_cipher_decrypt2 (const cipher_hd_st * handle, const void *ciphertext,
+ int ciphertextlen, void* text, int textlen);
void _gnutls_cipher_deinit (cipher_hd_st * handle);
#endif /* GNUTLS_CIPHER_INT */
void *text, size_t textlen);
int gnutls_cipher_decrypt (const gnutls_cipher_hd_t handle,
void *ciphertext, size_t ciphertextlen);
+int gnutls_cipher_decrypt2 (gnutls_cipher_hd_t handle, const void *ciphertext,
+ size_t ciphertextlen, void* text, size_t textlen);
+int gnutls_cipher_encrypt2 (gnutls_cipher_hd_t handle, void *text, size_t textlen,
+ void* ciphertext, size_t ciphertextlen);
+
void gnutls_cipher_deinit (gnutls_cipher_hd_t handle);
int gnutls_cipher_get_block_size (gnutls_cipher_algorithm_t algorithm);
gnutls_pk_bits_to_sec_param;
gnutls_rnd;
gnutls_x509_crq_get_preferred_hash_algorithm;
+ gnutls_cipher_encrypt2;
+ gnutls_cipher_decrypt2;
} GNUTLS_2_10;
GNUTLS_PRIVATE {