diff options
author | dubslow <bunslow@gmail.com> | 2014-10-12 03:08:05 -0500 |
---|---|---|
committer | dubslow <bunslow@gmail.com> | 2014-10-12 03:11:11 -0500 |
commit | 57d3b3be05788ed46a7fef0b3073c6c5222cf8d3 (patch) | |
tree | 1bb4d0dbedc78ef729fcb0e317898ec61124f9c7 /toxencryptsave/toxencryptsave.c | |
parent | 458a09f6ab289afa1e475f388988d88e07dcb8b0 (diff) |
Fix include issue
Diffstat (limited to 'toxencryptsave/toxencryptsave.c')
-rw-r--r-- | toxencryptsave/toxencryptsave.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/toxencryptsave/toxencryptsave.c b/toxencryptsave/toxencryptsave.c index 7efba089..7492f06b 100644 --- a/toxencryptsave/toxencryptsave.c +++ b/toxencryptsave/toxencryptsave.c | |||
@@ -35,6 +35,15 @@ | |||
35 | #include <crypto_hash_sha256.h> | 35 | #include <crypto_hash_sha256.h> |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #define TOX_PASS_ENCRYPTION_EXTRA_LENGTH (crypto_box_MACBYTES + crypto_box_NONCEBYTES \ | ||
39 | + crypto_pwhash_scryptsalsa208sha256_SALTBYTES) | ||
40 | |||
41 | #define TOX_PASS_KEY_LENGTH (crypto_box_KEYBYTES + crypto_pwhash_scryptsalsa208sha256_SALTBYTES) | ||
42 | |||
43 | int tox_pass_encryption_extra_length() {return TOX_PASS_ENCRYPTION_EXTRA_LENGTH;} | ||
44 | |||
45 | int tox_pass_key_length() {return TOX_PASS_KEY_LENGTH;} | ||
46 | |||
38 | /* This "module" provides functions analogous to tox_load and tox_save in toxcore | 47 | /* This "module" provides functions analogous to tox_load and tox_save in toxcore |
39 | * Clients should consider alerting their users that, unlike plain data, if even one bit | 48 | * Clients should consider alerting their users that, unlike plain data, if even one bit |
40 | * becomes corrupted, the data will be entirely unrecoverable. | 49 | * becomes corrupted, the data will be entirely unrecoverable. |
@@ -98,7 +107,7 @@ int tox_derive_key_from_pass(uint8_t *passphrase, uint32_t pplength, uint8_t *ou | |||
98 | * returns 0 on success | 107 | * returns 0 on success |
99 | * returns -1 on failure | 108 | * returns -1 on failure |
100 | */ | 109 | */ |
101 | int tox_pass_key_encrypt(uint8_t *data, uint32_t data_len, const uint8_t *key, uint8_t *out) | 110 | int tox_pass_key_encrypt(const uint8_t *data, uint32_t data_len, const uint8_t *key, uint8_t *out) |
102 | { | 111 | { |
103 | /* the output data consists of, in order: | 112 | /* the output data consists of, in order: |
104 | * salt, nonce, mac, enc_data | 113 | * salt, nonce, mac, enc_data |
@@ -134,7 +143,7 @@ int tox_pass_key_encrypt(uint8_t *data, uint32_t data_len, const uint8_t *key, u | |||
134 | * returns 0 on success | 143 | * returns 0 on success |
135 | * returns -1 on failure | 144 | * returns -1 on failure |
136 | */ | 145 | */ |
137 | int tox_pass_encrypt(uint8_t *data, uint32_t data_len, uint8_t *passphrase, uint32_t pplength, uint8_t *out) | 146 | int tox_pass_encrypt(const uint8_t *data, uint32_t data_len, uint8_t *passphrase, uint32_t pplength, uint8_t *out) |
138 | { | 147 | { |
139 | uint8_t key[TOX_PASS_KEY_LENGTH]; | 148 | uint8_t key[TOX_PASS_KEY_LENGTH]; |
140 | 149 | ||