diff options
Diffstat (limited to 'toxencryptsave/toxencryptsave.c')
-rw-r--r-- | toxencryptsave/toxencryptsave.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/toxencryptsave/toxencryptsave.c b/toxencryptsave/toxencryptsave.c index d1926246..6567eb96 100644 --- a/toxencryptsave/toxencryptsave.c +++ b/toxencryptsave/toxencryptsave.c | |||
@@ -40,9 +40,15 @@ | |||
40 | 40 | ||
41 | #define TOX_PASS_KEY_LENGTH (crypto_box_KEYBYTES + crypto_pwhash_scryptsalsa208sha256_SALTBYTES) | 41 | #define TOX_PASS_KEY_LENGTH (crypto_box_KEYBYTES + crypto_pwhash_scryptsalsa208sha256_SALTBYTES) |
42 | 42 | ||
43 | int tox_pass_encryption_extra_length() {return TOX_PASS_ENCRYPTION_EXTRA_LENGTH;} | 43 | int tox_pass_encryption_extra_length() |
44 | { | ||
45 | return TOX_PASS_ENCRYPTION_EXTRA_LENGTH; | ||
46 | } | ||
44 | 47 | ||
45 | int tox_pass_key_length() {return TOX_PASS_KEY_LENGTH;} | 48 | int tox_pass_key_length() |
49 | { | ||
50 | return TOX_PASS_KEY_LENGTH; | ||
51 | } | ||
46 | 52 | ||
47 | /* This "module" provides functions analogous to tox_load and tox_save in toxcore | 53 | /* This "module" provides functions analogous to tox_load and tox_save in toxcore |
48 | * Clients should consider alerting their users that, unlike plain data, if even one bit | 54 | * Clients should consider alerting their users that, unlike plain data, if even one bit |
@@ -181,7 +187,7 @@ int tox_encrypted_save(const Tox *tox, uint8_t *data, uint8_t *passphrase, uint3 | |||
181 | * returns 0 on success | 187 | * returns 0 on success |
182 | * returns -1 on failure | 188 | * returns -1 on failure |
183 | */ | 189 | */ |
184 | int tox_encrypted_key_save(const Tox* tox, uint8_t* data, uint8_t* key) | 190 | int tox_encrypted_key_save(const Tox *tox, uint8_t *data, uint8_t *key) |
185 | { | 191 | { |
186 | /* first get plain save data */ | 192 | /* first get plain save data */ |
187 | uint32_t temp_size = tox_size(tox); | 193 | uint32_t temp_size = tox_size(tox); |
@@ -287,7 +293,7 @@ int tox_encrypted_load(Tox *tox, const uint8_t *data, uint32_t length, uint8_t * | |||
287 | * returns 0 on success | 293 | * returns 0 on success |
288 | * returns -1 on failure | 294 | * returns -1 on failure |
289 | */ | 295 | */ |
290 | int tox_encrypted_key_load(Tox *tox, const uint8_t *data, uint32_t length, uint8_t* key) | 296 | int tox_encrypted_key_load(Tox *tox, const uint8_t *data, uint32_t length, uint8_t *key) |
291 | { | 297 | { |
292 | if (memcmp(data, TOX_ENC_SAVE_MAGIC_NUMBER, TOX_ENC_SAVE_MAGIC_LENGTH) != 0) | 298 | if (memcmp(data, TOX_ENC_SAVE_MAGIC_NUMBER, TOX_ENC_SAVE_MAGIC_LENGTH) != 0) |
293 | return -1; | 299 | return -1; |