Documentation
¶
Overview ¶
Package echo provides three-round echo broadcast primitive that ensures all honest parties deliver the same payload. Suitable for small-group MPC setups where parties can afford two rounds of echo to detect inconsistencies.
See README.md for details.
Index ¶
- Variables
- func ExchangeEchoBroadcastSimple[B any](rt *network.Router, correlationID string, message B) (network.RoundMessages[B], error)
- func NewEchoBroadcastRunner[B any](sharingID sharing.ID, quorum network.Quorum, correlationID string, message B) (network.Runner[network.RoundMessages[B]], error)
- type Participant
- func (p *Participant[B]) Quorum() network.Quorum
- func (p *Participant[B]) Round1(message B) (network.OutgoingUnicasts[*Round1P2P], error)
- func (p *Participant[B]) Round2(r1 network.RoundMessages[*Round1P2P]) (network.OutgoingUnicasts[*Round2P2P], error)
- func (p *Participant[B]) Round3(r2 network.RoundMessages[*Round2P2P]) (network.RoundMessages[B], error)
- func (p *Participant[B]) SharingID() sharing.ID
- type Round1P2P
- type Round2P2P
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidArgument = errs.New("invalid argument") ErrFailed = errs.New("failed") )
Functions ¶
func ExchangeEchoBroadcastSimple ¶
func ExchangeEchoBroadcastSimple[B any](rt *network.Router, correlationID string, message B) (network.RoundMessages[B], error)
ExchangeEchoBroadcastSimple runs an echo broadcast: send, echo, and verify consistent payloads for all parties.
Types ¶
type Participant ¶
type Participant[B any] struct { // contains filtered or unexported fields }
Participant drives the echo broadcast protocol for a single party.
func NewParticipant ¶
func (*Participant[B]) Quorum ¶
func (p *Participant[B]) Quorum() network.Quorum
Quorum returns the participant quorum.
func (*Participant[B]) Round1 ¶
func (p *Participant[B]) Round1(message B) (network.OutgoingUnicasts[*Round1P2P], error)
Round1 broadcasts the sender's message to all other parties.
func (*Participant[B]) Round2 ¶
func (p *Participant[B]) Round2(r1 network.RoundMessages[*Round1P2P]) (network.OutgoingUnicasts[*Round2P2P], error)
Round2 echoes every received payload back to all parties.
func (*Participant[B]) Round3 ¶
func (p *Participant[B]) Round3(r2 network.RoundMessages[*Round2P2P]) (network.RoundMessages[B], error)
Round3 validates echo consistency and outputs the agreed messages.
func (*Participant[B]) SharingID ¶
func (p *Participant[B]) SharingID() sharing.ID
SharingID returns the participant's identifier.