group_cipher_set_decryption_callback

Function group_cipher_set_decryption_callback 

Source
pub unsafe extern "C" fn group_cipher_set_decryption_callback(
    cipher: *mut group_cipher,
    callback: Option<unsafe extern "C" fn(cipher: *mut group_cipher, plaintext: *mut signal_buffer, decrypt_context: *mut c_void) -> c_int>,
)
Expand description

Set the callback function that is called during the decrypt process.

The callback function is called from within group_cipher_decrypt() after decryption is complete but before the updated session state has been committed to the session store. If the callback function returns a negative value, then the decrypt function will immediately fail with an error.

This a callback allows some implementations to store the committed plaintext to their local message store first, in case they are concerned with a crash or write error happening between the time the session state is updated but before they’re able to successfully store the plaintext to disk.

@param callback the callback function to set