sign

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MPL-2.0 Imports: 6 Imported by: 14

Documentation

Overview

Package sign contains useful tools for the different signing algorithms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatableScheme

type AggregatableScheme interface {
	Scheme
	AggregateSignatures(sigs ...[]byte) ([]byte, error)
	AggregatePublicKeys(Xs ...kyber.Point) kyber.Point
}

AggregatableScheme is an interface allowing to aggregate signatures and public keys to efficient verification.

type CompletePolicy

type CompletePolicy struct {
}

CompletePolicy is the default policy requiring that all participants have cosigned to make a collective signature valid.

func (CompletePolicy) Check

Check verifies that all participants have contributed to a collective signature.

type Mask

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

Mask is a bitmask of the participation to a collective signature.

func NewMask

func NewMask(suite pairing.Suite, publics []kyber.Point, myKey kyber.Point) (*Mask, error)

NewMask creates a new mask from a list of public keys. If a key is provided, it will set the bit of the key to 1 or return an error if it is not found.

func (*Mask) CountEnabled

func (m *Mask) CountEnabled() int

CountEnabled returns the number of bit set to 1

func (*Mask) CountTotal

func (m *Mask) CountTotal() int

CountTotal returns the number of potential participants

func (*Mask) IndexOfNthEnabled

func (m *Mask) IndexOfNthEnabled(nth int) int

IndexOfNthEnabled returns the index of the nth enabled bit or -1 if out of bounds.

func (*Mask) Len

func (m *Mask) Len() int

Len returns the length of the byte array necessary to store the bitmask.

func (*Mask) Mask

func (m *Mask) Mask() []byte

Mask returns the bitmask as a byte array.

func (*Mask) Merge

func (m *Mask) Merge(mask []byte) error

Merge merges the given mask to the current one only if the length matches

func (*Mask) NthEnabledAtIndex

func (m *Mask) NthEnabledAtIndex(idx int) int

NthEnabledAtIndex returns the sum of bits set to 1 until the given index. In other words, it returns how many bits are enabled before the given index.

func (*Mask) Participants

func (m *Mask) Participants() []kyber.Point

Participants returns the list of public keys participating.

func (*Mask) Publics

func (m *Mask) Publics() []kyber.Point

Publics returns a copy of the list of public keys.

func (*Mask) SetBit

func (m *Mask) SetBit(i int, enable bool) error

SetBit turns on or off the bit at the given index.

func (*Mask) SetMask

func (m *Mask) SetMask(mask []byte) error

SetMask replaces the current mask by the new one if the length matches.

type ParticipationMask

type ParticipationMask interface {
	// CountEnabled returns the number of participants
	CountEnabled() int
	// CountTotal returns the number of candidates
	CountTotal() int
}

ParticipationMask is an interface to get the total number of candidates and the number of participants.

type Policy

type Policy interface {
	Check(m ParticipationMask) bool
}

Policy represents a fully customizable cosigning policy deciding what cosigner sets are and aren't sufficient for a collective signature to be considered acceptable to a verifier. The Check method may inspect the set of participants that cosigned by invoking cosi.Mask and/or cosi.MaskBit, and may use any other relevant contextual information (e.g., how security-critical the operation relying on the collective signature is) in determining whether the collective signature was produced by an acceptable set of cosigners.

type Scheme

type Scheme interface {
	NewKeyPair(random cipher.Stream) (kyber.Scalar, kyber.Point)
	Sign(private kyber.Scalar, msg []byte) ([]byte, error)
	Verify(public kyber.Point, msg, sig []byte) error
}

Scheme is the minimal interface for a signature scheme. Implemented by BLS and TBLS

type ThresholdPolicy

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

ThresholdPolicy allows to specify a simple t-of-n policy requring that at least the given threshold number of participants t have cosigned to make a collective signature valid.

func NewThresholdPolicy

func NewThresholdPolicy(thold int) *ThresholdPolicy

NewThresholdPolicy returns a new ThresholdPolicy with the given threshold.

func (ThresholdPolicy) Check

Check verifies that at least a threshold number of participants have contributed to a collective signature.

type ThresholdScheme

type ThresholdScheme interface {
	Sign(private *share.PriShare, msg []byte) ([]byte, error)
	IndexOf(signature []byte) (int, error)
	Recover(public *share.PubPoly, msg []byte, sigs [][]byte, t, n int) ([]byte, error)
	VerifyPartial(public *share.PubPoly, msg, sig []byte) error
	VerifyRecovered(public kyber.Point, msg, sig []byte) error
}

ThresholdScheme is a threshold signature scheme that issues partial signatures and can recover a "full" signature. It is implemented by the tbls package. TODO: see any potential conflict or synergy with mask and policy

Directories

Path Synopsis
Package anon implements cryptographic primitives for anonymous communication.
Package anon implements cryptographic primitives for anonymous communication.
Package bdn implements the Boneh-Drijvers-Neven signature scheme which is an implementation of the bls package which is robust against rogue public-key attacks.
Package bdn implements the Boneh-Drijvers-Neven signature scheme which is an implementation of the bls package which is robust against rogue public-key attacks.
Package bls implements the Boneh-Lynn-Shacham (BLS) signature scheme which was introduced in the paper "Short Signatures from the Weil Pairing".
Package bls implements the Boneh-Lynn-Shacham (BLS) signature scheme which was introduced in the paper "Short Signatures from the Weil Pairing".
Package cosi implements the collective signing (CoSi) algorithm as presented in the paper "Keeping Authorities 'Honest or Bust' with Decentralized Witness Cosigning" by Ewa Syta et al.
Package cosi implements the collective signing (CoSi) algorithm as presented in the paper "Keeping Authorities 'Honest or Bust' with Decentralized Witness Cosigning" by Ewa Syta et al.
Package eddsa implements the EdDSA signature algorithm according to RFC8032.
Package eddsa implements the EdDSA signature algorithm according to RFC8032.
Package schnorr implements the vanilla Schnorr signature scheme.
Package schnorr implements the vanilla Schnorr signature scheme.
Package tbls implements the (t,n)-threshold Boneh-Lynn-Shacham signature scheme.
Package tbls implements the (t,n)-threshold Boneh-Lynn-Shacham signature scheme.

Jump to

Keyboard shortcuts

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