[][src]Function devolutions_crypto::ffi::Decrypt

#[no_mangle]
pub unsafe extern "C" fn Decrypt(
    data: *const u8,
    data_length: usize,
    key: *const u8,
    key_length: usize,
    result: *mut u8,
    result_length: usize
) -> i64

Decrypt a data blob

Arguments

  • data - Pointer to the data to decrypt.
  • data_length - Length of the data to decrypt.
  • key - Pointer to the key to use to decrypt.
  • key_length - Length of the key to use to decrypt.
  • result - Pointer to the buffer to write the plaintext to.
  • result_length - Length of the buffer to write the plaintext to. The safest size is the same size as the ciphertext.

Returns

This returns the length of the plaintext. If there is an error, it will return the appropriate error code defined in DevoCryptoError.