-
Notifications
You must be signed in to change notification settings - Fork 0
/
encryption.h
32 lines (27 loc) · 1.05 KB
/
encryption.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
/* PSU CRYPT
Written by Ben Totten
CS585 Cryptography
DES Project
*/
/* Structures and Globals */
struct fboxResults {
unsigned int x0, x1;
};
/* Encryption */
int blockEncryption(unsigned char*, unsigned char [ROUNDS][COLS]);
int addPaddingBlock(unsigned char*, unsigned char[ROUNDS][COLS]);
void whiten (unsigned char*, unsigned int *, unsigned char *);
void encrypt(unsigned int*, unsigned char[ROUNDS][COLS]);
void lastWhiten(unsigned int*, unsigned char*, unsigned char*);
/* Decryption */
int blockDecryption(unsigned char*, unsigned char[ROUNDS][COLS]);
int removePadding(unsigned char*);
/* Subroutines */
struct fboxResults F(unsigned int, unsigned int, int, unsigned char[COLS]);
unsigned int G(unsigned int, unsigned char, unsigned char, unsigned char, unsigned char, int);
unsigned char ftable(unsigned char);
/* Utility */
void joinChar(unsigned int*, unsigned char*, unsigned char*);
void splitInt(unsigned int*, unsigned char*, unsigned char*);
void reverseSubkeys(unsigned char[ROUNDS][COLS]);
void copyArray(unsigned char*, unsigned char[COLS]);