From b3bd3df103a5a75d267b2b79e85558768b1dc4bb Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Sun, 23 Mar 2025 22:11:15 -0500 Subject: Fix a whole bunch of shit, create an arena implementation --- src/encryption.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/encryption.h') 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 @@ #define CHUNK_SIZE ((int)(1 << 12)) -#if defined ___VXGG___ALWAYS_CHECK_LIBSODIUM___ && ___VXGG___ALWAYS_CHECK_LIBSODIUM___ > 0 +// 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 +#if ___VXGG___ALWAYS_CHECK_LIBSODIUM___ > 0 // Definition for the callback function that fires when a call to checksodium fails typedef void (*vxgg_naclfailcb)(void*); @@ -18,7 +19,7 @@ void vxgg_setsodiumfailcb(const vxgg_naclfailcb cb, void *data); #endif -// 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 +// 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 #define PASSWORD_WORDS (\ (const char *[]){\ "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); "reliance", "divine", "providence", "mutually", "pledge", "each", "fortunes", "sacred", "honor"\ }\ ) -#define PASSWORD_WORDS_LEN (STATICARR_SIZE(PASSWORD_WORDS)) +#define PASSWORD_WORDS_LEN (STATIC_ARRAY_LEN(PASSWORD_WORDS)) // 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 void checksodium(void); -- cgit v1.2.3