Skip to content

Commit

Permalink
docs: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
heueristik committed Sep 30, 2024
1 parent 2ede41c commit 0100d9f
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions Anoma/Identity/Signing/Types.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,44 @@ import Anoma.Identity.External open;
axiom Signature : Type;

axiom verify : {Message : Type}
-> (signature : Signature)
-> (message : Message)
-> (external : ExternalIdentity)
-- | The signature to verify.
-> Signature
-- | The message to verify against.
-> Message
-- | The signer external identity to verify against.
-> ExternalIdentity
-- | The verification result.
-> Bool;

axiom sign : {Message : Type} -> (message : Message) -> (internal : InternalIdentity) -> Signature;
axiom sign : {Message : Type}
-- | The message to sign.
-> Message
-- | The signing internal identity .
-> InternalIdentity
-- | The resulting signature
-> Signature;

module NonDetached;
axiom SignedMessage : Type;

axiom verify : (signedMessage : SignedMessage) -> (external : ExternalIdentity) -> Bool;
verify (signedMessage : SignedMessage) (externalIdentity : ExternalIdentity) : Bool :=
case verifyWithMessage {Unit} signedMessage externalIdentity of
| just _ := true
| nothing := false;

axiom verifyWithMessage : {Message : Type}
-> (signedMessage : SignedMessage)
-> (external : ExternalIdentity)
-- | The signed message to verify.
-> SignedMessage
-- | The signer external identity to verify against.
-> ExternalIdentity
-- | The original message.
-> Maybe Message;

axiom sign : {Message : Type}
-> (message : Message)
-> (internal : InternalIdentity)
-- | The message to sign.
-> Message
-- | The signing internal identity.
-> InternalIdentity
-- | The resulting signed message.
-> SignedMessage;
end;

0 comments on commit 0100d9f

Please sign in to comment.