signature

package
v0.23.5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: AGPL-3.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFormat      = errors.New("invalid signature format")
	ErrInsufficientShares = errors.New("insufficient threshold signature shares")
)

Functions

func EnoughThresholdShares added in v0.20.4

func EnoughThresholdShares(_ int, _ int) (bool, error)

func NewThresholdProvider added in v0.20.4

func NewThresholdProvider(_ string, _ crypto.PrivateKey) module.ThresholdSigner

Types

type Combiner

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

Combiner creates a simple implementation for joining and splitting 2 signatures on a level above the cryptographic implementation. It simply concatenates signatures together and uses the stored information about signature lengths to split the concatenated bytes into its signature parts again.

func NewCombiner

func NewCombiner(lengthSig1, lengthSig2 uint) *Combiner

NewCombiner creates a new combiner to join and split signatures.

func (*Combiner) Join

func (c *Combiner) Join(sig1, sig2 crypto.Signature) ([]byte, error)

Join will concatenate the provided 2 signatures into a common byte slice.

Returns ErrInvalidFormat if one of the input signature has an invalid length.

func (*Combiner) Split

func (c *Combiner) Split(combined []byte) (crypto.Signature, crypto.Signature, error)

Split will split the given byte slice into its signature parts, using the embedded length information.

Returns ErrInvalidFormat if the combined signature length is invalid.

type EpochAwareSignerStore added in v0.20.0

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

EpochAwareSignerStore implements the SignerStore interface. It is epoch aware, and provides the appropriate threshold signers on a per-view basis, using the database to retrieve the relevant DKG keys.

func NewEpochAwareSignerStore added in v0.20.0

func NewEpochAwareSignerStore(epochLookup module.EpochLookup, keys storage.BeaconPrivateKeys) *EpochAwareSignerStore

NewEpochAwareSignerStore instantiates a new EpochAwareSignerStore

func (*EpochAwareSignerStore) GetThresholdSigner added in v0.20.0

func (s *EpochAwareSignerStore) GetThresholdSigner(view uint64) (module.ThresholdSigner, error)

GetThresholdSigner returns the threshold-signer for signing objects at a given view. The view determines the epoch, which determines the DKG private key underlying the signer.

type SingleSignerStore added in v0.20.0

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

SingleSignerStore implements the ThresholdSignerStore interface. It only keeps one signer and is not epoch-aware. It is used only for the bootstrapping process.

func NewSingleSignerStore added in v0.20.0

func NewSingleSignerStore(signer module.ThresholdSigner) *SingleSignerStore

NewSingleSignerStore instantiates a new SingleSignerStore.

func (*SingleSignerStore) GetThresholdSigner added in v0.20.0

func (s *SingleSignerStore) GetThresholdSigner(view uint64) (module.ThresholdSigner, error)

GetThresholdSigner returns the signer.

Jump to

Keyboard shortcuts

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