TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PacketCrypt Class Referenceabstract

#include <PacketCrypt.h>

Public Member Functions

 PacketCrypt (uint32 rc4InitSize)
 
virtual ~PacketCrypt ()
 
virtual void Init (BigNumber *K)=0
 
void DecryptRecv (uint8 *data, size_t length)
 
void EncryptSend (uint8 *data, size_t length)
 
bool IsInitialized () const
 

Protected Attributes

ARC4 _clientDecrypt
 
ARC4 _serverEncrypt
 
bool _initialized
 

Constructor & Destructor Documentation

PacketCrypt::PacketCrypt ( uint32  rc4InitSize)
21  : _clientDecrypt(rc4InitSize), _serverEncrypt(rc4InitSize), _initialized(false)
22 {
23 }
bool _initialized
Definition: PacketCrypt.h:40
ARC4 _serverEncrypt
Definition: PacketCrypt.h:39
ARC4 _clientDecrypt
Definition: PacketCrypt.h:38
virtual PacketCrypt::~PacketCrypt ( )
inlinevirtual
29 { }

Member Function Documentation

void PacketCrypt::DecryptRecv ( uint8 data,
size_t  length 
)
26 {
27  if (!_initialized)
28  return;
29 
30  _clientDecrypt.UpdateData(len, data);
31 }
bool _initialized
Definition: PacketCrypt.h:40
ARC4 _clientDecrypt
Definition: PacketCrypt.h:38
void UpdateData(int len, uint8 *data)
Definition: ARC4.cpp:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PacketCrypt::EncryptSend ( uint8 data,
size_t  length 
)
34 {
35  if (!_initialized)
36  return;
37 
38  _serverEncrypt.UpdateData(len, data);
39 }
bool _initialized
Definition: PacketCrypt.h:40
ARC4 _serverEncrypt
Definition: PacketCrypt.h:39
void UpdateData(int len, uint8 *data)
Definition: ARC4.cpp:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void PacketCrypt::Init ( BigNumber K)
pure virtual

Implemented in WorldPacketCrypt.

bool PacketCrypt::IsInitialized ( ) const
inline
35 { return _initialized; }
bool _initialized
Definition: PacketCrypt.h:40

+ Here is the caller graph for this function:

Member Data Documentation

ARC4 PacketCrypt::_clientDecrypt
protected
bool PacketCrypt::_initialized
protected
ARC4 PacketCrypt::_serverEncrypt
protected

The documentation for this class was generated from the following files: