Skip to main content

ffi_decrypt_data

Function ffi_decrypt_data 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn ffi_decrypt_data( passphrase: *const c_char, input_ptr: *const u8, input_len: usize, out_len: *mut usize, ) -> *mut u8
Expand description

Decrypts data using the given passphrase.

§Safety

  • passphrase must be a valid null-terminated C string
  • input_ptr must point to valid memory of at least input_len bytes
  • out_len must be a valid pointer to write the output length

§Returns

  • Non-null pointer to decrypted bytes on success
  • NULL on error (invalid input, incorrect passphrase, or panic)