haskell-cryptography / cacophony

A Haskell library implementing the Noise protocol.
The Unlicense
96 stars 16 forks source link

Fix dhPubEq #3

Closed bjin closed 7 years ago

bjin commented 7 years ago

I actually don't understand the root cause, how type families allows Eq instance to be derived without explicit deriving statement. But with ghc 8.0.2 and cacophony 0.9.2, the following code would reach bottom (infinite loop).

import Crypto.Noise.DH
import Crypto.Noise.DH.Curve25519

main :: IO ()
main = do
    key1 <- snd <$> dhGenKey :: IO (PublicKey Curve25519)
    key2 <- snd <$> dhGenKey :: IO (PublicKey Curve25519)
    print (key1 == key2)
centromere commented 7 years ago

Thank you!