Type Alias encryption_func

Source
pub type encryption_func = Option<unsafe extern "C" fn(arg1: *const c_char, arg2: usize, arg3: *mut c_char, arg4: *mut usize)>;
Expand description

@brief encryption_func is a function pointer that encrypt or decrypt the input memory, example of this function is codec(const char* input, const size_t in_size, const char* output, size_t* out_size) This function needs to be called twice, the first call to obtain out_size (the size of output buffer), the second call to obtain output buffer. The first call output is nullptr, before the second call, the caller needs to apply for output memory based on the out_size returned by the first call. the memory of parameter output is allocated and released by the caller. @param input The pointer to the input buffer. @param in_size The size of input. @param output The pointer to the encrypted/decrypted buffer. @param out_size The size of output.

Aliased Type§

pub enum encryption_func {
    None,
    Some(unsafe extern "C" fn(*const i8, usize, *mut i8, *mut usize)),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(*const i8, usize, *mut i8, *mut usize))

Some value of type T.