Function olm_sys::olm_group_decrypt[][src]

pub unsafe extern "C" fn olm_group_decrypt(
    session: *mut OlmInboundGroupSession,
    message: *mut u8,
    message_length: usize,
    plaintext: *mut u8,
    max_plaintext_length: usize,
    message_index: *mut u32
) -> usize

Decrypt a message.

The input message buffer is destroyed.

Returns the length of the decrypted plain-text, or olm_error() on failure.

On failure last_error will be set with an error code. The last_error will be:

  • OLM_OUTPUT_BUFFER_TOO_SMALL if the plain-text buffer is too small
  • OLM_INVALID_BASE64 if the message is not valid base-64
  • OLM_BAD_MESSAGE_VERSION if the message was encrypted with an unsupported version of the protocol
  • OLM_BAD_MESSAGE_FORMAT if the message headers could not be decoded
  • OLM_BAD_MESSAGE_MAC if the message could not be verified
  • OLM_UNKNOWN_MESSAGE_INDEX if we do not have a session key corresponding to the message’s index (ie, it was sent before the session key was shared with us)