-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.h
executable file
·132 lines (106 loc) · 2.83 KB
/
structs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
struct cryptoStruct {
cryptint_t counterInt;
uint8_t counterBytes[16];
cryptint_t nonceInt;
uint8_t nonceBytes[16];
cryptint_t keyInt;
uint8_t keyBytes[16];
uint8_t *yaxaKeyChunk;
uint8_t *yaxaKey;
uint8_t *yaxaSalt;
char userPass[MAX_PASS_SIZE];
char userPassToVerify[MAX_PASS_SIZE];
uint8_t passKeyedHash[PASS_KEYED_HASH_SIZE], passKeyedHashFromFile[PASS_KEYED_HASH_SIZE];
size_t nFactor;
size_t pFactor;
size_t rFactor;
uint8_t generatedMAC[MAC_SIZE];
uint8_t fileMAC[MAC_SIZE];
uint8_t *hmacKey;
uint32_t *HMACLengthPtr;
size_t keyBufSize;
size_t genHmacBufSize;
size_t msgBufSize;
size_t yaxaSaltSize;
size_t keyFileSize;
/*Iterator for indexing yaxaKey array*/
uint32_t k;
};
struct fileNames {
char *inputFileName;
char *outputFileName;
char *keyFileName;
char *otpInFileName;
char *otpOutFileName;
};
struct optionsStruct {
bool encrypt;
bool decrypt;
bool inputFileGiven;
bool outputFileGiven;
bool keyFileGiven;
bool oneTimePad;
bool passWordGiven;
bool keyBufSizeGiven;
bool macBufSizeGiven;
bool msgBufSizeGiven;
bool gotPassFromCmdLine;
bool nFactorGiven;
bool rFactorGiven;
bool pFactorGiven;
bool quitWhenDone;
};
struct miscStruct {
uint64_t returnVal;
};
#ifdef gui
struct guiStruct {
char encryptOrDecrypt[8];
GtkWidget *win;
GtkWidget *inputFileNameBox;
GtkWidget *outputFileNameBox;
GtkWidget *keyFileNameBox;
GtkWidget *otpFileNameBox;
GtkWidget *passwordBox;
GtkWidget *passwordVerificationBox;
GtkWidget *nFactorTextBox;
GtkWidget *rFactorTextBox;
GtkWidget *pFactorTextBox;
GtkWidget *otpFileButton;
GtkWidget *keyFileButton;
GtkWidget *keySizeComboBox;
GtkWidget *macBufSizeComboBox;
GtkWidget *msgBufSizeComboBox;
const char *inputFilePath;
const char *outputFilePath;
const char *keyFilePath;
const char *otpFilePath;
const char *passWord;
const char *verificationPass;
const char *keySizeComboBoxText;
const char *macBufSizeComboBoxText;
const char *msgBufSizeComboBoxText;
double *progressFraction;
char *statusMessage;
GtkWidget *statusBar;
guint statusContextID;
GtkWidget *overallProgressBar;
double *overallProgressFraction;
GtkWidget *progressBar;
clock_t startTime, endTime;
double totalTime;
uint64_t startBytes, endBytes, totalBytes;
clock_t startLoop, endLoop;
double loopTime;
double loopRate, averageRate;
};
#endif
struct dataStruct {
struct cryptoStruct cryptSt;
struct fileNames fileNameSt;
struct optionsStruct optSt;
struct miscStruct miscSt;
#ifdef gui
struct guiStruct guiSt;
#endif
};