Refine encryption

introduce a constructor to store inner method name

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
This commit is contained in:
Syrone Wong
2016-09-28 10:46:19 +08:00
parent 4acae9de9b
commit 1dc992e806
4 changed files with 31 additions and 21 deletions
@@ -70,7 +70,7 @@ namespace Shadowsocks.Encryption
realkey = _key;
}
MbedTLS.cipher_init(ctx);
if (MbedTLS.cipher_setup( ctx, MbedTLS.cipher_info_from_string( _cipherMbedName ) ) != 0 )
if (MbedTLS.cipher_setup( ctx, MbedTLS.cipher_info_from_string( _innerLibName ) ) != 0 )
throw new Exception("Cannot initialize mbed TLS cipher context");
/*
* MbedTLS takes key length by bit