session_cipher_create

Function session_cipher_create 

Source
pub unsafe extern "C" fn session_cipher_create(
    cipher: *mut *mut session_cipher,
    store: *mut signal_protocol_store_context,
    remote_address: *const signal_protocol_address,
    global_context: *mut signal_context,
) -> c_int
Expand description

Construct a session cipher for encrypt/decrypt operations on a session. In order to use session_cipher, a session must have already been created and stored using session_builder.

The store and global contexts must remain valid for the lifetime of the session cipher.

When finished, free the returned instance by calling session_cipher_free().

@param cipher set to a freshly allocated session cipher instance @param store the signal_protocol_store_context to store all state information in @param remote_address the remote address that messages will be encrypted to or decrypted from. @param global_context the global library context @return 0 on success, or negative on failure