forked from pmittaldev/john-the-ripper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblowfish.h
55 lines (45 loc) · 1.02 KB
/
blowfish.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
/* modified 19jul1996 by robey -- uses autoconf values now */
#ifndef _H_BLOWFISH
#define _H_BLOWFISH
#include "arch.h"
#define bf_N 16
#define noErr 0
#define DATAERROR -1
#define UBYTE_08bits unsigned char
#define UWORD_16bits unsigned short
#define SIZEOF_INT 4
#if SIZEOF_INT==4
#define UWORD_32bits unsigned int
#else
#if SIZEOF_LONG==4
#define UWORD_32bits unsigned long
#endif
#endif
/* choose a byte order for your hardware */
#if !ARCH_LITTLE_ENDIAN
/* ABCD - big endian - motorola */
union aword {
UWORD_32bits word;
UBYTE_08bits byte[4];
struct {
unsigned int byte0:8;
unsigned int byte1:8;
unsigned int byte2:8;
unsigned int byte3:8;
} w;
};
#endif /* !ARCH_LITTLE_ENDIAN */
#if ARCH_LITTLE_ENDIAN
/* DCBA - little endian - intel */
union aword {
UWORD_32bits word;
UBYTE_08bits byte[4];
struct {
unsigned int byte3:8;
unsigned int byte2:8;
unsigned int byte1:8;
unsigned int byte0:8;
} w;
};
#endif /* ARCH_LITTLE_ENDIAN */
#endif