przssetup

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

README

PRZS Seed Setup

Commit-and-reveal setup for pairwise seeds used by the PRZS sampler.

Protocol Overview

  1. Commit: Each party samples per-peer seed contributions, commits to them, and broadcasts the commitments.
  2. Open: Parties open their commitments privately to each peer, providing decommitment witnesses.
  3. Derive Seeds: Peers verify openings and XOR contributions to derive symmetric pairwise seeds.

Implementation Notes

  • Hash-based commitments bind seed contributions; verification failures abort with the sender’s ID.
  • Transcript key material is extracted via transcripts for deterministic commitment keys.
  • Participant exposes Round1, Round2, Round3 for message exchange via network.Router.

Usage

  1. Construct a setup participant with NewParticipant(sessionID, id, quorum, tape, prng).
  2. Run Round1 to broadcast commitments.
  3. Run Round2 to send openings privately to each peer.
  4. Run Round3 with received openings to obtain pairwise przs.Seeds for the PRZS sampler.

Documentation

Overview

Package przssetup provides commit-and-reveal setup for pairwise seeds used by the PRZS sampler.

See README.md for details.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidArgument indicates missing or inconsistent inputs.
	ErrInvalidArgument = errs.New("invalid argument")
	// ErrFailed captures non-recoverable protocol failures.
	ErrFailed = errs.New("failed")
)

Functions

This section is empty.

Types

type Participant

type Participant struct {
	// contains filtered or unexported fields
}

Participant runs the PRZS seed-setup protocol.

func NewParticipant

func NewParticipant(sessionID network.SID, mySharingID sharing.ID, quorum network.Quorum, tape ts.Transcript, prng io.Reader) (*Participant, error)

NewParticipant initialises the seed setup for a given session.

func (*Participant) Round1

func (p *Participant) Round1() (*Round1Broadcast, error)

Round1 samples pairwise seed contributions and commits to them.

func (*Participant) Round2

Round2 opens committed seed contributions to each counterparty.

func (*Participant) Round3

func (p *Participant) Round3(r2uo network.RoundMessages[*Round2P2P]) (przs.Seeds, error)

Round3 verifies peers' openings and derives pairwise seeds.

func (*Participant) SharingID

func (p *Participant) SharingID() sharing.ID

SharingID returns the participant identifier.

type Round1Broadcast

type Round1Broadcast struct {
	Commitments map[sharing.ID]hash_comm.Commitment `cbor:"commitments"`
}

func (*Round1Broadcast) Bytes

func (*Round1Broadcast) Bytes() []byte

type Round2P2P

type Round2P2P struct {
	SeedContribution [przs.SeedLength]byte `cbor:"seedContribution"`
	Witness          hash_comm.Witness     `cbor:"witness"`
}

func (*Round2P2P) Bytes

func (*Round2P2P) Bytes() []byte

type State

type State struct {
	// contains filtered or unexported fields
}

State stores commitments and seed material across rounds.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL