| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Consensus.Committee.TestCrypto
Description
Test crypto for voting committee tests, based on BLS signatures.
Synopsis
- data TestCrypto
- data family VoteSignature crypto
- data family VRFElectionInput crypto
- data family VRFOutput crypto
- genElectionId ∷ Gen (ElectionId TestCrypto)
- genVoteCandidate ∷ Gen (VoteCandidate TestCrypto)
- genKeyPair ∷ Gen (PrivateKey TestCrypto, PublicKey TestCrypto)
- prop_SignAndVerifyVote ∷ Property
- prop_SignAndVerifyAggregateVote ∷ Property
- prop_EvalAndVerifyVRFOutput ∷ Property
- prop_EvalAndVerifyAggregateVRFOutput ∷ Property
- tests ∷ TestTree
Test crypto based on BLS signatures
data TestCrypto Source #
Instances
data family VoteSignature crypto Source #
Cryptographic signature of a vote
Instances
| FromCBOR (VoteSignature PerasBLSCrypto) | |
Defined in Ouroboros.Consensus.Peras.Crypto.BLS Methods fromCBOR ∷ Decoder s (VoteSignature PerasBLSCrypto) Source # label ∷ Proxy (VoteSignature PerasBLSCrypto) → Text Source # | |
| ToCBOR (VoteSignature PerasBLSCrypto) | |
Defined in Ouroboros.Consensus.Peras.Crypto.BLS Methods toCBOR ∷ VoteSignature PerasBLSCrypto → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (VoteSignature PerasBLSCrypto) → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [VoteSignature PerasBLSCrypto] → Size Source # | |
| Show (VoteSignature PerasBLSCrypto) | |
Defined in Ouroboros.Consensus.Peras.Crypto.BLS Methods showsPrec ∷ Int → VoteSignature PerasBLSCrypto → ShowS # | |
| Show (VoteSignature TestCrypto) Source # | |
Defined in Test.Consensus.Committee.TestCrypto Methods showsPrec ∷ Int → VoteSignature TestCrypto → ShowS # show ∷ VoteSignature TestCrypto → String # showList ∷ [VoteSignature TestCrypto] → ShowS # | |
| Eq (VoteSignature PerasBLSCrypto) | |
Defined in Ouroboros.Consensus.Peras.Crypto.BLS | |
| Eq (VoteSignature TestCrypto) Source # | |
Defined in Test.Consensus.Committee.TestCrypto Methods (==) ∷ VoteSignature TestCrypto → VoteSignature TestCrypto → Bool # (/=) ∷ VoteSignature TestCrypto → VoteSignature TestCrypto → Bool # | |
| newtype VoteSignature PerasBLSCrypto | |
| newtype VoteSignature TestCrypto Source # | |
Defined in Test.Consensus.Committee.TestCrypto | |
data family VRFElectionInput crypto Source #
Input to the verifiable random function.
This is fixed across all participants for a given election.
Instances
| Show (VRFElectionInput PerasBLSCrypto) | |
Defined in Ouroboros.Consensus.Peras.Crypto.BLS Methods showsPrec ∷ Int → VRFElectionInput PerasBLSCrypto → ShowS # | |
| Show (VRFElectionInput TestCrypto) Source # | |
Defined in Test.Consensus.Committee.TestCrypto Methods showsPrec ∷ Int → VRFElectionInput TestCrypto → ShowS # show ∷ VRFElectionInput TestCrypto → String # showList ∷ [VRFElectionInput TestCrypto] → ShowS # | |
| Eq (VRFElectionInput PerasBLSCrypto) | |
| Eq (VRFElectionInput TestCrypto) Source # | |
Defined in Test.Consensus.Committee.TestCrypto Methods (==) ∷ VRFElectionInput TestCrypto → VRFElectionInput TestCrypto → Bool # (/=) ∷ VRFElectionInput TestCrypto → VRFElectionInput TestCrypto → Bool # | |
| newtype VRFElectionInput PerasBLSCrypto | |
| newtype VRFElectionInput TestCrypto Source # | |
Defined in Test.Consensus.Committee.TestCrypto | |
data family VRFOutput crypto Source #
Output of the verifiable random function
Instances
| FromCBOR (VRFOutput PerasBLSCrypto) | |
Defined in Ouroboros.Consensus.Peras.Crypto.BLS | |
| ToCBOR (VRFOutput PerasBLSCrypto) | |
Defined in Ouroboros.Consensus.Peras.Crypto.BLS | |
| Show (VRFOutput PerasBLSCrypto) | |
Defined in Ouroboros.Consensus.Peras.Crypto.BLS | |
| Show (VRFOutput TestCrypto) Source # | |
Defined in Test.Consensus.Committee.TestCrypto | |
| Eq (VRFOutput PerasBLSCrypto) | |
Defined in Ouroboros.Consensus.Peras.Crypto.BLS Methods (==) ∷ VRFOutput PerasBLSCrypto → VRFOutput PerasBLSCrypto → Bool # (/=) ∷ VRFOutput PerasBLSCrypto → VRFOutput PerasBLSCrypto → Bool # | |
| Eq (VRFOutput TestCrypto) Source # | |
Defined in Test.Consensus.Committee.TestCrypto Methods (==) ∷ VRFOutput TestCrypto → VRFOutput TestCrypto → Bool # (/=) ∷ VRFOutput TestCrypto → VRFOutput TestCrypto → Bool # | |
| newtype VRFOutput PerasBLSCrypto | |
Defined in Ouroboros.Consensus.Peras.Crypto.BLS | |
| newtype VRFOutput TestCrypto Source # | |
Defined in Test.Consensus.Committee.TestCrypto | |
QuickCheck helpers
Smoke test properties
prop_SignAndVerifyVote ∷ Property Source #
Round trip test for vote signatures
prop_SignAndVerifyAggregateVote ∷ Property Source #
Round trip test for aggregate vote signatures
prop_EvalAndVerifyVRFOutput ∷ Property Source #
Round trip test for VRF evaluation
prop_EvalAndVerifyAggregateVRFOutput ∷ Property Source #
Round trip test for aggregate VRF evaluation