Documentation ¶
Index ¶
- func AggregateVerify(pubkeys []*Pubkey, messages [][]byte, signature *Signature) bool
- func Eth2FastAggregateVerify(pubkeys []*Pubkey, message []byte, signature *Signature) bool
- func FastAggregateVerify(pubkeys []*Pubkey, message []byte, signature *Signature) bool
- func SignatureSetVerify(pubkeys []*Pubkey, messages [][]byte, signatures []*Signature) (bool, error)
- func Verify(pk *Pubkey, message []byte, signature *Signature) bool
- type DeferBLS
- type ImmediateCheck
- func (i ImmediateCheck) AggregateVerify(pubkeys []*Pubkey, messages [][]byte, signature *Signature) error
- func (i ImmediateCheck) Check() error
- func (i ImmediateCheck) Eth2FastAggregateVerify(pubkeys []*Pubkey, message []byte, signature *Signature) error
- func (i ImmediateCheck) FastAggregateVerify(pubkeys []*Pubkey, message []byte, signature *Signature) error
- func (i ImmediateCheck) Verify(pk *Pubkey, message []byte, signature *Signature) error
- type Pubkey
- type SecretKey
- type Signature
- type SignatureSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateVerify ¶
The AggregateVerify algorithm checks an aggregated signature over several (PK, message) pairs.
func Eth2FastAggregateVerify ¶
Wrapper to FastAggregateVerify accepting the G2_POINT_AT_INFINITY signature when pubkeys is empty.
func FastAggregateVerify ¶
FastAggregateVerify is a verification algorithm for the aggregate of multiple signatures on the same message. This function is faster than AggregateVerify.
This function applies only to the Proof Of Possession signature scheme.
func SignatureSetVerify ¶
func SignatureSetVerify(pubkeys []*Pubkey, messages [][]byte, signatures []*Signature) (bool, error)
SignatureSetVerify verifies (pubkey,message,signature) tuples as a single batch, and is faster than len(inputs) times Verify if the batch is not too small.
The caller should aggregate pubkeys and signatures if they signed the same message, this verification is safe to run on duplicate inputs, but not optimized for it.
A completely empty input is also considered to be VALID.
This function parallelizes the scalar-multiplication and signature-aggregation work.
An error is returned if the verification failed due to an operational error, e.g. input length mismatch or failing to read entropy bytes with the crypto/rand package.
Original: https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407
Types ¶
type DeferBLS ¶
type DeferBLS interface { // AggregateVerify checks an aggregated signature over several (PK, message) pairs, // and may be deferred until Check(). AggregateVerify(pubkeys []*Pubkey, messages [][]byte, signature *Signature) error // Verify checks an aggregated signature over several (PK, message) pairs, // and may be deferred until Check(). Verify(pk *Pubkey, message []byte, signature *Signature) error // FastAggregateVerify verifies the aggregate of multiple signatures on the same message, // and may be deferred until Check(). FastAggregateVerify(pubkeys []*Pubkey, message []byte, signature *Signature) error // Eth2FastAggregateVerify wraps FastAggregateVerify and accepts // the G2_POINT_AT_INFINITY signature when pubkeys is empty, // and may be deferred until Check(). Eth2FastAggregateVerify(pubkeys []*Pubkey, message []byte, signature *Signature) error // Check checks if the aggregate deferred BLS signatures are valid Check() error }
func NewAggregateCheck ¶
func NewAggregateCheck() DeferBLS
NewAggregateCheck returns a signature-set that implements DeferBLS
type ImmediateCheck ¶
type ImmediateCheck struct{}
ImmediateCheck implements DeferBLS without deferring anything, i.e. signature checks will be performed immediately.
func (ImmediateCheck) AggregateVerify ¶
func (i ImmediateCheck) AggregateVerify(pubkeys []*Pubkey, messages [][]byte, signature *Signature) error
func (ImmediateCheck) Check ¶
func (i ImmediateCheck) Check() error
func (ImmediateCheck) Eth2FastAggregateVerify ¶
func (i ImmediateCheck) Eth2FastAggregateVerify(pubkeys []*Pubkey, message []byte, signature *Signature) error
func (ImmediateCheck) FastAggregateVerify ¶
func (i ImmediateCheck) FastAggregateVerify(pubkeys []*Pubkey, message []byte, signature *Signature) error
type Pubkey ¶
func AggregatePubkeys ¶
AggregatePubkeys is specified as `eth2_aggregate_pubkeys` in Eth2, and is the G1 variant of Aggregate in G2.
func SkToPk ¶
The SkToPk algorithm takes a secret key SK and outputs the corresponding public key PK.
func (*Pubkey) Deserialize ¶
Deserialize compressed point. Performs deserialization, a subgroup check, but not a full KeyValidate: the identity pubkey is allowed. Functions that are specified to perform a KeyValidate on a Pubkey can ignore it, after deserializing a valid *Pubkey, EXCEPT the identity pubkey check.
type SecretKey ¶
func (*SecretKey) Deserialize ¶
Deserialize big-endian serialized integer. A modulo r is applied to out-of-range keys.
type Signature ¶
func Sign ¶
The Sign algorithm computes a signature from SK, a secret key, and message, an octet string.
func (*Signature) Deserialize ¶
Deserialize compressed point
type SignatureSet ¶
type SignatureSet struct {
// contains filtered or unexported fields
}
func (*SignatureSet) Add ¶
func (s *SignatureSet) Add(pubkey *Pubkey, message []byte, signature *Signature)
func (*SignatureSet) Verify ¶
func (s *SignatureSet) Verify() bool