andrewkrug / skeinfish

Automatically exported from code.google.com/p/skeinfish
0 stars 0 forks source link

Alignment with 1.3 Kats #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
N/A

What is the expected output? What do you see instead?
N/A

What version of the product are you using? On what operating system?
current version

Please provide any additional information below.
The implementation does not seem to align with the KATs in section C of the 
Skein 1.3 document.
ex. 
MD: FF
EXP: 0B 98 DC D1 98 EA 0E 50 A7 A2 44 C4 44 E2 5C 23 DA 30 C1 0F C9 A1 F2 70 A6 
63 7F 1F 34 E6 7E D2
RET: 2b5ddee6fe1290c223818e9166634e41bdcf41483f8b2175871e9293a34b5853

None of the 1.3 KATs align.. is the document out of date? A tweak value 
specific to your implementation? Where did you get your KATs from?

Original issue reported on code.google.com by steppenw...@yahoo.com on 6 Apr 2015 at 4:50

GoogleCodeExporter commented 8 years ago
Looks like it is related to partial blocks, to reproduce add to SkeinTesting:

            byte[] result256_2 = {
                0x0B, 0x98, 0xDC, 0xD1, 0x98, 0xEA, 0x0E, 0x50, 
                0xA7, 0xA2, 0x44, 0xC4, 0x44, 0xE2, 0x5C, 0x23, 
                0xDA, 0x30, 0xC1, 0x0F, 0xC9, 0xA1, 0xF2, 0x70,
                0xA6, 0x63, 0x7F, 0x1F, 0x34, 0xE6, 0x7E, 0xD2
            };

            hash = skein256.ComputeHash(new byte[] { 0xFF });

            for (i = 0; i < result256_2.Length; i++)
                if (hash[i] != result256_2[i]) return false;

Original comment by steppenw...@yahoo.com on 6 Apr 2015 at 5:39

GoogleCodeExporter commented 8 years ago
I managed to fix this problem by calling Initialize(); at the bottom of the 
Skein class constructor, seems to work properly and passes all of KATs from the 
documentation now.

Original comment by steppenw...@yahoo.com on 6 Apr 2015 at 9:41