Reset() public method

public Reset ( ) : void
return void
Exemplo n.º 1
0
        private void Reset(
            bool clearMac)
        {
            cipher.Reset(); // TODO Redundant since the mac will reset it?
            mac.Reset();

            bufOff = 0;
            Array.Clear(bufBlock, 0, bufBlock.Length);

            if (clearMac)
            {
                Array.Clear(macBlock, 0, macBlock.Length);
            }

            byte[] tag = new byte[blockSize];
            tag[blockSize - 1] = (byte)Tag.H;
            mac.BlockUpdate(tag, 0, blockSize);

            cipherInitialized = false;

            if (initialAssociatedText != null)
            {
                ProcessAadBytes(initialAssociatedText, 0, initialAssociatedText.Length);
            }
        }
        private void Reset(
            bool clearMac)
        {
            cipher.Reset();
            mac.Reset();

            bufOff = 0;
            Array.Clear(bufBlock, 0, bufBlock.Length);

            if (clearMac)
            {
                Array.Clear(macBlock, 0, macBlock.Length);
            }

            byte[] tag = new byte[blockSize];
            tag[blockSize - 1] = (byte)Tag.C;
            mac.BlockUpdate(tag, 0, blockSize);
        }
Exemplo n.º 3
0
 private void Reset(bool clearMac)
 {
     cipher.Reset();
     mac.Reset();
     bufOff = 0;
     Array.Clear(bufBlock, 0, bufBlock.Length);
     if (clearMac)
     {
         Array.Clear(macBlock, 0, macBlock.Length);
     }
     byte[] array = new byte[blockSize];
     array[blockSize - 1] = 1;
     mac.BlockUpdate(array, 0, blockSize);
     cipherInitialized = false;
     if (initialAssociatedText != null)
     {
         ProcessAadBytes(initialAssociatedText, 0, initialAssociatedText.Length);
     }
 }