Function olm_sys::olm_encrypt[][src]

pub unsafe extern "C" fn olm_encrypt(
    session: *mut OlmSession,
    plaintext: *const c_void,
    plaintext_length: usize,
    random: *mut c_void,
    random_length: usize,
    message: *mut c_void,
    message_length: usize
) -> usize

Encrypts a message using the session. Returns the length of the message in bytes on success. Writes the message as base64 into the message buffer. Returns olm_error() on failure. If the message buffer is too small then olm_session_last_error() will be "OUTPUT_BUFFER_TOO_SMALL". If there weren't enough random bytes then olm_session_last_error() will be "NOT_ENOUGH_RANDOM".