mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-01-19 14:29:34 +08:00
trival
This commit is contained in:
parent
dcc722ff5e
commit
378449ee28
@ -31,9 +31,9 @@ void AES_CBC_encrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, co
|
|||||||
aes_init( &ctx);
|
aes_init( &ctx);
|
||||||
done=1;
|
done=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char tmp_iv[16];
|
char tmp_iv[16];
|
||||||
if(key!=0) aes_setkey_enc(&ctx,key,AES_KEYSIZE);
|
if(key!=0) aes_setkey_enc(&ctx,key,AES_KEYSIZE);
|
||||||
|
|
||||||
memcpy(tmp_iv,iv,16);
|
memcpy(tmp_iv,iv,16);
|
||||||
aes_crypt_cbc( &ctx, AES_ENCRYPT, length, (unsigned char* )tmp_iv, (const unsigned char*)input,(unsigned char*) output );
|
aes_crypt_cbc( &ctx, AES_ENCRYPT, length, (unsigned char* )tmp_iv, (const unsigned char*)input,(unsigned char*) output );
|
||||||
return ;
|
return ;
|
||||||
@ -47,6 +47,7 @@ void AES_CBC_decrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, co
|
|||||||
aes_init( &ctx);
|
aes_init( &ctx);
|
||||||
done=1;
|
done=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char tmp_iv[16];
|
char tmp_iv[16];
|
||||||
if(key!=0) aes_setkey_dec(&ctx,key,AES_KEYSIZE);
|
if(key!=0) aes_setkey_dec(&ctx,key,AES_KEYSIZE);
|
||||||
memcpy(tmp_iv,iv,16);
|
memcpy(tmp_iv,iv,16);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user