summaryrefslogtreecommitdiff
path: root/toxencryptsave/toxencryptsave.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2016-02-14 14:37:44 -0500
committerirungentoo <irungentoo@gmail.com>2016-02-14 14:37:44 -0500
commit72b1a17cc28c9a5a653823336bf0a495f6f271b1 (patch)
tree63d7d5c9c11f2ca1b013746ddda98fd837a9ac4e /toxencryptsave/toxencryptsave.c
parent94cc8b11ff473064526737936f64b6f9a19c239d (diff)
parentd552cd6e24337474ce2d40a51e133c0af1dc128a (diff)
Merge branch 'GrayHatter-master'
Diffstat (limited to 'toxencryptsave/toxencryptsave.c')
-rw-r--r--toxencryptsave/toxencryptsave.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/toxencryptsave/toxencryptsave.c b/toxencryptsave/toxencryptsave.c
index 5c40f639..bbe0422f 100644
--- a/toxencryptsave/toxencryptsave.c
+++ b/toxencryptsave/toxencryptsave.c
@@ -47,6 +47,30 @@
47#error TOX_PASS_ENCRYPTION_EXTRA_LENGTH is assumed to be equal to (crypto_box_MACBYTES + crypto_box_NONCEBYTES + crypto_pwhash_scryptsalsa208sha256_SALTBYTES + TOX_ENC_SAVE_MAGIC_LENGTH) 47#error TOX_PASS_ENCRYPTION_EXTRA_LENGTH is assumed to be equal to (crypto_box_MACBYTES + crypto_box_NONCEBYTES + crypto_pwhash_scryptsalsa208sha256_SALTBYTES + TOX_ENC_SAVE_MAGIC_LENGTH)
48#endif 48#endif
49 49
50uint32_t toxes_version_major(void)
51{
52 return TOXES_VERSION_MAJOR;
53}
54
55uint32_t toxes_version_minor(void)
56{
57 return TOXES_VERSION_MINOR;
58}
59
60uint32_t toxes_version_patch(void)
61{
62 return TOXES_VERSION_PATCH;
63}
64
65bool toxes_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch)
66{
67 return (TOXES_VERSION_MAJOR == major && /* Force the major version */
68 (TOXES_VERSION_MINOR > minor || /* Current minor version must be newer than requested -- or -- */
69 (TOXES_VERSION_MINOR == minor && TOXES_VERSION_PATCH >= patch) /* the patch must be the same or newer */
70 )
71 );
72}
73
50/* Clients should consider alerting their users that, unlike plain data, if even one bit 74/* Clients should consider alerting their users that, unlike plain data, if even one bit
51 * becomes corrupted, the data will be entirely unrecoverable. 75 * becomes corrupted, the data will be entirely unrecoverable.
52 * Ditto if they forget their password, there is no way to recover the data. 76 * Ditto if they forget their password, there is no way to recover the data.