Blake2Sharp.Blake2BCore.HashFinal C# (CSharp) Method

HashFinal() public method

public HashFinal ( bool isEndOfLayer ) : byte[]
isEndOfLayer bool
return byte[]
        public byte[] HashFinal(bool isEndOfLayer)
        {
            if (!_isInitialized)
                throw new InvalidOperationException("Not initialized");
            _isInitialized = false;

            //Last compression
            _counter0 += (uint)_bufferFilled;
            _finalizationFlag0 = ulong.MaxValue;
            if (isEndOfLayer)
                _finalizationFlag1 = ulong.MaxValue;
            for (int i = _bufferFilled; i < _buf.Length; i++)
                _buf[i] = 0;
            Compress(_buf, 0);

            //Output
            byte[] hash = new byte[64];
            for (int i = 0; i < 8; ++i)
                UInt64ToBytes(_h[i], hash, i << 3);
            return hash;
        }

Same methods

Blake2BCore::HashFinal ( ) : byte[]

Usage Example

Beispiel #1
0
 public override byte[] Finish()
 {
     byte[] array = core.HashFinal();
     if (outputSizeInBytes != array.Length)
     {
         byte[] array2 = new byte[outputSizeInBytes];
         Array.Copy(array, array2, array2.Length);
         return(array2);
     }
     return(array);
 }
All Usage Examples Of Blake2Sharp.Blake2BCore::HashFinal