summaryrefslogtreecommitdiff
path: root/toxencryptsave/toxencryptsave.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-10-17 16:06:00 -0400
committerirungentoo <irungentoo@gmail.com>2014-10-17 16:06:00 -0400
commit0fb3062f08b99cfbc3871ca1365d1b6a5b737d68 (patch)
tree4baf63c53117f8dae5a2017e3400c4a001867a94 /toxencryptsave/toxencryptsave.h
parent418bb2b19430866b3e1f44036907ae9d119e1d62 (diff)
parentff1d4faa744138946d12f98d21fcc10f33db10bd (diff)
Merge branch 'master' of https://github.com/dubslow/toxcore
Diffstat (limited to 'toxencryptsave/toxencryptsave.h')
-rw-r--r--toxencryptsave/toxencryptsave.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/toxencryptsave/toxencryptsave.h b/toxencryptsave/toxencryptsave.h
index b00570e0..14334ea7 100644
--- a/toxencryptsave/toxencryptsave.h
+++ b/toxencryptsave/toxencryptsave.h
@@ -95,6 +95,14 @@ int tox_pass_encrypt(const uint8_t *data, uint32_t data_len, uint8_t *passphrase
95 */ 95 */
96int tox_encrypted_save(const Tox *tox, uint8_t *data, uint8_t *passphrase, uint32_t pplength); 96int tox_encrypted_save(const Tox *tox, uint8_t *data, uint8_t *passphrase, uint32_t pplength);
97 97
98/* Save the messenger data encrypted with the given key from tox_derive_key.
99 * data must be at least tox_encrypted_size().
100 *
101 * returns 0 on success
102 * returns -1 on failure
103 */
104int tox_encrypted_key_save(const Tox *tox, uint8_t *data, uint8_t *key);
105
98/* This is the inverse of tox_pass_key_encrypt, also using only keys produced by 106/* This is the inverse of tox_pass_key_encrypt, also using only keys produced by
99 * tox_derive_key_from_pass. 107 * tox_derive_key_from_pass.
100 * 108 *
@@ -121,6 +129,13 @@ int tox_pass_decrypt(const uint8_t *data, uint32_t length, uint8_t *passphrase,
121 */ 129 */
122int tox_encrypted_load(Tox *tox, const uint8_t *data, uint32_t length, uint8_t *passphrase, uint32_t pplength); 130int tox_encrypted_load(Tox *tox, const uint8_t *data, uint32_t length, uint8_t *passphrase, uint32_t pplength);
123 131
132/* Load the messenger from encrypted data of size length, with key from tox_derive_key.
133 *
134 * returns 0 on success
135 * returns -1 on failure
136 */
137int tox_encrypted_key_load(Tox *tox, const uint8_t *data, uint32_t length, uint8_t *key);
138
124/* Determines whether or not the given data is encrypted (by checking the magic number) 139/* Determines whether or not the given data is encrypted (by checking the magic number)
125 * 140 *
126 * returns 1 if it is encrypted 141 * returns 1 if it is encrypted