2022-05-02 18:01:12 +02:00
|
|
|
#include <why2/flags.h>
|
|
|
|
|
2022-06-12 17:15:07 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2022-06-18 18:28:33 +02:00
|
|
|
char getEncryptionSeparator()
|
|
|
|
{
|
|
|
|
return encryptionSeparator;
|
|
|
|
}
|
|
|
|
|
2022-05-29 17:45:34 +02:00
|
|
|
unsigned long getKeyLength()
|
2022-05-03 18:36:44 +02:00
|
|
|
{
|
|
|
|
return keyLength;
|
|
|
|
}
|
|
|
|
|
2022-05-27 17:25:02 +02:00
|
|
|
inputFlags noFlags()
|
|
|
|
{
|
2022-06-11 18:53:25 +02:00
|
|
|
return (inputFlags) {0, 0, 1};
|
2022-05-27 17:25:02 +02:00
|
|
|
}
|
|
|
|
|
2022-06-12 16:21:12 +02:00
|
|
|
outputFlags noOutput(unsigned char exitCode)
|
2022-06-12 16:17:09 +02:00
|
|
|
{
|
2022-06-19 16:20:52 +02:00
|
|
|
char *empty1 = malloc(1); //TEXT
|
2022-06-12 17:15:07 +02:00
|
|
|
empty1[0] = '\0';
|
2022-06-19 16:20:52 +02:00
|
|
|
|
|
|
|
char *empty2 = malloc(getKeyLength() + 1); //KEY
|
|
|
|
for (int i = 0; i < getKeyLength(); i++)
|
|
|
|
{
|
|
|
|
empty2[i] = 'x';
|
|
|
|
}
|
|
|
|
empty2[getKeyLength()] = '\0';
|
2022-06-12 17:15:07 +02:00
|
|
|
|
|
|
|
return (outputFlags) { empty1, empty2, 0, 0, exitCode };
|
2022-06-12 16:17:09 +02:00
|
|
|
}
|
|
|
|
|
2022-06-18 18:28:33 +02:00
|
|
|
void setEncryptionSeparator(char encryptionSeparatorNew)
|
|
|
|
{
|
2022-06-18 18:37:39 +02:00
|
|
|
if (encryptionSeparatorNew == '\0') return;
|
|
|
|
|
2022-06-18 18:28:33 +02:00
|
|
|
encryptionSeparator = encryptionSeparatorNew;
|
|
|
|
}
|
|
|
|
|
2022-05-03 18:36:44 +02:00
|
|
|
void setKeyLength(int keyLengthNew)
|
|
|
|
{
|
|
|
|
keyLength = keyLengthNew;
|
2022-05-02 18:01:12 +02:00
|
|
|
}
|