Skip to content

Invalid hash when cryptonite package is loaded, too #4

@larskuhtz

Description

@larskuhtz

The hash function returns a value with all bytes set to 0x00 when also the cryptonite package is loaded. The script below exposes the issue on my system. But it has been found to only show up randomly, so it may be necessary to build both packages in a sandbox a few times in order to reproduce the issue.

#!/bin/bash

cat > Tmp.hs << EOF
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Crypto.Hash.BLAKE2.BLAKE2b
main = print $ hash 64 mempty "abc"
EOF

function get-id { ghc-pkg field $1 id | cut -d ' ' -f 2 ; }

rm -f out
ghc -package-id `get-id blake2` ./Tmp.hs -o out
./out

rm -f out
ghc -package-id `get-id blake2` -package-id `get-id cryptonite` ./Tmp.hs -o out
./out

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions