Last change
on this file since 1269 was 151, checked in by Merlin, 15 years ago |
ReIndented all source files with : indent -i8 -bad -bap -bbb -nsob -nfca -nfc1 -cp33 -ncdb -nsc -br -ce -cdw -cli8 -cbi0 -npcs -cs -bs -saf -sai -saw -nprs -di1 -nbc -nbfda -nbfde -npsl -brs -lp -ip0 -ppi 2 -l 300
|
File size:
1.2 KB
|
Line | |
---|
1 | #ifndef _DES_H_
|
---|
2 | # define _DES_H_
|
---|
3 |
|
---|
4 | # define CRYPT 0
|
---|
5 | # define HASH 1
|
---|
6 | # define UPDATE 2
|
---|
7 |
|
---|
8 | # define DES_IP 1
|
---|
9 | # define DES_IP_1 2
|
---|
10 | # define DES_RIGHT 4
|
---|
11 | # define DES_HASH 8
|
---|
12 |
|
---|
13 | # define DES_ECM_CRYPT 0
|
---|
14 | # define DES_ECM_HASH DES_HASH
|
---|
15 | # define DES_ECS2_DECRYPT (DES_IP | DES_IP_1 | DES_RIGHT)
|
---|
16 | # define DES_ECS2_CRYPT (DES_IP | DES_IP_1)
|
---|
17 |
|
---|
18 | # define F_EURO_S2 0
|
---|
19 | # define F_TRIPLE_DES 1
|
---|
20 |
|
---|
21 | # define SetBit(addr, bit) (addr) |= (1 << (bit))
|
---|
22 | # define UnsetBit(addr, bit) (addr) &= ~(1<< (bit))
|
---|
23 | # define TestBit(addr, bit) ((addr) & (1 << bit))
|
---|
24 |
|
---|
25 | typedef unsigned char byte;
|
---|
26 |
|
---|
27 | # ifdef __cplusplus
|
---|
28 | extern "C" {
|
---|
29 | # endif /* __cplusplus */
|
---|
30 |
|
---|
31 | extern void EuroDes(byte key1[], byte key2[], byte DesMode, byte OperatingMode, byte data[]);
|
---|
32 | extern int des_encrypt(byte * buffer, int len, byte * deskey);
|
---|
33 | extern int des_decrypt(byte * buffer, int len, byte * deskey);
|
---|
34 | extern byte *des_login_key_get(byte * key1, byte * key2, int len);
|
---|
35 |
|
---|
36 | # ifdef __cplusplus
|
---|
37 | }
|
---|
38 | # endif /* __cplusplus */
|
---|
39 | extern void doPC1(byte data[]);
|
---|
40 | extern void des(byte key[], byte mode, byte data[]);
|
---|
41 |
|
---|
42 | enum { ECM = 0, ECS2 = 1, ECS3 = 2 };
|
---|
43 |
|
---|
44 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.