4 enum { OLD_DECODE=0,OLD_ENCODE=1,NEW_CRYPT=2 };
6 struct CryptKeyCacheItem
16 memset(AESKey,0,sizeof(AESKey));
17 memset(AESInit,0,sizeof(AESInit));
18 memset(Password,0,sizeof(Password));
21 byte AESKey[16],AESInit[16];
22 char Password[MAXPASSWORD];
30 void Encode13(byte *Data,uint Count);
31 void Decode13(byte *Data,uint Count);
32 void Crypt15(byte *Data,uint Count);
33 void UpdKeys(byte *Buf);
34 void Swap(byte *Ch1,byte *Ch2);
35 void SetOldKeys(char *Password);
44 byte AESKey[16],AESInit[16];
46 static CryptKeyCacheItem Cache[4];
49 void SetCryptKeys(char *Password,byte *Salt,bool Encrypt,bool OldOnly=false);
50 void SetAV15Encryption();
51 void SetCmt13Encryption();
52 void EncryptBlock20(byte *Buf);
53 void DecryptBlock20(byte *Buf);
54 void EncryptBlock(byte *Buf,int Size);
55 void DecryptBlock(byte *Buf,int Size);
56 void Crypt(byte *Data,uint Count,int Method);
57 static void SetSalt(byte *Salt,int SaltSize);