public void EnableEncryption(byte[] pSharedSecretKey) { mDecryptCipher = Cipher.AES_128_OFB; mDecryptCipherContext = new CipherContext(mDecryptCipher); mDecryptKey = new byte[16]; mDecryptIV = new byte[16]; Buffer.BlockCopy(pSharedSecretKey, 0, mDecryptKey, 0, 16); Buffer.BlockCopy(pSharedSecretKey, 16, mDecryptIV, 0, 16); mProtocolState = EProtocolState.EncryptedAndCompressed; AdvanceDecryptIV(); }
public void EnableInflater() { mInflater = new ZOutputStream(mInflaterStream); mInflater.FlushMode = zlibConst.Z_SYNC_FLUSH; mProtocolState = EProtocolState.Compressed; }