From 6d6bb94c3646cdaa44f807b879fea3058387c5ae Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 4 May 2017 16:44:38 -0400 Subject: --verify mode This commit was sponsored by Thom May on Patreon. --- Crypto.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Crypto.hs') diff --git a/Crypto.hs b/Crypto.hs index 8a3bd70..efc754f 100644 --- a/Crypto.hs +++ b/Crypto.hs @@ -44,6 +44,12 @@ instance Hashable t => Signed (Message t) where hashExceptSignature (ActivityMessage a) = hashExceptSignature a hashExceptSignature (ControlMessage c) = hashExceptSignature c +instance Signed AnyMessage where + getSignature (User m) = getSignature m + getSignature (Developer m) = getSignature m + hashExceptSignature (User m) = hashExceptSignature m + hashExceptSignature (Developer m) = hashExceptSignature m + sign :: Signed v => MySessionKey -> v -> Signature sign (MySessionKey sk pk) v = Ed25519Signature $ Val $ convert $ Ed25519.sign sk pk (toSign v) -- cgit v1.2.3