libsignal-protocol-c  master
group_cipher.h
1 #ifndef GROUP_CIPHER_H
2 #define GROUP_CIPHER_H
3 
4 #include <stdint.h>
5 #include <stddef.h>
6 #include "signal_protocol_types.h"
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 /*
13  * The main entry point for Signal Protocol group encrypt/decrypt operations.
14  *
15  * Once a session has been established with group_session_builder and a
16  * sender_key_distribution_message has been distributed to each member of
17  * the group, this class can be used for all subsequent encrypt/decrypt
18  * operations within that session (i.e. until group membership changes).
19  */
20 
35 int group_cipher_create(group_cipher **cipher,
37  signal_context *global_context);
38 
45 void group_cipher_set_user_data(group_cipher *cipher, void *user_data);
46 
53 void *group_cipher_get_user_data(group_cipher *cipher);
54 
71 void group_cipher_set_decryption_callback(group_cipher *cipher,
72  int (*callback)(group_cipher *cipher, signal_buffer *plaintext, void *decrypt_context));
73 
85 int group_cipher_encrypt(group_cipher *cipher,
86  const uint8_t *padded_plaintext, size_t padded_plaintext_len,
87  ciphertext_message **encrypted_message);
88 
104 int group_cipher_decrypt(group_cipher *cipher,
105  sender_key_message *ciphertext, void *decrypt_context,
106  signal_buffer **plaintext);
107 
108 void group_cipher_free(group_cipher *cipher);
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #endif /* GROUP_CIPHER_H */
Definition: signal_protocol.c:25
Definition: protocol.c:44
Definition: signal_protocol_types.h:48
Definition: signal_protocol_internal.h:23
Definition: signal_protocol_internal.h:18
Definition: protocol.c:13
Definition: group_cipher.c:11