-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a98ba32
commit fdee730
Showing
4 changed files
with
90 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
docs/agda-spec/src/Spec/Foreign/HSConsensus/ExternalStructures.agda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
open import Spec.Foreign.ExternalFunctions | ||
|
||
module Spec.Foreign.HSConsensus.ExternalStructures (externalFunctions : ExternalFunctions) where | ||
|
||
open import Data.String.Base renaming (_++_ to _+ˢ_) hiding (show; length) | ||
open import Ledger.Crypto | ||
open import Ledger.Types.Epoch | ||
open import Spec.Foreign.HSConsensus.Core | ||
|
||
HSGlobalConstants = GlobalConstants ∋ record {Implementation} | ||
instance | ||
HSEpochStructure = EpochStructure ∋ ℕEpochStructure HSGlobalConstants | ||
|
||
-- NOTE: Dummy for now. | ||
HSSerializer : Serializer | ||
HSSerializer = record | ||
{ Ser = String | ||
; encode = const "" | ||
; decode = const nothing | ||
; _∥_ = _+ˢ_ | ||
; enc-dec-correct = error "enc-dec-correct evaluated" | ||
} | ||
|
||
-- NOTE: Dummy for now. | ||
HSPKScheme : PKScheme | ||
HSPKScheme = record | ||
{ SKey = ℕ | ||
; VKey = ℕ | ||
; isKeyPair = _≡_ | ||
} | ||
|
||
-- Note: Dummy for now. | ||
HSDSigScheme : DSigScheme HSSerializer | ||
HSDSigScheme = record | ||
{ pks = HSPKScheme | ||
; isSigned = λ _ _ _ → ⊤ | ||
; sign = λ _ _ → 0 | ||
; isSigned-correct = error "isSigned-correct evaluated" | ||
; Dec-isSigned = λ {_} {_} {_} → ⁇ (true because ofʸ tt) | ||
} | ||
|
||
-- NOTE: Dummy for now. | ||
HSKESScheme : KESScheme HSSerializer | ||
HSKESScheme = record | ||
{ pks = HSPKScheme | ||
; Sig = ℕ | ||
; isSigned = λ _ _ _ _ → ⊤ | ||
; sign = λ _ _ _ → 0 | ||
; isSigned-correct = error "isSigned-correct evaluated" | ||
; Dec-isSigned = λ {_} {_} {_} {_} → ⁇ (true because ofʸ tt) | ||
} | ||
|
||
-- NOTE: Dummy for now. | ||
HSVRFScheme : VRFScheme | ||
HSVRFScheme = record | ||
{ Implementation | ||
; pks = HSPKScheme | ||
; Proof = ℕ | ||
; verify = λ _ _ _ → ⊤ | ||
; evaluate = error "evaluate evaluated" | ||
; _XOR_ = _+_ | ||
; verify-correct = error "verify-correct evaluated" | ||
; Dec-verify = λ {T = _} {_} {_} {_} → ⁇ (true because ofʸ tt) | ||
} | ||
|
||
HSCrypto : Crypto | ||
HSCrypto = record | ||
{ srl = HSSerializer | ||
; dsig = HSDSigScheme | ||
; kes = HSKESScheme | ||
; vrf = HSVRFScheme | ||
; ScriptHash = ℕ | ||
} | ||
|
||
open import Spec.BaseTypes HSCrypto | ||
|
||
-- NOTE: Dummy for now. | ||
HSNonces : Nonces | ||
HSNonces = record | ||
{ Implementation | ||
; Nonce = ℕ | ||
; _⋆_ = _+_ | ||
; nonceToSeed = id | ||
} | ||
|
||
open EpochStructure HSEpochStructure public | ||
open Crypto HSCrypto public | ||
open Nonces HSNonces public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters