ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Committee.Crypto

Description

Generic interface used by implementations of voting committees.

NOTE: concrete implementations might not need to implement all these interfaces, especially the ones regarding VRF-based eligibility proofs and aggregate vote signature verification.

Synopsis

Core types associated to voting committees

type family PrivateKey crypto Source #

Private key used within the voting committee

type family PublicKey crypto Source #

Public key used within the voting committee

type family ElectionId crypto Source #

Election identifiers

type family VoteCandidate crypto Source #

Vote candidates, i.e., what's being voted for

Vote signing interface

class CryptoSupportsVoteSigning crypto where Source #

Crypto interface used for signing and verifying votes

Associated Types

type VoteSigningKey crypto Source #

Key used for signing votes

type VoteVerificationKey crypto Source #

Key used for verifying votes

data VoteSignature crypto Source #

Cryptographic signature of a vote

Methods

getVoteSigningKeyProxy crypto → PrivateKey crypto → VoteSigningKey crypto Source #

Derive a signing key from a voting committee private key

getVoteVerificationKeyProxy crypto → PublicKey crypto → VoteVerificationKey crypto Source #

Derive a verification key from a voting committee public key

signVoteVoteSigningKey crypto → ElectionId crypto → VoteCandidate crypto → VoteSignature crypto Source #

Sign a vote candidate in a given election

verifyVoteSignatureVoteVerificationKey crypto → ElectionId crypto → VoteCandidate crypto → VoteSignature crypto → Either String () Source #

Verify the signature of a vote candidate in a given election

class (Semigroup (AggregateVoteVerificationKey crypto), Semigroup (AggregateVoteSignature crypto)) ⇒ CryptoSupportsAggregateVoteSigning crypto where Source #

Crypto interface used for verifying aggregate vote signatures

Associated Types

type AggregateVoteVerificationKey crypto Source #

Key used for verifying aggregate vote signatures

type AggregateVoteSignature crypto Source #

Aggregate cryptographic signature of a vote

Methods

liftVoteVerificationKeyProxy crypto → VoteVerificationKey crypto → AggregateVoteVerificationKey crypto Source #

Lift a single vote signature verification key into an aggregate one

liftVoteSignatureProxy crypto → VoteSignature crypto → AggregateVoteSignature crypto Source #

Lift a single vote signature into an aggregate one

verifyAggregateVoteSignatureProxy crypto → AggregateVoteVerificationKey crypto → ElectionId crypto → VoteCandidate crypto → AggregateVoteSignature crypto → Either String () Source #

Verify an aggregate vote signature for a given election and candidate

Trivial aggregate vote signature verification helpers

VRF-based eligibility proofs interface

data VRFPoolContext crypto Source #

Context in which a VRF input is evaluated.

This distinguishes between the case where we want to compute our own VRF output, and the case where we want to verify the VRF output of someone else.

Constructors

VRFSignContext (VRFSigningKey crypto)

Compute our own VRF output by signing the VRF input with our signing key

VRFVerifyContext (VRFVerificationKey crypto) (VRFOutput crypto)

Verify the local sortition output of another participant by verifying their signature over the VRF input using their verification key

newtype NormalizedVRFOutput Source #

Normalized VRF outputs as a rational between 0 and 1

class CryptoSupportsVRF crypto where Source #

Crypto interface used to proof eligibility via local sortition

Associated Types

type VRFSigningKey crypto Source #

Private key used for computing our own VRF output

type VRFVerificationKey crypto Source #

Public key used for verifying the VRF output of other participants

data VRFElectionInput crypto Source #

Input to the verifiable random function.

This is fixed across all participants for a given election.

data VRFOutput crypto Source #

Output of the verifiable random function

Methods

getVRFSigningKeyProxy crypto → PrivateKey crypto → VRFSigningKey crypto Source #

Derive a VRF signing key from a voting committee private key

getVRFVerificationKeyProxy crypto → PublicKey crypto → VRFVerificationKey crypto Source #

Derive a VRF verification key from a voting committee public key

mkVRFElectionInputNonceElectionId crypto → VRFElectionInput crypto Source #

Construct a VRF input from a nonce and an election identifier

evalVRFVRFPoolContext crypto → VRFElectionInput crypto → Either String (VRFOutput crypto) Source #

Evaluate a VRF input in a given context

normalizeVRFOutputVRFOutput crypto → NormalizedVRFOutput Source #

Normalize a VRF output to a value in [0, 1]

class (Semigroup (AggregateVRFVerificationKey crypto), Semigroup (AggregateVRFOutput crypto)) ⇒ CryptoSupportsAggregateVRF crypto where Source #

Crypto interface used for verifying aggregate VRF signatures

Associated Types

type AggregateVRFVerificationKey crypto Source #

Key used for verifying aggregate VRF outputs

type AggregateVRFOutput crypto Source #

Aggregate cryptographic signature of a VRF output

Methods

liftVRFVerificationKeyProxy crypto → VRFVerificationKey crypto → AggregateVRFVerificationKey crypto Source #

Lift a single VRF output verification key into an aggregate one

liftVRFOutputProxy crypto → VRFOutput crypto → AggregateVRFOutput crypto Source #

Lift a single VRF output into an aggregate one

verifyAggregateVRFOutputAggregateVRFVerificationKey crypto → VRFElectionInput crypto → AggregateVRFOutput crypto → Either String () Source #

Verify an aggregate vote signature for a given election and candidate

Trivial aggregate VRF verification helpers