CMS 3D CMS Logo

blowfish.h
Go to the documentation of this file.
1 /*
2  * Author : Paul Kocher
3  * E-mail : pck@netcom.com
4  * Date : 1997
5  * Description: C implementation of the Blowfish algorithm.
6  */
7 
8 #define INCLUDE_BLOWFISH_DEFINE_H
9 
10 struct BCoptions {
11  unsigned char remove;
12  unsigned char standardout;
13  unsigned char compression;
14  unsigned char type;
15  unsigned long origsize;
16  unsigned char securedelete;
17 };
18 
19 #define ENCRYPT 0
20 #define DECRYPT 1
21 
22 #define endianBig ((unsigned char)0x45)
23 #define endianLittle ((unsigned char)0x54)
24 
25 typedef unsigned int uInt32;
26 
27 #ifdef WIN32 /* Win32 doesn't have random() or lstat */
28 #define random() rand()
29 #define initstate(x, y, z) srand(x)
30 #define lstat(x, y) stat(x, y)
31 #endif
32 
33 #ifndef S_ISREG
34 #define S_ISREG(x) (((x)&S_IFMT) == S_IFREG)
35 #endif
36 
37 #define MAXKEYBYTES 56 /* 448 bits */
38 
39 struct BLOWFISH_CTX {
40  uInt32 P[16 + 2];
41  uInt32 S[4][256];
42 };
43 
44 void Blowfish_Init(BLOWFISH_CTX *ctx, unsigned char *key, int keyLen);
45 
46 void Blowfish_Encrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 *xr);
47 
48 void Blowfish_Decrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 *xr);
BCoptions
Definition: blowfish.h:10
Blowfish_Decrypt
void Blowfish_Decrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 *xr)
Definition: blowfish.cc:207
BCoptions::compression
unsigned char compression
Definition: blowfish.h:13
BCoptions::remove
unsigned char remove
Definition: blowfish.h:11
BLOWFISH_CTX
Definition: blowfish.h:39
Blowfish_Encrypt
void Blowfish_Encrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 *xr)
Definition: blowfish.cc:181
BCoptions::securedelete
unsigned char securedelete
Definition: blowfish.h:16
BCoptions::standardout
unsigned char standardout
Definition: blowfish.h:12
Blowfish_Init
void Blowfish_Init(BLOWFISH_CTX *ctx, unsigned char *key, int keyLen)
Definition: blowfish.cc:235
BCoptions::type
unsigned char type
Definition: blowfish.h:14
BCoptions::origsize
unsigned long origsize
Definition: blowfish.h:15
S
Definition: CSCDBL1TPParametersExtended.h:16
P
std::pair< OmniClusterRef, TrackingParticleRef > P
Definition: BDHadronTrackMonitoringAnalyzer.cc:202
crabWrapper.key
key
Definition: crabWrapper.py:19
uInt32
unsigned int uInt32
Definition: blowfish.h:25