Documentation
¶
Overview ¶
Package aor provides protocol for distributively sampling a random value: all parties contribute randomness, and everyone outputs the XOR if and only if all openings verify. Implemented with hash-based commitments and three broadcast rounds.
See README.md for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewAgreeOnRandomRunner ¶
func NewAgreeOnRandomRunner(id sharing.ID, quorum network.Quorum, sampleSize int, tape transcripts.Transcript, prng io.Reader) (network.Runner[[]byte], error)
NewAgreeOnRandomRunner constructs a runner that executes the Agree-on-Random protocol.
Types ¶
type Participant ¶
type Participant struct {
// contains filtered or unexported fields
}
Participant runs the Agree-on-Random protocol for a single party.
func NewParticipant ¶
func NewParticipant(id sharing.ID, quorum network.Quorum, size int, tape transcripts.Transcript, prng io.Reader) (*Participant, error)
NewParticipant initialises an AOR participant with transcript binding and randomness.
func (*Participant) Round1 ¶
func (p *Participant) Round1() (*Round1Broadcast, error)
Round1 samples a random value, commits to it, and broadcasts the commitment.
func (*Participant) Round2 ¶
func (p *Participant) Round2(r1 network.RoundMessages[*Round1Broadcast]) (*Round2Broadcast, error)
Round2 records all commitments and broadcasts the local opening (message, witness).
func (*Participant) Round3 ¶
func (p *Participant) Round3(r2 network.RoundMessages[*Round2Broadcast]) ([]byte, error)
Round3 verifies all openings and aggregates the agreed random output.
func (*Participant) SharingID ¶
func (p *Participant) SharingID() sharing.ID
type Round1Broadcast ¶
type Round1Broadcast struct {
Commitment hash_comm.Commitment `cbor:"commitment"`
}
Round1Broadcast carries the commitment to a participant's random seed.