diff options
author | Gregory Mullen (grayhatter) <greg@grayhatter.com> | 2016-09-24 16:26:35 -0700 |
---|---|---|
committer | Gregory Mullen (grayhatter) <greg@grayhatter.com> | 2016-09-28 12:12:39 -0700 |
commit | 51139a080c982a6460aa25975b3a1e0866f518ed (patch) | |
tree | 4fb34aa71d9d73ddae7fd17865c1330fc4ca69b7 /toxencryptsave | |
parent | 95b8365af690595d9d1b8d9aa9f6ed56c710e13e (diff) |
v0.0.0 => v0.0.1
Diffstat (limited to 'toxencryptsave')
-rw-r--r-- | toxencryptsave/toxencryptsave.c | 24 | ||||
-rw-r--r-- | toxencryptsave/toxencryptsave.h | 74 |
2 files changed, 0 insertions, 98 deletions
diff --git a/toxencryptsave/toxencryptsave.c b/toxencryptsave/toxencryptsave.c index 69e5c0f3..a6a75b0d 100644 --- a/toxencryptsave/toxencryptsave.c +++ b/toxencryptsave/toxencryptsave.c | |||
@@ -47,30 +47,6 @@ | |||
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 | ||
50 | uint32_t toxes_version_major(void) | ||
51 | { | ||
52 | return TOXES_VERSION_MAJOR; | ||
53 | } | ||
54 | |||
55 | uint32_t toxes_version_minor(void) | ||
56 | { | ||
57 | return TOXES_VERSION_MINOR; | ||
58 | } | ||
59 | |||
60 | uint32_t toxes_version_patch(void) | ||
61 | { | ||
62 | return TOXES_VERSION_PATCH; | ||
63 | } | ||
64 | |||
65 | bool 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 | |||
74 | /* Clients should consider alerting their users that, unlike plain data, if even one bit | 50 | /* Clients should consider alerting their users that, unlike plain data, if even one bit |
75 | * becomes corrupted, the data will be entirely unrecoverable. | 51 | * becomes corrupted, the data will be entirely unrecoverable. |
76 | * Ditto if they forget their password, there is no way to recover the data. | 52 | * Ditto if they forget their password, there is no way to recover the data. |
diff --git a/toxencryptsave/toxencryptsave.h b/toxencryptsave/toxencryptsave.h index 6451f3f5..a6537fad 100644 --- a/toxencryptsave/toxencryptsave.h +++ b/toxencryptsave/toxencryptsave.h | |||
@@ -49,80 +49,6 @@ struct Tox_Options; | |||
49 | #define TOXES_DEFINED | 49 | #define TOXES_DEFINED |
50 | #endif /* TOXES_DEFINED */ | 50 | #endif /* TOXES_DEFINED */ |
51 | 51 | ||
52 | |||
53 | /******************************************************************************* | ||
54 | * | ||
55 | * :: API version | ||
56 | * | ||
57 | ******************************************************************************/ | ||
58 | /** | ||
59 | * The major version number. Incremented when the API or ABI changes in an | ||
60 | * incompatible way. | ||
61 | */ | ||
62 | #define TOXES_VERSION_MAJOR 0u | ||
63 | |||
64 | /** | ||
65 | * The minor version number. Incremented when functionality is added without | ||
66 | * breaking the API or ABI. Set to 0 when the major version number is | ||
67 | * incremented. | ||
68 | */ | ||
69 | #define TOXES_VERSION_MINOR 0u | ||
70 | |||
71 | /** | ||
72 | * The patch or revision number. Incremented when bugfixes are applied without | ||
73 | * changing any functionality or API or ABI. | ||
74 | */ | ||
75 | #define TOXES_VERSION_PATCH 0u | ||
76 | |||
77 | /** | ||
78 | * A macro to check at preprocessing time whether the client code is compatible | ||
79 | * with the installed version of ToxAV. | ||
80 | */ | ||
81 | #define TOXES_VERSION_IS_API_COMPATIBLE(MAJOR, MINOR, PATCH) \ | ||
82 | (TOXES_VERSION_MAJOR == MAJOR && \ | ||
83 | (TOXES_VERSION_MINOR > MINOR || \ | ||
84 | (TOXES_VERSION_MINOR == MINOR && \ | ||
85 | TOXES_VERSION_PATCH >= PATCH))) | ||
86 | |||
87 | /** | ||
88 | * A macro to make compilation fail if the client code is not compatible with | ||
89 | * the installed version of ToxAV. | ||
90 | */ | ||
91 | #define TOXES_VERSION_REQUIRE(MAJOR, MINOR, PATCH) \ | ||
92 | typedef char toxes_required_version[TOXES_IS_COMPATIBLE(MAJOR, MINOR, PATCH) ? 1 : -1] | ||
93 | |||
94 | /** | ||
95 | * A convenience macro to call toxES_version_is_compatible with the currently | ||
96 | * compiling API version. | ||
97 | */ | ||
98 | #define TOXES_VERSION_IS_ABI_COMPATIBLE() \ | ||
99 | toxes_version_is_compatible(TOXES_VERSION_MAJOR, TOXES_VERSION_MINOR, TOXES_VERSION_PATCH) | ||
100 | |||
101 | /** | ||
102 | * Return the major version number of the library. Can be used to display the | ||
103 | * ToxAV library version or to check whether the client is compatible with the | ||
104 | * dynamically linked version of ToxAV. | ||
105 | */ | ||
106 | uint32_t toxes_version_major(void); | ||
107 | |||
108 | /** | ||
109 | * Return the minor version number of the library. | ||
110 | */ | ||
111 | uint32_t toxes_version_minor(void); | ||
112 | |||
113 | /** | ||
114 | * Return the patch number of the library. | ||
115 | */ | ||
116 | uint32_t toxes_version_patch(void); | ||
117 | |||
118 | /** | ||
119 | * Return whether the compiled library version is compatible with the passed | ||
120 | * version numbers. | ||
121 | */ | ||
122 | bool toxes_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch); | ||
123 | |||
124 | |||
125 | |||
126 | /* This module is conceptually organized into two parts. The first part are the functions | 52 | /* This module is conceptually organized into two parts. The first part are the functions |
127 | * with "key" in the name. To use these functions, first derive an encryption key | 53 | * with "key" in the name. To use these functions, first derive an encryption key |
128 | * from a password with tox_derive_key_from_pass, and use the returned key to | 54 | * from a password with tox_derive_key_from_pass, and use the returned key to |