From bd3eb8ed4a26dd0a148e2c61683e4f9e4d8a5003 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 24 Jan 2024 21:07:45 +0100 Subject: [PATCH] removed duplicate tkch version so yeah v1 and v2 were the same --- include/flags.h | 7 +++---- src/core/app/main.c | 2 +- src/core/lib/flags.c | 2 +- src/core/lib/test/main.c | 2 +- src/core/lib/utils/misc.c | 10 +++------- src/logger/app/main.c | 2 +- src/logger/lib/logger.c | 2 +- 7 files changed, 11 insertions(+), 16 deletions(-) diff --git a/include/flags.h b/include/flags.h index 1fe2445..cd854cd 100644 --- a/include/flags.h +++ b/include/flags.h @@ -37,10 +37,9 @@ enum WHY2_EXIT_CODES //exit codes you fucking idiot //THESE ARE 'HISTORIC' VERSION FOR GENERATING tkch, SO YOU CAN DECRYPT OLD TEXT enum WHY2_TEXT_KEY_CHAIN_VERSIONS { - WHY2_v1, //FIRST VERSION EVER. Replaced on May 25th 15:51:57 2022 UTC in commit 35959a43938edc835c59741aac8127bc132591d0. GOOD OLD TIMES. OR NOT. IT REMINDS ME OF HER. this shit hurts, man - WHY2_v2, //SECOND VERSION. Replaced on May 28th 17:45:26 2022 UTC in commit 0d64f4fa7c37f0b57914db902258e279a71c7f9a. - WHY2_v3, //THIRD VERSION. Replaced on July 11th 17:12:41 2022 UTC in commit 0f01cde0f1e1a9210f4eef7b949e6d247072d3a6. - WHY2_v4 //FOURTH VERSION. THE LATEST ONE + WHY2_v1, //FIRST VERSION. Replaced on May 28th 17:45:26 2022 UTC in commit 0d64f4fa7c37f0b57914db902258e279a71c7f9a. GOOD OLD TIMES. OR NOT. IT REMINDS ME OF HER. this shit hurts, man + WHY2_v2, //SECOND VERSION. Replaced on July 11th 17:12:41 2022 UTC in commit 0f01cde0f1e1a9210f4eef7b949e6d247072d3a6. + WHY2_v3 //THIRD VERSION. THE LATEST ONE }; #define WHY2_VERSION "v5.0" //WHY2_VERSION OF CURRENT BUILD > DO NOT TOUCH THIS < diff --git a/src/core/app/main.c b/src/core/app/main.c index 208759c..1e928fc 100644 --- a/src/core/app/main.c +++ b/src/core/app/main.c @@ -23,7 +23,7 @@ along with this program. If not, see . int main(void) { //SET FLAGS - why2_set_flags((why2_input_flags) { 1, 1, 0, WHY2_v4 }); + why2_set_flags((why2_input_flags) { 1, 1, 0, WHY2_v3 }); //RUN ENCRYPTION WITH WHY2_TEXT_TO_ENCRYPT, GENERATE NEW KEY AND DO NOT CHECK FOR ACTIVE WHY2_VERSION & PREVENT ANY OUTPUT why2_output_flags encryptedText = why2_encrypt_text(WHY2_TEXT_TO_ENCRYPT, NULL); diff --git a/src/core/lib/flags.c b/src/core/lib/flags.c index 31a0db8..a6fd6e8 100644 --- a/src/core/lib/flags.c +++ b/src/core/lib/flags.c @@ -25,7 +25,7 @@ along with this program. If not, see . #include //CONSTS (this is just local) -#define DEFAULT_FLAGS (why2_input_flags) { 0, 0, 0, WHY2_v4} +#define DEFAULT_FLAGS (why2_input_flags) { 0, 0, 0, WHY2_v3} #define DEFAULT_MEMORY_IDENTIFIER "" int encryptionOperation(int text, int encryptedText); diff --git a/src/core/lib/test/main.c b/src/core/lib/test/main.c index 42cd11f..a12badf 100644 --- a/src/core/lib/test/main.c +++ b/src/core/lib/test/main.c @@ -44,7 +44,7 @@ int main(void) 0, //SKIP CHECK 0, //NO OUTPUT 0, //UPDATE - WHY2_v4 //LATEST VERSION + WHY2_v3 //LATEST VERSION }; //SET FLAGS diff --git a/src/core/lib/utils/misc.c b/src/core/lib/utils/misc.c index 8099f53..91ee1bc 100644 --- a/src/core/lib/utils/misc.c +++ b/src/core/lib/utils/misc.c @@ -271,24 +271,20 @@ void why2_generate_text_key_chain(char *key, int *text_key_chain, int text_key_c number_buffer -= why2_get_key_length(); } + //SET tkch VERSION switch (why2_get_flags().version) { case WHY2_v1: number_buffer_2 = i; - number_buffer_3 = number_buffer + 1; + number_buffer_3 = number_buffer + (i < text_key_chain_size); break; case WHY2_v2: - number_buffer_2 = i; - number_buffer_3 = number_buffer + (i < text_key_chain_size); - break; - - case WHY2_v3: number_buffer_2 = i; number_buffer_3 = why2_get_key_length() - (number_buffer + (i < text_key_chain_size)); break; - case WHY2_v4: + case WHY2_v3: number_buffer_2 = text_key_chain_size - (i + 1); number_buffer_3 = why2_get_key_length() - (number_buffer + (i < text_key_chain_size)); break; diff --git a/src/logger/app/main.c b/src/logger/app/main.c index 1b5c0a5..5b30127 100644 --- a/src/logger/app/main.c +++ b/src/logger/app/main.c @@ -16,7 +16,7 @@ int main(void) 1, 1, 0, - WHY2_v4 + WHY2_v3 } ); diff --git a/src/logger/lib/logger.c b/src/logger/lib/logger.c index 7d03717..d1a8678 100644 --- a/src/logger/lib/logger.c +++ b/src/logger/lib/logger.c @@ -135,7 +135,7 @@ void why2_write_log(int loggerFile, char *logMessage) why2_log_flags flags = why2_get_log_flags(); //SET ENCRYPTER FLAGS - if (!why2_get_flags_changed()) why2_set_flags((why2_input_flags) { 0, 1, 0, WHY2_v4 }); + if (!why2_get_flags_changed()) why2_set_flags((why2_input_flags) { 0, 1, 0, WHY2_v3 }); if (flags.key != NULL) //ENCRYPT TEXT IF KEY WAS CHANGED {