Files
SA-MP/raknet/TEABlockEncryptor.h

34 lines
799 B
C
Raw Normal View History

// 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();
2025-04-26 12:29:16 -07:00
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 );
2025-04-26 12:29:16 -07:00
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