implemented WHY2_OUTPUT_TEXT in encrypter

This commit is contained in:
Václav Šmejkal 2024-02-24 12:48:38 +01:00
parent 782e964fa2
commit 773591d452
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -52,7 +52,7 @@ why2_output_flags why2_encrypt_text(char *text, char *key_new)
//VARIABLES //VARIABLES
char *key = NULL; char *key = NULL;
char *returning_text; char *returning_text = NULL;
char *text_buffer = NULL; char *text_buffer = NULL;
int *text_key_chain = why2_malloc(sizeof(int) * strlen(text)); int *text_key_chain = why2_malloc(sizeof(int) * strlen(text));
int number_buffer = 0; int number_buffer = 0;
@ -84,6 +84,8 @@ why2_output_flags why2_encrypt_text(char *text, char *key_new)
text_key_chain[i] = why2_get_encryption_operation()(text_key_chain[i], (int) text[i]); text_key_chain[i] = why2_get_encryption_operation()(text_key_chain[i], (int) text[i]);
} }
if (why2_get_flags().format == WHY2_OUTPUT_TEXT) //NORMAL 420.-69 FORMAT
{
//COUNT REQUIRED SIZE FOR returning_text //COUNT REQUIRED SIZE FOR returning_text
for (int i = 0; i < (int) strlen(text); i++) for (int i = 0; i < (int) strlen(text); i++)
{ {
@ -109,6 +111,7 @@ why2_output_flags why2_encrypt_text(char *text, char *key_new)
returning_text[strlen(returning_text)] = why2_get_encryption_separator(); returning_text[strlen(returning_text)] = why2_get_encryption_separator();
} }
} }
}
//GET FINISH TIME //GET FINISH TIME
gettimeofday(&finish_time, NULL); gettimeofday(&finish_time, NULL);