summaryrefslogtreecommitdiff
path: root/toxcore/Messenger.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/Messenger.h')
-rw-r--r--toxcore/Messenger.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/toxcore/Messenger.h b/toxcore/Messenger.h
index 61d7f86c..3cfd5065 100644
--- a/toxcore/Messenger.h
+++ b/toxcore/Messenger.h
@@ -652,6 +652,24 @@ void messenger_save(Messenger *m, uint8_t *data);
652/* Load the messenger from data of size length. */ 652/* Load the messenger from data of size length. */
653int messenger_load(Messenger *m, uint8_t *data, uint32_t length); 653int messenger_load(Messenger *m, uint8_t *data, uint32_t length);
654 654
655/* return the size of data to pass to messenger_save_encrypted(...)
656 */
657uint32_t messenger_size_encrypted(Messenger *m);
658
659/* Save the messenger, encrypting the data with key of length key_length
660 *
661 * return 0 on success.
662 * return -1 on failure.
663 */
664int messenger_save_encrypted(Messenger *m, uint8_t *data, uint8_t *key, uint16_t key_length);
665
666/* Load the messenger from data of size length encrypted with key of key_length.
667 *
668 * return 0 on success.
669 * return -1 on failure.
670 */
671int messenger_load_encrypted(Messenger *m, uint8_t *data, uint32_t length, uint8_t *key, uint16_t key_length);
672
655/* Return the number of friends in the instance m. 673/* Return the number of friends in the instance m.
656 * You should use this to determine how much memory to allocate 674 * You should use this to determine how much memory to allocate
657 * for copy_friendlist. */ 675 * for copy_friendlist. */