diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2017-02-13 07:56:33 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2017-02-13 09:09:08 +0300 |
commit | 193f645f65ad4ffdec3186e4176b23af10861199 (patch) | |
tree | e1b16b48ac74c5f03f99a98798e849f6dd9752cc /libs/libaxolotl/src/session_cipher.h | |
parent | 36c32a13878d3bd94e88bd9c764f1eadb05ea1ed (diff) |
libs:
libaxolotl:
updated libaxolotl (libsignal-c) from (https://github.com/WhisperSystems/libsignal-protocol-c)
Diffstat (limited to 'libs/libaxolotl/src/session_cipher.h')
-rw-r--r-- | libs/libaxolotl/src/session_cipher.h | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/libs/libaxolotl/src/session_cipher.h b/libs/libaxolotl/src/session_cipher.h index 9e4e61b6cf..0c1cd47f89 100644 --- a/libs/libaxolotl/src/session_cipher.h +++ b/libs/libaxolotl/src/session_cipher.h @@ -3,14 +3,14 @@ #include <stdint.h> #include <stddef.h> -#include "axolotl_types.h" +#include "signal_protocol_types.h" #ifdef __cplusplus extern "C" { #endif /** - * The main entry point for Axolotl encrypt/decrypt operations. + * The main entry point for Signal Protocol encrypt/decrypt operations. * * Once a session has been established with session_builder, * this class can be used for all encrypt/decrypt operations within @@ -28,14 +28,14 @@ extern "C" { * When finished, free the returned instance by calling session_cipher_free(). * * @param cipher set to a freshly allocated session cipher instance - * @param store the axolotl_store_context to store all state information in + * @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 */ int session_cipher_create(session_cipher **cipher, - axolotl_store_context *store, const axolotl_address *remote_address, - axolotl_context *global_context); + signal_protocol_store_context *store, const signal_protocol_address *remote_address, + signal_context *global_context); /** * Set the optional user data pointer for the session cipher. @@ -57,8 +57,8 @@ void *session_cipher_get_user_data(session_cipher *cipher); * Set the callback function that is called during the decrypt process. * * The callback function is called from within - * session_cipher_decrypt_pre_key_whisper_message() and - * session_cipher_decrypt_whisper_message() after decryption is complete + * session_cipher_decrypt_pre_key_signal_message() and + * session_cipher_decrypt_signal_message() 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. @@ -72,7 +72,7 @@ void *session_cipher_get_user_data(session_cipher *cipher); * @param user_data user data pointer provided to the callback */ void session_cipher_set_decryption_callback(session_cipher *cipher, - int (*callback)(session_cipher *cipher, axolotl_buffer *plaintext, void *decrypt_context)); + int (*callback)(session_cipher *cipher, signal_buffer *plaintext, void *decrypt_context)); /** * Encrypt a message. @@ -81,7 +81,7 @@ void session_cipher_set_decryption_callback(session_cipher *cipher, * @param padded_message_len The length of the data pointed to by padded_message * @param encrypted_message Set to a ciphertext message encrypted to the recipient+device tuple. * - * @return AX_SUCCESS on success, negative on error + * @return SG_SUCCESS on success, negative on error */ int session_cipher_encrypt(session_cipher *cipher, const uint8_t *padded_message, size_t padded_message_len, @@ -90,50 +90,50 @@ int session_cipher_encrypt(session_cipher *cipher, /** * Decrypt a message. * - * @param ciphertext The pre_key_whisper_message to decrypt. + * @param ciphertext The pre_key_signal_message to decrypt. * @param decrypt_context Optional context pointer associated with the * ciphertext, which is passed to the decryption callback function * @param plaintext Set to a newly allocated buffer containing the plaintext. * - * @retval AX_SUCCESS Success - * @retval AX_ERR_INVALID_MESSAGE if the input is not valid ciphertext. - * @retval AX_ERR_DUPLICATE_MESSAGE if the input is a message that has already been received. - * @retval AX_ERR_LEGACY_MESSAGE if the input is a message formatted by a protocol version that + * @retval SG_SUCCESS Success + * @retval SG_ERR_INVALID_MESSAGE if the input is not valid ciphertext. + * @retval SG_ERR_DUPLICATE_MESSAGE if the input is a message that has already been received. + * @retval SG_ERR_LEGACY_MESSAGE if the input is a message formatted by a protocol version that * is no longer supported. - * @retval AX_ERR_INVALID_KEY_ID when there is no local pre_key_record + * @retval SG_ERR_INVALID_KEY_ID when there is no local pre_key_record * that corresponds to the pre key ID in the message. - * @retval AX_ERR_INVALID_KEY when the message is formatted incorrectly. - * @retval AX_ERR_UNTRUSTED_IDENTITY when the identity key of the sender is untrusted. + * @retval SG_ERR_INVALID_KEY when the message is formatted incorrectly. + * @retval SG_ERR_UNTRUSTED_IDENTITY when the identity key of the sender is untrusted. */ -int session_cipher_decrypt_pre_key_whisper_message(session_cipher *cipher, - pre_key_whisper_message *ciphertext, void *decrypt_context, - axolotl_buffer **plaintext); +int session_cipher_decrypt_pre_key_signal_message(session_cipher *cipher, + pre_key_signal_message *ciphertext, void *decrypt_context, + signal_buffer **plaintext); /** * Decrypt a message. * - * @param ciphertext The whisper_message to decrypt. + * @param ciphertext The signal_message to decrypt. * @param decrypt_context Optional context pointer associated with the * ciphertext, which is passed to the decryption callback function * @param plaintext Set to a newly allocated buffer containing the plaintext. * - * @retval AX_SUCCESS Success - * @retval AX_ERR_INVALID_MESSAGE if the input is not valid ciphertext. - * @retval AX_ERR_DUPLICATE_MESSAGE if the input is a message that has already been received. - * @retval AX_ERR_LEGACY_MESSAGE if the input is a message formatted by a protocol version that + * @retval SG_SUCCESS Success + * @retval SG_ERR_INVALID_MESSAGE if the input is not valid ciphertext. + * @retval SG_ERR_DUPLICATE_MESSAGE if the input is a message that has already been received. + * @retval SG_ERR_LEGACY_MESSAGE if the input is a message formatted by a protocol version that * is no longer supported. - * @retval AX_ERR_NO_SESSION if there is no established session for this contact. + * @retval SG_ERR_NO_SESSION if there is no established session for this contact. */ -int session_cipher_decrypt_whisper_message(session_cipher *cipher, - whisper_message *ciphertext, void *decrypt_context, - axolotl_buffer **plaintext); +int session_cipher_decrypt_signal_message(session_cipher *cipher, + signal_message *ciphertext, void *decrypt_context, + signal_buffer **plaintext); /** * Gets the remote registration ID for this session cipher. * * @param remote_id Set to the value of the remote registration ID * - * @return AX_SUCCESS on success, negative on error + * @return SG_SUCCESS on success, negative on error */ int session_cipher_get_remote_registration_id(session_cipher *cipher, uint32_t *remote_id); @@ -142,8 +142,8 @@ int session_cipher_get_remote_registration_id(session_cipher *cipher, uint32_t * * * @param version Set to the value of the session version * - * @retval AX_SUCCESS Success - * @retval AX_ERR_NO_SESSION if no session could be found + * @retval SG_SUCCESS Success + * @retval SG_ERR_NO_SESSION if no session could be found */ int session_cipher_get_session_version(session_cipher *cipher, uint32_t *version); |