| 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
| 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 TestCrypto) Source # | |
Defined in Test.Consensus.Committee.TestCrypto Methods (==) ∷ VoteSignature TestCrypto → VoteSignature TestCrypto → Bool # (/=) ∷ VoteSignature TestCrypto → VoteSignature TestCrypto → Bool # | |
| 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 TestCrypto) Source # | |
Defined in Test.Consensus.Committee.TestCrypto Methods showsPrec ∷ Int → VRFElectionInput TestCrypto → ShowS # show ∷ VRFElectionInput TestCrypto → String # showList ∷ [VRFElectionInput TestCrypto] → ShowS # | |
| Eq (VRFElectionInput TestCrypto) Source # | |
Defined in Test.Consensus.Committee.TestCrypto Methods (==) ∷ VRFElectionInput TestCrypto → VRFElectionInput TestCrypto → Bool # (/=) ∷ VRFElectionInput TestCrypto → VRFElectionInput TestCrypto → Bool # | |
| newtype VRFElectionInput TestCrypto Source # | |
Defined in Test.Consensus.Committee.TestCrypto | |
data family VRFOutput crypto Source #
Output of the verifiable random function
Instances
| Show (VRFOutput TestCrypto) Source # | |
Defined in Test.Consensus.Committee.TestCrypto | |
| Eq (VRFOutput TestCrypto) Source # | |
Defined in Test.Consensus.Committee.TestCrypto Methods (==) ∷ VRFOutput TestCrypto → VRFOutput TestCrypto → Bool # (/=) ∷ VRFOutput TestCrypto → VRFOutput TestCrypto → Bool # | |
| 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