signature

package
v0.17.6 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: AGPL-3.0 Imports: 2 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

This section is empty.

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.

Jump to

Keyboard shortcuts

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