export xxtea functions to DLL
This commit is contained in:
parent
b616189d2f
commit
808c57d01b
|
|
@ -20,6 +20,10 @@
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
static void xxtea_long_encrypt(xxtea_long *v, xxtea_long len, xxtea_long *k)
|
static void xxtea_long_encrypt(xxtea_long *v, xxtea_long len, xxtea_long *k)
|
||||||
{
|
{
|
||||||
xxtea_long n = len - 1;
|
xxtea_long n = len - 1;
|
||||||
|
|
@ -174,3 +178,8 @@ unsigned char *xxtea_decrypt(unsigned char *data, xxtea_long data_len, unsigned
|
||||||
}
|
}
|
||||||
|
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,11 @@
|
||||||
#define XXTEA_H
|
#define XXTEA_H
|
||||||
|
|
||||||
#include <stddef.h> /* for size_t & NULL declarations */
|
#include <stddef.h> /* for size_t & NULL declarations */
|
||||||
|
#include "platform/CCPlatformMacros.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
|
|
||||||
|
|
@ -41,7 +46,12 @@ typedef uint32_t xxtea_long;
|
||||||
#define XXTEA_MX (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z)
|
#define XXTEA_MX (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z)
|
||||||
#define XXTEA_DELTA 0x9e3779b9
|
#define XXTEA_DELTA 0x9e3779b9
|
||||||
|
|
||||||
unsigned char *xxtea_encrypt(unsigned char *data, xxtea_long data_len, unsigned char *key, xxtea_long key_len, xxtea_long *ret_length);
|
CC_DLL unsigned char *xxtea_encrypt(unsigned char *data, xxtea_long data_len, unsigned char *key, xxtea_long key_len, xxtea_long *ret_length);
|
||||||
unsigned char *xxtea_decrypt(unsigned char *data, xxtea_long data_len, unsigned char *key, xxtea_long key_len, xxtea_long *ret_length);
|
CC_DLL unsigned char *xxtea_decrypt(unsigned char *data, xxtea_long data_len, unsigned char *key, xxtea_long key_len, xxtea_long *ret_length);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue