From f7999cecc2bb0c76d88005444478e8500c624786 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 19 Apr 2017 20:07:47 -0400 Subject: fully working signatures This commit was sponsored by Ethan Aubin. --- Types.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Types.hs') diff --git a/Types.hs b/Types.hs index 27c9e67..e20228d 100644 --- a/Types.hs +++ b/Types.hs @@ -50,6 +50,9 @@ instance DataSize a => DataSize (Message a) where -- to a previous Activity. -- -- The Signature is over both the data in the activity, and its pointer. +-- +-- Note that the Signature is included in the Hash of an Activity, +-- which is why it's part of the Activity. data Activity a = Activity { activity :: a , prevActivity :: Maybe Hash @@ -119,7 +122,7 @@ instance DataSize Signature where -- | A public key used for a debug-me session. -- It may be signed with a gpg key. data PublicKey = PublicKey Val (Maybe GpgSig) - deriving (Show, Generic) + deriving (Show, Generic, Eq) instance DataSize PublicKey where -- ed25519 public keys are 32 bytes @@ -127,7 +130,7 @@ instance DataSize PublicKey where -- | A signature made with a gpg key. newtype GpgSig = GpgSig Val - deriving (Show, Generic) + deriving (Show, Generic, Eq) instance DataSize GpgSig where dataSize (GpgSig s) = dataSize s -- cgit v1.2.3