mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-06 01:23:30 +08:00
28 lines
447 B
C
28 lines
447 B
C
|
|
||
|
#pragma once
|
||
|
|
||
|
#include <windows.h>
|
||
|
|
||
|
#define TEA_KEY_SIZE 16
|
||
|
|
||
|
class CTinyEncrypt
|
||
|
{
|
||
|
private:
|
||
|
static DWORD ms_dwRounds;
|
||
|
static DWORD ms_dwInitDelta;
|
||
|
static DWORD ms_dwInitSum;
|
||
|
static BOOL ms_bInitDone;
|
||
|
|
||
|
DWORD m_pdwKey[TEA_KEY_SIZE/sizeof(DWORD)];
|
||
|
|
||
|
void DecryptBlock(DWORD &dwV0, DWORD &dwV1);
|
||
|
|
||
|
public:
|
||
|
CTinyEncrypt(void);
|
||
|
~CTinyEncrypt(void);
|
||
|
|
||
|
void SetKey(BYTE* pbKey, BYTE bytXORKey);
|
||
|
|
||
|
void DecryptData(DWORD dwLength, BYTE* pbData);
|
||
|
};
|