it works again

This commit is contained in:
wangyu 2017-07-28 00:15:10 +08:00 committed by wangyu
parent 21d5f9097f
commit 7933edd9ac
3 changed files with 582 additions and 421 deletions

View File

@ -13,7 +13,7 @@
static int8_t zero_iv[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0};//this prog use zero iv,you should make sure first block of data contains a random/nonce data static int8_t zero_iv[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0};//this prog use zero iv,you should make sure first block of data contains a random/nonce data
extern const int max_data_len; extern const int max_data_len;
const int buf_len=65535; extern const int buf_len;//=65535;
map<int, string> auth_mode_tostring = {{auth_none, "none"}, {auth_md5, "md5"}, {auth_crc32, "crc32"},{auth_sum,"sum"}}; map<int, string> auth_mode_tostring = {{auth_none, "none"}, {auth_md5, "md5"}, {auth_crc32, "crc32"},{auth_sum,"sum"}};
map<int, string> cipher_mode_tostring={{cipher_none,"none"},{cipher_aes128cbc,"aes128cbc"},{cipher_xor,"xor"}}; map<int, string> cipher_mode_tostring={{cipher_none,"none"},{cipher_aes128cbc,"aes128cbc"},{cipher_xor,"xor"}};
@ -277,7 +277,7 @@ int my_encrypt_old(const char *data0,char *output,int &len,char * key)
static const int disable_all=0; static const int disable_all=0;
static const int disable_aes=0; static const int disable_aes=0;
char data[65535+100]; char data[buf_len];
memcpy(data,data0,len); memcpy(data,data0,len);
if(disable_all) if(disable_all)
@ -326,7 +326,7 @@ int my_decrypt_old(const char *data0,char *output,int &len,char * key)
static const int disable_all=0; static const int disable_all=0;
static const int disable_aes=0; static const int disable_aes=0;
char data[65535+100]; char data[buf_len];
memcpy(data,data0,len); memcpy(data,data0,len);
if(disable_all) if(disable_all)

859
main.cpp

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@ ccmips=mips-openwrt-linux-g++
all: all:
killall udp2raw||true killall udp2raw||true
sleep 1 sleep 1
g++ main.cpp -o udp2raw -static -lrt -ggdb -I. aes.c md5.c encrypt.cpp log.cpp -O3 -std=c++11 g++ main.cpp -o udp2raw -static -lrt -ggdb -I. aes.c md5.c encrypt.cpp log.cpp -std=c++11
${ccmips} -O3 main.cpp -o udp2raw_mips -lrt -I. aes.c md5.c encrypt.cpp log.cpp -std=c++11 ${ccmips} main.cpp -o udp2raw_mips -lrt -I. aes.c md5.c encrypt.cpp log.cpp -std=c++11