frost

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

README

FROST: Flexible Round-Optimized Schnorr Threshold Signatures

This package is an implementation of t-of-n threshold signature of FROST: Flexible Round-Optimized Schnorr Threshold Signatures

Documentation

Overview

Package frost is an implementation of t-of-n threshold signature of https://eprint.iacr.org/2020/852.pdf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verify

func Verify(curve *curves.Curve, challengeDeriver ChallengeDerive, vk curves.Point, msg []byte, signature *Signature) (bool, error)

Method to verify a frost signature.

Types

type ChallengeDerive

type ChallengeDerive interface {
	DeriveChallenge(msg []byte, pubKey curves.Point, r curves.Point) (curves.Scalar, error)
}

type Ed25519ChallengeDeriver

type Ed25519ChallengeDeriver struct{}

func (Ed25519ChallengeDeriver) DeriveChallenge

func (ed Ed25519ChallengeDeriver) DeriveChallenge(msg []byte, pubKey curves.Point, r curves.Point) (curves.Scalar, error)

type Round1Bcast

type Round1Bcast struct {
	Di, Ei curves.Point
}

Round1Bcast contains values to be broadcast to all players after the completion of signing round 1.

func (*Round1Bcast) Decode

func (result *Round1Bcast) Decode(input []byte) error

func (*Round1Bcast) Encode

func (result *Round1Bcast) Encode() ([]byte, error)

type Round2Bcast

type Round2Bcast struct {
	Zi  curves.Scalar
	Vki curves.Point
}

Round2Bcast contains values that will be broadcast to other signers after completion of round 2.

func (*Round2Bcast) Decode

func (result *Round2Bcast) Decode(input []byte) error

func (*Round2Bcast) Encode

func (result *Round2Bcast) Encode() ([]byte, error)

type Round3Bcast

type Round3Bcast struct {
	R    curves.Point
	Z, C curves.Scalar
	// contains filtered or unexported fields
}

Round3Bcast contains the output of FROST signature, i.e., it contains FROST signature (z,c) and the corresponding message msg.

type Signature

type Signature struct {
	Z curves.Scalar
	C curves.Scalar
}

Define frost signature type

type Signer

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

Signer is a tSchnorr player performing the signing operation.

func NewSigner

func NewSigner(info *frost.DkgParticipant, id, thresh uint32, lcoeffs map[uint32]curves.Scalar, cosigners []uint32, challengeDeriver ChallengeDerive) (*Signer, error)

NewSigner create a signer from a dkg participant Note that we can pre-assign Lagrange coefficients lcoeffs of each cosigner. This optimizes performance. See paragraph 3 of section 3 in the draft - https://tools.ietf.org/pdf/draft-komlo-frost-00.pdf

func (*Signer) SignRound1

func (signer *Signer) SignRound1() (*Round1Bcast, error)

func (*Signer) SignRound2

func (signer *Signer) SignRound2(msg []byte, round2Input map[uint32]*Round1Bcast) (*Round2Bcast, error)

SignRound2 implements FROST signing round 2.

func (*Signer) SignRound3

func (signer *Signer) SignRound3(round3Input map[uint32]*Round2Bcast) (*Round3Bcast, error)

Jump to

Keyboard shortcuts

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