[raknet] Implement TEABlockEncryptor ctor

This commit is contained in:
RD42 2023-12-01 20:53:12 +08:00
parent decfd66b77
commit 8ee3591083
2 changed files with 41 additions and 0 deletions

View 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;
}

View 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