blob: fc3a45cfb12c5e26ad365eb6fdc440a912996fb2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
@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
|