Esempio n. 1
0
        public static bool VerifyLeaves(byte[] correctHash, byte[][] hashBlock) //compresses hash blocks to hash.
        {
            if (hashBlock.Length == 0)
            {
                return(false);
            }

            return(ThexHelper.HashesEquals(correctHash, ThexHelper.CompressHashBlock(_hashCalculator.Hasher, hashBlock)));
        }
Esempio n. 2
0
 public static bool VerifySegment(byte[] correctHash, string filePath, long start, int length)
 {
     return(ThexHelper.VerifySegment(_hashCalculator.Hasher, correctHash, filePath, start, length));
 }
Esempio n. 3
0
        private void ProcessInternalLeaf(int level, int index, byte[] leafA, byte[] leafB)
        {
            var tg = new T();

            TTH[level][index] = ThexHelper.InternalHash(tg, leafA, leafB);
        }