#ifndef __GT_ENCRYPT_H__
#define __GT_ENCRYPT_H__

class GtEncrypt
{
    public:
        static int getRSAKeys(char *pubKey, int *pubLen, char *priKey, int *priLen);
        static int rsaEncryptData(const void *pubKey, const int pubLen, void *const dataBuf, const int bufLen, int * const dataLen);
        static int rsaDecryptData(const void *priKey, const int priLen, void *const dataBuf, int * const dataLen);
        static int encryptData(const int mode, const void *key, const int keyLen, 
                                void * const dataBuf, const int bufLen, int *const dataLen);
        static int decryptData(const int mode, const void *key, const int keyLen, 
                                void * const dataBuf, const int bufLen, int *const dataLen);
        static void encryptTicketCheckCode(unsigned long terminalID, unsigned long issue, 
                            unsigned long tsn, unsigned long wagerTime, int n0, double money, 
                            unsigned char *featureCode, unsigned char *ticketCheckCode);
        static int encryptFeatureCode(int gameID, unsigned char randkey, 
                                        unsigned long issue, unsigned long terminalID, unsigned long tsn, 
                                        unsigned char *featureCode);
        static int fileMd5(char *fileName, unsigned char md5Sum[16]);
        static unsigned long crc32(unsigned char *buf, int len);
        static int encryptTransform(char * srcBuf, const int srcLen, char * desBuf, int *const dataLen);
        static int decryptTransform(char * srcBuf, const int srcLen, char * desBuf, int *const dataLen);
};
#endif