Documentation ¶
Overview ¶
Package sign contains useful tools for the different signing algorithms.
Index ¶
- type AggregatableScheme
- type CompletePolicy
- type Mask
- func (m *Mask) CountEnabled() int
- func (m *Mask) CountTotal() int
- func (m *Mask) IndexOfNthEnabled(nth int) int
- func (m *Mask) Len() int
- func (m *Mask) Mask() []byte
- func (m *Mask) Merge(mask []byte) error
- func (m *Mask) NthEnabledAtIndex(idx int) int
- func (m *Mask) Participants() []kyber.Point
- func (m *Mask) Publics() []kyber.Point
- func (m *Mask) SetBit(i int, enable bool) error
- func (m *Mask) SetMask(mask []byte) error
- type ParticipationMask
- type Policy
- type Scheme
- type ThresholdPolicy
- type ThresholdScheme
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 ¶
func (p CompletePolicy) Check(m ParticipationMask) bool
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 ¶
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 ¶
CountEnabled returns the number of bit set to 1
func (*Mask) CountTotal ¶
CountTotal returns the number of potential participants
func (*Mask) IndexOfNthEnabled ¶
IndexOfNthEnabled returns the index of the nth enabled bit or -1 if out of bounds.
func (*Mask) NthEnabledAtIndex ¶
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 ¶
Participants returns the list of public keys participating.
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 ¶
func (p ThresholdPolicy) Check(m ParticipationMask) bool
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. |