Wrong hashes with Skein512_256 #21

Closed
redneb opened this Issue Mar 25, 2014 · 2 comments

Comments

Projects
None yet
2 participants

redneb commented Mar 25, 2014

The implementation of Skein512_256 returns different results depending on how the input is broken into chunks and fed to hashUpdate. For example, the program:

import Crypto.Hash
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as L

s1, s2 :: B.ByteString
s1 = B.replicate  1 0
s2 = B.replicate 63 0

hs, hl :: Digest Skein512_256
hs = hash (B.concat [s1,s2])
hl = hashlazy (L.fromChunks [s1,s2])

main :: IO ()
main = print hs >> print hl

produces the following output:

24e8a5a2bdbf2f5540a2a181b8caa52559da938a6d8006b26a70f8e3f3d741f6
075cefbbf6eb63919fcfdc87752511114f459f6a566dad285725cb82c543c6b5
Owner

vincenthz commented Mar 25, 2014

ouch. that's really bad. I'll have a look ASAP

vincenthz closed this in 0f9a9c0 Mar 27, 2014

Owner

vincenthz commented Mar 27, 2014

Thanks for finding the bug and issuing a good test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment