コード例 #1
0
            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);
            }
コード例 #2
0
 public override void Write(byte[] buffer, int offset, int count)
 {
     CryptoInner.Write(buffer, offset, count);
 }
コード例 #3
0
 public override void Flush() => CryptoInner.Flush();
コード例 #4
0
 public void Clear() => CryptoInner.Clear();