From 9d7e697474720b2c6e78fbf11066a8499fc55807 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 Dec 2018 13:26:14 -0400 Subject: Update to lts-12.10, support ghc 8.4, and aeson 1.3. Don't fully understand the need for the MonoLocalBinds language extension, which was not needed before but now ghc complains if it's not included, but I've tested it and it does work. All the rest of the changes are straightforward AMP changes and dep updates. Removed fgl from stack.yaml because it seems that indirect dep no longer needs to be specified for stack to build. Added custom-setup stanza since stack now warns without one. This commit was sponsored by Trenton Cronholm on Patreon. --- Crypto.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Crypto.hs') diff --git a/Crypto.hs b/Crypto.hs index 2fe27e0..af3ad17 100644 --- a/Crypto.hs +++ b/Crypto.hs @@ -16,6 +16,7 @@ import Crypto.Error import Crypto.Random.Entropy import Data.ByteArray (convert) import qualified Data.ByteString as B +import qualified Data.Semigroup as Sem dummySignature :: Signature dummySignature = OtherSignature (Val mempty) @@ -78,10 +79,13 @@ mkSigVerifier (PublicKey (Val pk)) = CryptoPassed pk' -> SigVerifier 1 (Ed25519.verify pk') CryptoFailed _ -> mempty +instance Sem.Semigroup SigVerifier where + SigVerifier na a <> SigVerifier nb b = + SigVerifier (na+nb) $ \d s -> b d s || a d s + instance Monoid SigVerifier where mempty = SigVerifier 0 $ \_b _s -> False - mappend (SigVerifier na a) (SigVerifier nb b) = - SigVerifier (na+nb) $ \d s -> b d s || a d s + mappend = (Sem.<>) data MySessionKey = MySessionKey Ed25519.SecretKey Ed25519.PublicKey -- cgit v1.2.3