Documentation ¶
Overview ¶
Package types implements the threshold collective signature and its verifier.
It wraps a signature implementation in order to extract the correct aggregated public key.
The messages have been implemented in this isolated package so that it does not create cycle imports when importing the serde formats.
Documentation Last Review: 05.10.2020
Index ¶
- func NewThresholdVerifierFactory(fac crypto.VerifierFactory) crypto.VerifierFactory
- func RegisterSignatureFormat(c serde.Format, f serde.FormatEngine)
- type AggKey
- type Signature
- func (s *Signature) Equal(o crypto.Signature) bool
- func (s *Signature) GetAggregate() crypto.Signature
- func (s *Signature) GetIndices() []int
- func (s *Signature) GetMask() []byte
- func (s *Signature) HasBit(index int) bool
- func (s *Signature) MarshalBinary() ([]byte, error)
- func (s *Signature) Merge(signer crypto.AggregateSigner, index int, sig crypto.Signature) error
- func (s *Signature) Serialize(ctx serde.Context) ([]byte, error)
- func (s *Signature) String() string
- type SignatureFactory
- type Verifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewThresholdVerifierFactory ¶
func NewThresholdVerifierFactory(fac crypto.VerifierFactory) crypto.VerifierFactory
NewThresholdVerifierFactory creates a new verifier factory from the underlying verifier factory.
func RegisterSignatureFormat ¶
func RegisterSignatureFormat(c serde.Format, f serde.FormatEngine)
RegisterSignatureFormat saves the format to be used when serializing/deserializing signature messages for the given codec.
Types ¶
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
Signature is a threshold signature which includes an aggregated signature and the mask of signers from the associated collective authority.
- implements crypto.Signature
func NewSignature ¶
NewSignature returns a new threshold signature.
func (*Signature) GetAggregate ¶
GetAggregate returns the aggregate of the signature which corresponds to the addition of the public keys enabled in the mask.
func (*Signature) GetIndices ¶
GetIndices returns the list of indices that have participated in the collective signature.
func (*Signature) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler.
type SignatureFactory ¶
type SignatureFactory struct {
// contains filtered or unexported fields
}
SignatureFactory is the factory to deserialize collective signature.
- implements crypto.SignatureFactory - implements serde.Factory
func NewSignatureFactory ¶
func NewSignatureFactory(f crypto.SignatureFactory) SignatureFactory
NewSignatureFactory returns a new signature factory.
func (SignatureFactory) Deserialize ¶
Deserialize implements serde.Factory. It populates the signature from the data if appropriate, otherwise it returns an error.
func (SignatureFactory) SignatureOf ¶
SignatureOf implements crypto.SignatureFactory. It populates the signature from the data if appropriate, otherwise it returns an error.