/// <summary> /// Constructor /// </summary> /// <param name="stream">The stream on which to perform the cryptographic transformation.</param> /// <param name="transform">Instance of ZipAESTransform</param> /// <param name="mode">Read or Write</param> public ZipAESStream(Stream stream, ZipAESTransform transform, CryptoStreamMode mode) : base(stream, transform, mode) { _stream = stream; _transform = transform; _slideBuffer = new byte[1024]; _blockAndAuth = CRYPTO_BLOCK_SIZE + AUTH_CODE_LENGTH; // mode: // CryptoStreamMode.Read means we read from "stream" and pass decrypted to our Read() method. // Write bypasses this stream and uses the Transform directly. if (mode != CryptoStreamMode.Read) { throw new Exception("ZipAESStream only for read"); } }
/// <summary> /// Constructor /// </summary> /// <param name="stream">The stream on which to perform the cryptographic transformation.</param> /// <param name="transform">Instance of ZipAESTransform</param> /// <param name="mode">Read or Write</param> public ZipAESStream(Stream stream, ZipAESTransform transform, CryptoStreamMode mode) : base(stream, transform, mode) { _stream = stream; _transform = transform; _slideBuffer = new byte[1024]; _blockAndAuth = CRYPTO_BLOCK_SIZE + AUTH_CODE_LENGTH; // mode: // CryptoStreamMode.Read means we read from "stream" and pass decrypted to our Read() method. // Write bypasses this stream and uses the Transform directly. if (mode != CryptoStreamMode.Read) { throw new Exception("ZipAESStream only for read"); } }