summaryrefslogtreecommitdiff
path: root/toxencryptsave/toxencryptsave.h
diff options
context:
space:
mode:
authordubslow <bunslow@gmail.com>2014-10-17 06:02:15 -0500
committerdubslow <bunslow@gmail.com>2014-10-17 06:02:15 -0500
commitffb13e4716e002c0e532afec6723d90ded72d451 (patch)
tree3735f4feab020d6bdd5e017a396aa0e5945a07e9 /toxencryptsave/toxencryptsave.h
parent6114bd7f3ef1fda71e45e81f259074cf4f8e58eb (diff)
add load/save from key instead of pw
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 d805cf97..ddfce485 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