



@deftypefun {int} {gnutls_cipher_encrypt3} (gnutls_cipher_hd_t @var{handle}, const void * @var{ptext}, size_t @var{ptext_len}, void * @var{ctext}, size_t * @var{ctext_len}, unsigned @var{flags})
@var{handle}: is a @code{gnutls_cipher_hd_t}  type

@var{ptext}: the data to encrypt

@var{ptext_len}: the length of data to encrypt

@var{ctext}: the encrypted data

@var{ctext_len}: the length of encrypted data (initially must hold the maximum available size)

@var{flags}: flags for padding

This function will encrypt the given data using the algorithm
specified by the context. For block ciphers,  @code{ptext_len} is
typically a multiple of the block size. If not, the caller can
instruct the function to pad the last block according to  @code{flags} .
Currently, the only available padding scheme is
@code{GNUTLS_CIPHER_PADDING_PKCS7} .

If  @code{ctext} is not @code{NULL} , it must hold enough space to store
resulting cipher text. To check the required size, this function
can be called with  @code{ctext} set to @code{NULL} . Then  @code{ctext_len} will be
updated without performing actual encryption.

@strong{Returns:} Zero or a negative error code on error.

@strong{Since:} 3.7.7
@end deftypefun
