tibia-client/src/framework/net/rsa.h

23 lines
384 B
C
Raw Normal View History

2011-04-10 03:33:07 +02:00
#ifndef RSA_H
#define RSA_H
2011-08-15 16:06:15 +02:00
#include <framework/global.h>
2011-04-10 03:33:07 +02:00
#include <gmp.h>
2011-07-13 23:12:36 +02:00
class Rsa
{
2011-04-10 03:33:07 +02:00
public:
Rsa();
~Rsa();
2011-08-15 21:15:49 +02:00
2011-04-10 03:33:07 +02:00
void setKey(const char* p, const char* q, const char* d);
bool decrypt(char* msg, int32_t size);
static bool encrypt(char* msg, int32_t size, const char* key);
protected:
bool m_keySet;
mpz_t m_p, m_q, m_u, m_d, m_dp, m_dq, m_mod;
};
2011-08-15 21:15:49 +02:00
#endif