summaryrefslogtreecommitdiffhomepage
path: root/Crypto.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-05-04 16:44:38 -0400
committerJoey Hess <joeyh@joeyh.name>2017-05-04 16:44:38 -0400
commit6d6bb94c3646cdaa44f807b879fea3058387c5ae (patch)
tree21538c8aac8172b8cab9f721525770853094c626 /Crypto.hs
parent18e70a49274033d0598fcdfe830f80b0cc3552f0 (diff)
downloaddebug-me-6d6bb94c3646cdaa44f807b879fea3058387c5ae.tar.gz
--verify mode
This commit was sponsored by Thom May on Patreon.
Diffstat (limited to 'Crypto.hs')
-rw-r--r--Crypto.hs6
1 files changed, 6 insertions, 0 deletions
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)