Example #1
0
 private void Dispose(bool disposing)
 {
     if (state != IntPtr.Zero)
     {
         CryptoMethods.SymmetricFree(state);
         state = IntPtr.Zero;
     }
     if (state2 != IntPtr.Zero)
     {
         CryptoMethods.SymmetricFree(state2);
         state2 = IntPtr.Zero;
     }
     if (tempBuffer != null)
     {
         Array.Clear(tempBuffer, 0, tempBuffer.Length);
     }
     tempSize = 0;
     if (iv != null)
     {
         // Usually not sensitive, but let's be paranoid anyway.
         Array.Clear(iv, 0, iv.Length);
     }
 }