summaryrefslogtreecommitdiffhomepage
path: root/Crypto.hs
diff options
context:
space:
mode:
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)