refresh

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package refresh implements the key-share refresh protocol for DKLS19.

The refresh protocol lets Alice and Bob rotate their additive key shares and re-seed the correlated OT material without changing the joint public key.

Protocol outline (additive refresh for the additive secret-sharing variant):

  1. Alice samples k ← F_q, writes it to the transcript, and sends it to Bob.
  2. Bob receives k_A, samples k_B ← F_q, writes both to the transcript, reads the common addend k = Transcript("refresh_addend"), and updates: sk_B ← sk_B + k. Sends k_B to Alice.
  3. Alice writes k_B, reads k, and updates: sk_A ← sk_A − k.
  4. Both parties redo the seed OT (identical to the DKG seed OT phase).

Invariant: sk_A' + sk_B' = (sk_A − k) + (sk_B + k) = sk_A + sk_B = x, so the joint public key Q = (sk_A + sk_B)·G is unchanged.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alice

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

Alice holds Alice's mutable state during one refresh execution.

func NewAlice

func NewAlice(curve *curves.Curve, dkgOutput *dkg.AliceOutput) *Alice

NewAlice creates an Alice refresh instance from existing DKG output. Returns nil if curve or dkgOutput is nil.

func (*Alice) Output

func (alice *Alice) Output() *dkg.AliceOutput

Output returns Alice's refreshed DKG output. Returns nil if the refresh protocol has not yet finished.

func (*Alice) Round1AliceAddend added in v1.0.1

func (alice *Alice) Round1AliceAddend() (curves.Scalar, error)

Round1AliceAddend is Alice's opening move. She samples k_A ← F_q, appends it to the transcript, and sends it to Bob.

func (*Alice) Round3AliceUpdateAndOT

func (alice *Alice) Round3AliceUpdateAndOT(r2 *RefreshRound2Output) ([]simplest.ReceiversMaskedChoices, error)

Round3AliceUpdateAndOT is Alice's reply. She appends k_B, derives k, updates her key share as sk_A ← sk_A − k, and advances the seed OT.

func (*Alice) Round5OTRound4

func (alice *Alice) Round5OTRound4(challenges []simplest.OtChallenge) ([]simplest.OtChallengeResponse, error)

Round5OTRound4 wraps the fourth round of the seed OT.

func (*Alice) Round7OTRound6

func (alice *Alice) Round7OTRound6(openings []simplest.ChallengeOpening) error

Round7OTRound6 wraps the sixth (final) round of the seed OT.

type Bob

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

Bob holds Bob's mutable state during one refresh execution.

func NewBob

func NewBob(curve *curves.Curve, dkgOutput *dkg.BobOutput) *Bob

NewBob creates a Bob refresh instance from existing DKG output. Returns nil if curve or dkgOutput is nil.

func (*Bob) Output

func (bob *Bob) Output() *dkg.BobOutput

Output returns Bob's refreshed DKG output. Returns nil if the refresh protocol has not yet finished.

func (*Bob) Round2BobAddendAndOT added in v1.0.1

func (bob *Bob) Round2BobAddendAndOT(kA curves.Scalar) (*RefreshRound2Output, error)

Round2BobAddendAndOT is Bob's response. Bob appends k_A, samples k_B, derives the common addend k, updates his key share as sk_B ← sk_B + k, and kicks off the new seed OT.

func (*Bob) Round4OTRound3

func (bob *Bob) Round4OTRound3(maskedChoices []simplest.ReceiversMaskedChoices) ([]simplest.OtChallenge, error)

Round4OTRound3 wraps the third round of the seed OT.

func (*Bob) Round6OTRound5

func (bob *Bob) Round6OTRound5(responses []simplest.OtChallengeResponse) ([]simplest.ChallengeOpening, error)

Round6OTRound5 wraps the fifth round of the seed OT.

type RefreshRound2Output

type RefreshRound2Output struct {
	// SeedOTRound1Output is the Schnorr proof from the sender side of the new seed OT.
	SeedOTRound1Output *schnorr.Proof

	// BobAddend is k_B, Bob's random contribution to the refresh transcript.
	BobAddend curves.Scalar
}

RefreshRound2Output is Bob's first message to Alice in the refresh protocol.

Jump to

Keyboard shortcuts

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