예제 #1
0
        public ChaCha20Stream(Stream sBase, bool bWriting, byte[] pbKey32,
                              byte[] pbIV12)
        {
            if (sBase == null)
            {
                throw new ArgumentNullException("sBase");
            }

            m_sBase    = sBase;
            m_bWriting = bWriting;
            m_c        = new ChaCha20Cipher(pbKey32, pbIV12);
        }
예제 #2
0
        protected override void Dispose(bool bDisposing)
        {
            if (bDisposing)
            {
                if (m_sBase != null)
                {
                    m_c.Dispose();
                    m_c = null;

                    m_sBase.Dispose();
                    m_sBase = null;
                }

                m_pbBuffer = null;
            }

            base.Dispose(bDisposing);
        }