diff options
Diffstat (limited to 'toxencryptsave/toxencryptsave.api.h')
-rw-r--r-- | toxencryptsave/toxencryptsave.api.h | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/toxencryptsave/toxencryptsave.api.h b/toxencryptsave/toxencryptsave.api.h index 61f685f8..3adf3a9d 100644 --- a/toxencryptsave/toxencryptsave.api.h +++ b/toxencryptsave/toxencryptsave.api.h | |||
@@ -82,8 +82,7 @@ error for key_derivation { | |||
82 | NULL, | 82 | NULL, |
83 | /** | 83 | /** |
84 | * The crypto lib was unable to derive a key from the given passphrase, | 84 | * The crypto lib was unable to derive a key from the given passphrase, |
85 | * which is usually a lack of memory issue. The functions accepting keys | 85 | * which is usually a lack of memory issue. |
86 | * do not produce this error. | ||
87 | */ | 86 | */ |
88 | FAILED, | 87 | FAILED, |
89 | } | 88 | } |
@@ -192,21 +191,12 @@ class pass_Key { | |||
192 | * for encryption and decryption. It is derived from a salt and the user- | 191 | * for encryption and decryption. It is derived from a salt and the user- |
193 | * provided password. | 192 | * provided password. |
194 | * | 193 | * |
195 | * The $this structure is hidden in the implementation. It can be allocated | 194 | * The $this structure is hidden in the implementation. It can be created |
196 | * using $new and must be deallocated using $free. | 195 | * using $derive or $derive_with_salt and must be deallocated using $free. |
197 | */ | 196 | */ |
198 | struct this; | 197 | struct this; |
199 | 198 | ||
200 | /** | 199 | /** |
201 | * Create a new $this. The initial value of it is indeterminate. To | ||
202 | * initialise it, use one of the derive_* functions below. | ||
203 | * | ||
204 | * In case of failure, this function returns NULL. The only failure mode at | ||
205 | * this time is memory allocation failure, so this function has no error code. | ||
206 | */ | ||
207 | static this new(); | ||
208 | |||
209 | /** | ||
210 | * Deallocate a $this. This function behaves like free(), so NULL is an | 200 | * Deallocate a $this. This function behaves like free(), so NULL is an |
211 | * acceptable argument value. | 201 | * acceptable argument value. |
212 | */ | 202 | */ |
@@ -227,7 +217,7 @@ class pass_Key { | |||
227 | * | 217 | * |
228 | * @return true on success. | 218 | * @return true on success. |
229 | */ | 219 | */ |
230 | bool derive(const uint8_t[passphrase_len] passphrase) | 220 | static this derive(const uint8_t[passphrase_len] passphrase) |
231 | with error for key_derivation; | 221 | with error for key_derivation; |
232 | 222 | ||
233 | /** | 223 | /** |
@@ -239,7 +229,7 @@ class pass_Key { | |||
239 | * | 229 | * |
240 | * @return true on success. | 230 | * @return true on success. |
241 | */ | 231 | */ |
242 | bool derive_with_salt(const uint8_t[passphrase_len] passphrase, const uint8_t[PASS_SALT_LENGTH] salt) | 232 | static this derive_with_salt(const uint8_t[passphrase_len] passphrase, const uint8_t[PASS_SALT_LENGTH] salt) |
243 | with error for key_derivation; | 233 | with error for key_derivation; |
244 | 234 | ||
245 | /** | 235 | /** |