public override int Read(byte[] buffer, int offset, int count) { int ivbytesread = 0; if (EncryptedOut) { // First copy IV bytes if (IVPosition < IV.Length) { int ivend = (IVPosition + count < IV.Length) ? IVPosition + count : IV.Length; ivbytesread = ivend - IVPosition; Array.Copy(IV, IVPosition, buffer, offset, ivbytesread); IVPosition = ivend; } } int innerbytesread = 0; if (ivbytesread < count) // bytes left to copy { innerbytesread = CryptoInner.Read(buffer, offset, count + IV.Length); // Read } return(ivbytesread + innerbytesread); }
public override void Write(byte[] buffer, int offset, int count) { CryptoInner.Write(buffer, offset, count); }
public override void Flush() => CryptoInner.Flush();
public void Clear() => CryptoInner.Clear();