aboutsummaryrefslogtreecommitdiff
path: root/src/crypto.hh
blob: b649ad89824fddbdcdd5887be384b8cef735023c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef TIBIA_CRYPTO_HH_
#define TIBIA_CRYPTO_HH_ 1

#include "common.hh"
#include <openssl/rsa.h>

struct TRSAPrivateKey{
	TRSAPrivateKey(void);
	~TRSAPrivateKey(void);
	void initFromFile(const char *FileName);
	void decrypt(uint8 *Data); // single 128 bytes block

	// DATA
	// =================
	RSA *m_RSA;
};

struct TXTEASymmetricKey{
	void init(TReadBuffer *Buffer);
	void encrypt(uint8 *Data); // single 8 bytes block
	void decrypt(uint8 *Data); // single 8 bytes block

	// DATA
	// =================
	uint32 m_SymmetricKey[4];
};

#endif //TIBIA_CRYPTO_HH_