Pol  Revision:4b29d2b
crypt.h
Go to the documentation of this file.
1 //
3 // crypt/crypt.h
4 //
6 
7 #ifndef __CRYPT_H__
8 #define __CRYPT_H__
9 
10 #include "../../clib/compilerspecifics.h"
11 #include "../sockets.h"
12 #include "blowfish.h"
13 #include "cryptbase.h"
14 #include "md5.h"
15 #include "twofish.h"
16 
17 // NOCRYPT
18 namespace Pol
19 {
20 namespace Crypt
21 {
22 class CCryptNoCrypt : public CCryptBase
23 {
24  // Constructor / Destructor
25 public:
26  typedef CCryptBase base;
27 
28  CCryptNoCrypt();
29  virtual ~CCryptNoCrypt();
30 
31  // Member Functions
32 public:
33  virtual int Receive( void* buffer, int max_expected, SOCKET socket ) POL_OVERRIDE;
34  virtual void Init( void* pvSeed, int type = CCryptBase::typeAuto ) POL_OVERRIDE;
35 };
36 
37 // BLOWFISH
38 
40 {
41  // Constructor / Destructor
42 public:
43  typedef CCryptBaseCrypt base;
44 
46  CCryptBlowfish( unsigned int masterKey1, unsigned int masterKey2 );
47  virtual ~CCryptBlowfish();
48 
50 
51  // Member Functions
52 public:
53  virtual int Receive( void* buffer, int max_expected, SOCKET socket ) POL_OVERRIDE;
54  virtual void Init( void* pvSeed, int type = CCryptBase::typeAuto ) POL_OVERRIDE;
55  virtual void SetMasterKeys( unsigned int masterKey1, unsigned int masterKey2 ) POL_OVERRIDE;
56 
57 protected:
58  virtual void Decrypt( void* pvIn, void* pvOut, int len ) POL_OVERRIDE;
59 };
60 
61 // BLOWFISH OLD
62 
64 {
65  // Constructor / Destructor
66 public:
68  CCryptBlowfishOld( unsigned int masterKey1, unsigned int masterKey2 );
69  virtual ~CCryptBlowfishOld();
70 
71 protected:
72  virtual void Decrypt( void* pvIn, void* pvOut, int len ) POL_OVERRIDE;
73 };
74 
75 // BLOWFISH 1.25.36
76 
78 {
79  // Constructor / Destructor
80 public:
81  CCrypt12536();
82  CCrypt12536( unsigned int masterKey1, unsigned int masterKey2 );
83  virtual ~CCrypt12536();
84 
85 protected:
86  virtual void Decrypt( void* pvIn, void* pvOut, int len ) POL_OVERRIDE;
87 };
88 
89 // BLOWFISH + TWOFISH
90 
91 class CCryptBlowfishTwofish : public CCryptBaseCrypt
92 {
93 public:
95  CCryptBlowfishTwofish( unsigned int masterKey1, unsigned int masterKey2 );
96  virtual ~CCryptBlowfishTwofish();
97 
100 
101 public:
102  virtual int Receive( void* buffer, int max_expected, SOCKET socket ) POL_OVERRIDE;
103  virtual void Init( void* pvSeed, int type = CCryptBase::typeAuto ) POL_OVERRIDE;
104  virtual void SetMasterKeys( unsigned int masterKey1, unsigned int masterKey2 ) POL_OVERRIDE;
105 
106 protected:
107  virtual void Decrypt( void* pvIn, void* pvOut, int len ) POL_OVERRIDE;
108 };
109 
110 // TWOFISH
111 
112 class CCryptTwofish : public CCryptBaseCrypt
113 {
114 public:
115  CCryptTwofish();
116  CCryptTwofish( unsigned int masterKey1, unsigned int masterKey2 );
117  virtual ~CCryptTwofish();
118 
121 
122 public:
123  virtual int Receive( void* buffer, int max_expected, SOCKET socket ) POL_OVERRIDE;
124  virtual void Init( void* pvSeed, int type = CCryptBase::typeAuto ) POL_OVERRIDE;
125  virtual void SetMasterKeys( unsigned int masterKey1, unsigned int masterKey2 ) POL_OVERRIDE;
126  virtual void Encrypt( void* pvIn, void* pvOut, int len ) POL_OVERRIDE;
127 
128 protected:
129  virtual void Decrypt( void* pvIn, void* pvOut, int len ) POL_OVERRIDE;
130 };
131 }
132 }
133 
134 #endif //__CRYPT_H__
virtual void Init(void *pvSeed, int type=CCryptBase::typeAuto) POL_OVERRIDE
Definition: crypt.cpp:25
#define POL_OVERRIDE
CCryptBaseCrypt base
Definition: crypt.h:43
int SOCKET
Definition: wnsckt.h:10
virtual int Receive(void *buffer, int max_expected, SOCKET socket) POL_OVERRIDE
Definition: crypt.cpp:20
virtual ~CCryptNoCrypt()
Definition: crypt.cpp:18
unsigned char buffer[10000]
Definition: UoToolMain.cpp:109
virtual void Encrypt(void *pvIn, void *pvOut, int len)
Definition: cryptbase.h:100
Definition: berror.cpp:12