mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-04 00:23:22 +08:00
[raknet] Implement TEABlockEncryptor ctor
This commit is contained in:
parent
decfd66b77
commit
8ee3591083
16
raknet/TEABlockEncryptor.cpp
Normal file
16
raknet/TEABlockEncryptor.cpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// TODO: Implement TEABlockEncryptor.cpp
|
||||||
|
|
||||||
|
#include "TEABlockEncryptor.h"
|
||||||
|
|
||||||
|
#define TEA_ROUNDS 32
|
||||||
|
#define TEA_XOR_MASK 0x5E94A3CF
|
||||||
|
|
||||||
|
unsigned int TEABlockEncryptor::initObsDelta = (0x9E3779B9 ^ TEA_XOR_MASK);
|
||||||
|
|
||||||
|
TEABlockEncryptor::TEABlockEncryptor()
|
||||||
|
{
|
||||||
|
initDelta = initObsDelta ^ TEA_XOR_MASK;
|
||||||
|
initSum = initDelta * TEA_ROUNDS;
|
||||||
|
|
||||||
|
keySet = false;
|
||||||
|
}
|
25
raknet/TEABlockEncryptor.h
Normal file
25
raknet/TEABlockEncryptor.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// TODO: Implement TEABlockEncryptor.h
|
||||||
|
|
||||||
|
#ifndef __TEA_BLOCK_ENCRYPTOR_H
|
||||||
|
#define __TEA_BLOCK_ENCRYPTOR_H
|
||||||
|
|
||||||
|
#include "DataBlockEncryptor.h"
|
||||||
|
|
||||||
|
class TEABlockEncryptor :
|
||||||
|
public DataBlockEncryptor
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
TEABlockEncryptor();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
unsigned int initSum;
|
||||||
|
unsigned int initDelta;
|
||||||
|
|
||||||
|
static unsigned int initObsDelta;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user