diff options
author | irungentoo <irungentoo@gmail.com> | 2015-02-14 23:00:12 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2015-02-14 23:00:12 -0500 |
commit | 3c7888d7523f876740084c7315e31f973920212b (patch) | |
tree | b00246db826e52ae20ba5542fe96b6dd56512a18 /toxencryptsave/toxencryptsave.c | |
parent | eac0d435f35db468435fa596a3b00b593d6bf3e9 (diff) |
A bit of new api work done.
Diffstat (limited to 'toxencryptsave/toxencryptsave.c')
-rw-r--r-- | toxencryptsave/toxencryptsave.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/toxencryptsave/toxencryptsave.c b/toxencryptsave/toxencryptsave.c index 9172f512..13a34dea 100644 --- a/toxencryptsave/toxencryptsave.c +++ b/toxencryptsave/toxencryptsave.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #include "toxencryptsave.h" | 28 | #include "toxencryptsave.h" |
29 | #include "defines.h" | ||
29 | #include "../toxcore/crypto_core.h" | 30 | #include "../toxcore/crypto_core.h" |
30 | #include "../toxcore/tox.h" | 31 | #include "../toxcore/tox.h" |
31 | 32 | ||
@@ -64,7 +65,7 @@ int tox_pass_salt_length() | |||
64 | /* return size of the messenger data (for encrypted saving). */ | 65 | /* return size of the messenger data (for encrypted saving). */ |
65 | uint32_t tox_encrypted_size(const Tox *tox) | 66 | uint32_t tox_encrypted_size(const Tox *tox) |
66 | { | 67 | { |
67 | return tox_size(tox) + TOX_PASS_ENCRYPTION_EXTRA_LENGTH; | 68 | return tox_save_size(tox) + TOX_PASS_ENCRYPTION_EXTRA_LENGTH; |
68 | } | 69 | } |
69 | 70 | ||
70 | /* This retrieves the salt used to encrypt the given data, which can then be passed to | 71 | /* This retrieves the salt used to encrypt the given data, which can then be passed to |
@@ -203,7 +204,7 @@ int tox_pass_encrypt(const uint8_t *data, uint32_t data_len, uint8_t *passphrase | |||
203 | int tox_encrypted_save(const Tox *tox, uint8_t *data, uint8_t *passphrase, uint32_t pplength) | 204 | int tox_encrypted_save(const Tox *tox, uint8_t *data, uint8_t *passphrase, uint32_t pplength) |
204 | { | 205 | { |
205 | /* first get plain save data */ | 206 | /* first get plain save data */ |
206 | uint32_t temp_size = tox_size(tox); | 207 | uint32_t temp_size = tox_save_size(tox); |
207 | uint8_t temp_data[temp_size]; | 208 | uint8_t temp_data[temp_size]; |
208 | tox_save(tox, temp_data); | 209 | tox_save(tox, temp_data); |
209 | 210 | ||
@@ -220,7 +221,7 @@ int tox_encrypted_save(const Tox *tox, uint8_t *data, uint8_t *passphrase, uint3 | |||
220 | int tox_encrypted_key_save(const Tox *tox, uint8_t *data, uint8_t *key) | 221 | int tox_encrypted_key_save(const Tox *tox, uint8_t *data, uint8_t *key) |
221 | { | 222 | { |
222 | /* first get plain save data */ | 223 | /* first get plain save data */ |
223 | uint32_t temp_size = tox_size(tox); | 224 | uint32_t temp_size = tox_save_size(tox); |
224 | uint8_t temp_data[temp_size]; | 225 | uint8_t temp_data[temp_size]; |
225 | tox_save(tox, temp_data); | 226 | tox_save(tox, temp_data); |
226 | 227 | ||