Function olm_sys::olm_decrypt[][src]

pub unsafe extern "C" fn olm_decrypt(
    session: *mut OlmSession,
    message_type: usize,
    message: *mut c_void,
    message_length: usize,
    plaintext: *mut c_void,
    max_plaintext_length: usize
) -> usize

Decrypts a message using the session. The input message buffer is destroyed. Returns the length of the plain-text on success. Returns olm_error() on failure. If the plain-text buffer is smaller than olm_decrypt_max_plaintext_length() then olm_session_last_error() will be "OUTPUT_BUFFER_TOO_SMALL". If the base64 couldn't be decoded then olm_session_last_error() will be "INVALID_BASE64". If the message is for an unsupported version of the protocol then olm_session_last_error() will be "BAD_MESSAGE_VERSION". If the message couldn't be decoded then olm_session_last_error() will be BAD_MESSAGE_FORMAT". If the MAC on the message was invalid then olm_session_last_error() will be "BAD_MESSAGE_MAC".