Documentation ¶
Index ¶
- func Verify(m []byte, pub *PublicKey, sig *Signature) bool
- func VerifyWithDomain(m [32]byte, pub *PublicKey, sig *Signature, domain [8]byte) bool
- type PublicKey
- type SecretKey
- type Signature
- func AggregateSignatures(s []*Signature) *Signature
- func DeserializeSignature(b [96]byte) (*Signature, error)
- func NewAggregateSignature() *Signature
- func NewSignatureFromG2(g2 *bls.G2Affine) *Signature
- func Sign(message []byte, key *SecretKey) *Signature
- func SignWithDomain(message [32]byte, key *SecretKey, domain [8]byte) *Signature
- func (s *Signature) Aggregate(other *Signature)
- func (s *Signature) Copy() *Signature
- func (s *Signature) GetPoint() *bls.G2Projective
- func (s *Signature) Serialize() [96]byte
- func (s *Signature) String() string
- func (s *Signature) VerifyAggregate(pubKeys []*PublicKey, msgs [][]byte) bool
- func (s *Signature) VerifyAggregateCommon(pubKeys []*PublicKey, msg []byte) bool
- func (s *Signature) VerifyAggregateCommonWithDomain(pubKeys []*PublicKey, msg [32]byte, domain [8]byte) bool
- func (s *Signature) VerifyAggregateWithDomain(pubKeys []*PublicKey, msgs [][32]byte, domain [8]byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey is a public key.
func AggregatePublicKeys ¶
AggregatePublicKeys adds public keys together.
func DeserializePublicKey ¶
DeserializePublicKey deserializes a public key from bytes.
func NewAggregatePubkey ¶
func NewAggregatePubkey() *PublicKey
NewAggregatePubkey creates a blank public key.
func NewPublicKeyFromG1 ¶
NewPublicKeyFromG1 creates a new public key from a G1 element.
func (*PublicKey) GetPoint ¶
func (p *PublicKey) GetPoint() *bls.G1Projective
GetPoint gets the G1 point associated with the public key.
type SecretKey ¶
type SecretKey struct {
// contains filtered or unexported fields
}
SecretKey represents a BLS private key.
func DeriveSecretKey ¶
DeriveSecretKey derives a secret key from bytes.
func DeserializeSecretKey ¶
DeserializeSecretKey deserializes a secret key from bytes.
func KeyFromFQRepr ¶
KeyFromFQRepr returns a new key based on a FQRepr in FR.
func (SecretKey) GetFRElement ¶
GetFRElement gets the underlying FR element.
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
Signature is a message signature.
func AggregateSignatures ¶
AggregateSignatures adds up all of the signatures.
func DeserializeSignature ¶
DeserializeSignature deserializes a signature from bytes.
func NewAggregateSignature ¶
func NewAggregateSignature() *Signature
NewAggregateSignature creates a blank aggregate signature.
func NewSignatureFromG2 ¶
NewSignatureFromG2 creates a new signature from a G2 element.
func SignWithDomain ¶
SignWithDomain signs a message with a secret key and its domain.
func (*Signature) GetPoint ¶
func (s *Signature) GetPoint() *bls.G2Projective
GetPoint gets the G2 point associated with the signature.
func (*Signature) VerifyAggregate ¶
VerifyAggregate verifies each public key against each message.
func (*Signature) VerifyAggregateCommon ¶
VerifyAggregateCommon verifies each public key against a message. This is vulnerable to rogue public-key attack. Each user must provide a proof-of-knowledge of the public key.