mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +08:00
13e2d26935
* Update `ReliabilityLayer.h`
37 lines
806 B
C++
37 lines
806 B
C++
|
|
// Implements a TEA block encryptor for RakNet
|
|
|
|
#ifndef __TEA_BLOCK_ENCRYPTOR_H
|
|
#define __TEA_BLOCK_ENCRYPTOR_H
|
|
|
|
#include "DataBlockEncryptor.h"
|
|
|
|
class TEABlockEncryptor :
|
|
public DataBlockEncryptor
|
|
{
|
|
|
|
public:
|
|
|
|
TEABlockEncryptor();
|
|
~TEABlockEncryptor();
|
|
|
|
bool IsKeySet( void ) const;
|
|
void SetKey( const unsigned char key[ 16 ] );
|
|
void UnsetKey( void );
|
|
void Encrypt( unsigned char *input, int inputLength, unsigned char *output, int *outputLength );
|
|
bool Decrypt( unsigned char *input, int inputLength, unsigned char *output, int *outputLength );
|
|
|
|
protected:
|
|
unsigned char key[ 16 ];
|
|
unsigned int initSum;
|
|
unsigned int initDelta;
|
|
|
|
static unsigned int initObsDelta;
|
|
|
|
void EncryptBlock(unsigned int &V0, unsigned int &V1);
|
|
void DecryptBlock(unsigned int &V0, unsigned int &V1);
|
|
|
|
};
|
|
|
|
#endif
|