Wrong hashes with Skein512_256 #21

redneb opened this Issue Mar 25, 2014 · 2 comments


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:


vincenthz commented Mar 25, 2014

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

vincenthz closed this in 0f9a9c0 Mar 27, 2014


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