EVP_EncryptUpdate_ex function
EVP_EncryptUpdate_ex encrypts |in_len| bytes from |in| and writes up to |max_out| bytes of ciphertext to |out|. On success, it sets |*out_len| to the number of output bytes and returns one. Otherwise, it returns zero.
If |max_out| is not large enough for the output, the function will return zero. The size of output buffer needed depends on the cipher and the number of bytes encrypted by |ctx| thus far.
In ciphers whose block size is not 1, such as CBC, individual calls to |EVP_EncryptUpdate_ex| may output more or less than |in_len| bytes: a single call to |EVP_EncryptUpdate_ex| may output at most |in_len + block_size - 1| bytes. Additionally, the total output across all |EVP_EncryptUpdate_ex| and |EVP_EncryptFinal_ex2| calls will be at most the total input plus one byte, rounded up to a multiple of the block size.
Implementation
@meta.RecordUse()
@ffi.Native<
ffi.Int Function(
ffi.Pointer<EVP_CIPHER_CTX>,
ffi.Pointer<ffi.Uint8>,
ffi.Pointer<ffi.Size>,
ffi.Size,
ffi.Pointer<ffi.Uint8>,
ffi.Size,
)
>(symbol: 'bssl_dart_EVP_EncryptUpdate_ex')
external int EVP_EncryptUpdate_ex(
ffi.Pointer<EVP_CIPHER_CTX> ctx,
ffi.Pointer<ffi.Uint8> out,
ffi.Pointer<ffi.Size> out_len,
int max_out_len,
ffi.Pointer<ffi.Uint8> in$,
int in_len,
);