EVP_EncryptFinal_ex2 function

  1. @RecordUse.new()
  2. @Native<Int Function(Pointer<EVP_CIPHER_CTX>, Pointer<Uint8>, Pointer<Size>, Size)>(ffi.Pointer<EVP_CIPHER_CTX>, ffi.Pointer<ffi.Uint8>, ffi.Pointer<ffi.Size>, ffi.Size)>(symbol: 'bssl_dart_EVP_EncryptFinal_ex2')
int EVP_EncryptFinal_ex2(
  1. Pointer<EVP_CIPHER_CTX> ctx,
  2. Pointer<Uint8> out,
  3. Pointer<Size> out_len,
  4. int max_out_len,
)

EVP_EncryptFinal_ex2 finishes an encryption operation and writes up to |max_out| bytes of output to out. On success, it sets |*out_len| to the number of bytes written 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.

If the block size is 1, there will be no final output at all; otherwise, at most one block of ciphertext will be written to the output.

If padding is enabled (the default) and the block size is not 1, then standard padding is applied to create the final block. If padding is disabled (with |EVP_CIPHER_CTX_set_padding|) then any partial block remaining will cause an error. The function returns one on success and zero otherwise.

Implementation

@meta.RecordUse()
@ffi.Native<
  ffi.Int Function(
    ffi.Pointer<EVP_CIPHER_CTX>,
    ffi.Pointer<ffi.Uint8>,
    ffi.Pointer<ffi.Size>,
    ffi.Size,
  )
>(symbol: 'bssl_dart_EVP_EncryptFinal_ex2')
external int EVP_EncryptFinal_ex2(
  ffi.Pointer<EVP_CIPHER_CTX> ctx,
  ffi.Pointer<ffi.Uint8> out,
  ffi.Pointer<ffi.Size> out_len,
  int max_out_len,
);