aboutsummaryrefslogtreecommitdiff
path: root/src/crypto.hh
blob: 4c89bf7661f875b5574d7a4e07d6bd82027f2b2d (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);
	bool initFromFile(const char *FileName);
	bool 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_