removed duplicate tkch version

so yeah v1 and v2 were the same
This commit is contained in:
Václav Šmejkal 2024-01-24 21:07:45 +01:00
parent 7d37daa32d
commit bd3eb8ed4a
Signed by: ENGO150
GPG Key ID: 4A57E86482968843
7 changed files with 11 additions and 16 deletions

View File

@ -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 //THESE ARE 'HISTORIC' VERSION FOR GENERATING tkch, SO YOU CAN DECRYPT OLD TEXT
enum WHY2_TEXT_KEY_CHAIN_VERSIONS 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_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 May 28th 17:45:26 2022 UTC in commit 0d64f4fa7c37f0b57914db902258e279a71c7f9a. WHY2_v2, //SECOND VERSION. Replaced on July 11th 17:12:41 2022 UTC in commit 0f01cde0f1e1a9210f4eef7b949e6d247072d3a6.
WHY2_v3, //THIRD VERSION. Replaced on July 11th 17:12:41 2022 UTC in commit 0f01cde0f1e1a9210f4eef7b949e6d247072d3a6. WHY2_v3 //THIRD VERSION. THE LATEST ONE
WHY2_v4 //FOURTH VERSION. THE LATEST ONE
}; };
#define WHY2_VERSION "v5.0" //WHY2_VERSION OF CURRENT BUILD > DO NOT TOUCH THIS < #define WHY2_VERSION "v5.0" //WHY2_VERSION OF CURRENT BUILD > DO NOT TOUCH THIS <

View File

@ -23,7 +23,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
int main(void) int main(void)
{ {
//SET FLAGS //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 //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); why2_output_flags encryptedText = why2_encrypt_text(WHY2_TEXT_TO_ENCRYPT, NULL);

View File

@ -25,7 +25,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <why2/memory.h> #include <why2/memory.h>
//CONSTS (this is just local) //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 "" #define DEFAULT_MEMORY_IDENTIFIER ""
int encryptionOperation(int text, int encryptedText); int encryptionOperation(int text, int encryptedText);

View File

@ -44,7 +44,7 @@ int main(void)
0, //SKIP CHECK 0, //SKIP CHECK
0, //NO OUTPUT 0, //NO OUTPUT
0, //UPDATE 0, //UPDATE
WHY2_v4 //LATEST VERSION WHY2_v3 //LATEST VERSION
}; };
//SET FLAGS //SET FLAGS

View File

@ -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(); number_buffer -= why2_get_key_length();
} }
//SET tkch VERSION
switch (why2_get_flags().version) switch (why2_get_flags().version)
{ {
case WHY2_v1: case WHY2_v1:
number_buffer_2 = i; number_buffer_2 = i;
number_buffer_3 = number_buffer + 1; number_buffer_3 = number_buffer + (i < text_key_chain_size);
break; break;
case WHY2_v2: 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_2 = i;
number_buffer_3 = why2_get_key_length() - (number_buffer + (i < text_key_chain_size)); number_buffer_3 = why2_get_key_length() - (number_buffer + (i < text_key_chain_size));
break; break;
case WHY2_v4: case WHY2_v3:
number_buffer_2 = text_key_chain_size - (i + 1); number_buffer_2 = text_key_chain_size - (i + 1);
number_buffer_3 = why2_get_key_length() - (number_buffer + (i < text_key_chain_size)); number_buffer_3 = why2_get_key_length() - (number_buffer + (i < text_key_chain_size));
break; break;

View File

@ -16,7 +16,7 @@ int main(void)
1, 1,
1, 1,
0, 0,
WHY2_v4 WHY2_v3
} }
); );

View File

@ -135,7 +135,7 @@ void why2_write_log(int loggerFile, char *logMessage)
why2_log_flags flags = why2_get_log_flags(); why2_log_flags flags = why2_get_log_flags();
//SET ENCRYPTER 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 if (flags.key != NULL) //ENCRYPT TEXT IF KEY WAS CHANGED
{ {