[−][src]Function devolutions_crypto::ffi::Encrypt
#[no_mangle] pub unsafe extern "C" fn Encrypt(
data: *const u8,
data_length: usize,
key: *const u8,
key_length: usize,
result: *mut u8,
result_length: usize,
version: u16
) -> i64
Encrypt a data blob
Arguments
data
- Pointer to the data to encrypt.data_length
- Length of the data to encrypt.key
- Pointer to the key to use to encrypt.key_length
- Length of the key to use to encrypt.result
- Pointer to the buffer to write the ciphertext to.result_length
- Length of the buffer to write the ciphertext to. You can get the value by calling EncryptSize() beforehand.version
- Version to use. Use 0 for the latest one.
Returns
This returns the length of the ciphertext. If there is an error, it will return the appropriate error code defined in DevoCryptoError.