Refine the authentication for true CCA

This commit is contained in:
Gang Zhuo
2015-09-23 02:08:41 -04:00
parent f7c9f2049c
commit 3aac1cfcfc
4 changed files with 46 additions and 56 deletions
@@ -93,7 +93,7 @@ namespace Shadowsocks.Controller
private int _firstPacketLength;
// Size of receive buffer.
public const int RecvSize = 8192;
public const int RecvReserveSize = (RecvSize / IVEncryptor.HASH_BUF_LEN + 1) * IVEncryptor.HASH_BYTES + IVEncryptor.ONETIMEAUTH_BYTES; // reserve for one-time auth
public const int RecvReserveSize = IVEncryptor.ONETIMEAUTH_BYTES + IVEncryptor.AUTH_BYTES; // reserve for one-time auth
public const int BufferSize = RecvSize + RecvReserveSize + 32;
private int totalRead = 0;