Exemple #1
0
        public void InsertStringWithLength64_ExpectStringWithLength896()
        {
            var hasher       = new Hasher();
            var bins         = "1100111100001111000011110000111100001111000011110000111100001111";
            var expandedBins = hasher.AddendPadding(bins);

            Assert.IsTrue(expandedBins.Length == 896);
        }
Exemple #2
0
        public void AppendLengthToMessage_ExpectMessageLengthPluss128()
        {
            var hasher          = new Hasher();
            var bins            = "1100111100001111000011110000111100001111000011110000111100001111";
            var expandedBins    = hasher.AddendPadding(bins);
            var appendedMessage = hasher.AppendLength(bins, expandedBins);

            Assert.IsTrue(appendedMessage.Length == (expandedBins.Length + 128));
        }
Exemple #3
0
        public void Split2048BitString_ExpectTwoBlocks()
        {
            var hasher          = new Hasher();
            var bins            = "1100111100001111000011110000111100001111000011110000111100001111";
            var expandedBins    = hasher.AddendPadding(bins);
            var appendedMessage = hasher.AppendLength(bins, expandedBins);
            var blocks          = hasher.SplitIntoBlock(appendedMessage + appendedMessage);

            Assert.IsTrue(blocks.Length == 2);
        }