diff options
Diffstat (limited to 'src/encryption.h')
| -rw-r--r-- | src/encryption.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/encryption.h b/src/encryption.h index 1c38141..418e7f6 100644 --- a/src/encryption.h +++ b/src/encryption.h | |||
| @@ -8,7 +8,8 @@ | |||
| 8 | 8 | ||
| 9 | #define CHUNK_SIZE ((int)(1 << 12)) | 9 | #define CHUNK_SIZE ((int)(1 << 12)) |
| 10 | 10 | ||
| 11 | #if defined ___VXGG___ALWAYS_CHECK_LIBSODIUM___ && ___VXGG___ALWAYS_CHECK_LIBSODIUM___ > 0 | 11 | // TODO: What the fuck was I thinking when I did any of this callback shit? Make this a different macro and decouple it from ALWAYS_CHECK |
| 12 | #if ___VXGG___ALWAYS_CHECK_LIBSODIUM___ > 0 | ||
| 12 | 13 | ||
| 13 | // Definition for the callback function that fires when a call to checksodium fails | 14 | // Definition for the callback function that fires when a call to checksodium fails |
| 14 | typedef void (*vxgg_naclfailcb)(void*); | 15 | typedef void (*vxgg_naclfailcb)(void*); |
| @@ -18,7 +19,7 @@ void vxgg_setsodiumfailcb(const vxgg_naclfailcb cb, void *data); | |||
| 18 | 19 | ||
| 19 | #endif | 20 | #endif |
| 20 | 21 | ||
| 21 | // I need to store a dictionary of valid words for generating a password, and I don't want to read it in from another file, so I'm experimenting with this | 22 | // Fuck reading from a file. Even if someone ran strings on the binary and got this they wouldn't be able to regenerate the key |
| 22 | #define PASSWORD_WORDS (\ | 23 | #define PASSWORD_WORDS (\ |
| 23 | (const char *[]){\ | 24 | (const char *[]){\ |
| 24 | "the", "of", "to", "and", "for", "our", "their", "has", "in", "he", "a", "them", "that", "these", "by", "have", "we", "us",\ | 25 | "the", "of", "to", "and", "for", "our", "their", "has", "in", "he", "a", "them", "that", "these", "by", "have", "we", "us",\ |
| @@ -73,7 +74,7 @@ void vxgg_setsodiumfailcb(const vxgg_naclfailcb cb, void *data); | |||
| 73 | "reliance", "divine", "providence", "mutually", "pledge", "each", "fortunes", "sacred", "honor"\ | 74 | "reliance", "divine", "providence", "mutually", "pledge", "each", "fortunes", "sacred", "honor"\ |
| 74 | }\ | 75 | }\ |
| 75 | ) | 76 | ) |
| 76 | #define PASSWORD_WORDS_LEN (STATICARR_SIZE(PASSWORD_WORDS)) | 77 | #define PASSWORD_WORDS_LEN (STATIC_ARRAY_LEN(PASSWORD_WORDS)) |
| 77 | 78 | ||
| 78 | // Checks if sodium is initialized. Initializes it if not. If `___VXGG___ALWAYS_CHECK_LIBSODIUM___ > 0`, it's possible to set an error callback to avoid exiting the entire program. Otherwise calls `error()` if libsodium can't initialize | 79 | // Checks if sodium is initialized. Initializes it if not. If `___VXGG___ALWAYS_CHECK_LIBSODIUM___ > 0`, it's possible to set an error callback to avoid exiting the entire program. Otherwise calls `error()` if libsodium can't initialize |
| 79 | void checksodium(void); | 80 | void checksodium(void); |
