Documentation
¶
Index ¶
- func AggregateVerify(publicKeys []*PublicKey, messages [][]byte, aggSignature *Signature) (bool, error)
- func BatchVerify(publicKeys []*PublicKey, message []byte, signatures []*Signature) (bool, error)
- func GenerateKeyPair() (*PrivateKey, *PublicKey, error)
- func GenerateKeyPairEIP2333(seed []byte, path []uint32) (*PrivateKey, *PublicKey, error)
- func GenerateKeyPairFromSeed(seed []byte) (*PrivateKey, *PublicKey, error)
- type PrivateKey
- type PublicKey
- type Scheme
- func (s *Scheme) AggregateSignatures(signatures []signing.Signature) (signing.Signature, error)
- func (s *Scheme) AggregateVerify(publicKeys []signing.PublicKey, messages [][]byte, ...) (bool, error)
- func (s *Scheme) BatchVerify(publicKeys []signing.PublicKey, message []byte, signatures []signing.Signature) (bool, error)
- func (s *Scheme) GenerateKeyPair() (signing.PrivateKey, signing.PublicKey, error)
- func (s *Scheme) GenerateKeyPairEIP2333(seed []byte, path []uint32) (signing.PrivateKey, signing.PublicKey, error)
- func (s *Scheme) GenerateKeyPairFromSeed(seed []byte) (signing.PrivateKey, signing.PublicKey, error)
- func (s *Scheme) NewPrivateKeyFromBytes(data []byte) (signing.PrivateKey, error)
- func (s *Scheme) NewPrivateKeyFromHexString(hex string) (signing.PrivateKey, error)
- func (s *Scheme) NewPublicKeyFromBytes(data []byte) (signing.PublicKey, error)
- func (s *Scheme) NewPublicKeyFromHexString(hex string) (signing.PublicKey, error)
- func (s *Scheme) NewSignatureFromBytes(data []byte) (signing.Signature, error)
- type Signature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateVerify ¶
func AggregateVerify(publicKeys []*PublicKey, messages [][]byte, aggSignature *Signature) (bool, error)
AggregateVerify verifies an aggregated signature against multiple public keys and multiple messages
func BatchVerify ¶
BatchVerify verifies multiple signatures in a single batch operation Each signature corresponds to the same message signed by different public keys
func GenerateKeyPair ¶
func GenerateKeyPair() (*PrivateKey, *PublicKey, error)
GenerateKeyPair creates a new random private key and the corresponding public key
func GenerateKeyPairEIP2333 ¶
func GenerateKeyPairEIP2333(seed []byte, path []uint32) (*PrivateKey, *PublicKey, error)
GenerateKeyPairEIP2333 creates a deterministic private key and the corresponding public key using the EIP-2333 standard Implements the EIP-2333 hierarchical deterministic key generation for BLS signatures See: https://eips.ethereum.org/EIPS/eip-2333
func GenerateKeyPairFromSeed ¶
func GenerateKeyPairFromSeed(seed []byte) (*PrivateKey, *PublicKey, error)
GenerateKeyPairFromSeed creates a deterministic private key and the corresponding public key from a seed
Types ¶
type PrivateKey ¶
type PrivateKey struct {
ScalarBytes []byte
// contains filtered or unexported fields
}
PrivateKey represents a BLS private key
func NewPrivateKeyFromBytes ¶
func NewPrivateKeyFromBytes(data []byte) (*PrivateKey, error)
NewPrivateKeyFromBytes creates a private key from bytes
func NewPrivateKeyFromHexString ¶ added in v0.0.2
func NewPrivateKeyFromHexString(hexStr string) (*PrivateKey, error)
NewPrivateKeyFromHexString creates a private key from a hex string
func (*PrivateKey) Bytes ¶
func (pk *PrivateKey) Bytes() []byte
Bytes returns the private key as a byte slice
func (*PrivateKey) Public ¶
func (pk *PrivateKey) Public() *PublicKey
Public returns the public key corresponding to the private key
func (*PrivateKey) Sign ¶
func (pk *PrivateKey) Sign(message []byte) (*Signature, error)
Sign signs a message using the private key
func (*PrivateKey) ToHex ¶ added in v0.0.2
func (pk *PrivateKey) ToHex() (string, error)
ToHex returns the private key as a hex string
type PublicKey ¶
type PublicKey struct {
PointBytes []byte
// contains filtered or unexported fields
}
PublicKey represents a BLS public key
func NewPublicKeyFromBytes ¶
NewPublicKeyFromBytes creates a public key from bytes
func (*PublicKey) GetG1Point ¶
GetG1Point returns the G1 point of the public key
func (*PublicKey) GetG2Point ¶
GetG2Point returns the G2 point of the public key
type Scheme ¶
type Scheme struct{}
Scheme implements the SigningScheme interface for BLS381
func (*Scheme) AggregateSignatures ¶
AggregateSignatures combines multiple signatures into a single signature
func (*Scheme) AggregateVerify ¶
func (s *Scheme) AggregateVerify(publicKeys []signing.PublicKey, messages [][]byte, aggSignature signing.Signature) (bool, error)
AggregateVerify verifies an aggregated signature against multiple public keys and multiple messages
func (*Scheme) BatchVerify ¶
func (s *Scheme) BatchVerify(publicKeys []signing.PublicKey, message []byte, signatures []signing.Signature) (bool, error)
BatchVerify verifies multiple signatures in a single batch operation
func (*Scheme) GenerateKeyPair ¶
GenerateKeyPair creates a new random private key and the corresponding public key
func (*Scheme) GenerateKeyPairEIP2333 ¶
func (s *Scheme) GenerateKeyPairEIP2333(seed []byte, path []uint32) (signing.PrivateKey, signing.PublicKey, error)
GenerateKeyPairEIP2333 creates a deterministic private key and the corresponding public key using the EIP-2333 standard
func (*Scheme) GenerateKeyPairFromSeed ¶
func (s *Scheme) GenerateKeyPairFromSeed(seed []byte) (signing.PrivateKey, signing.PublicKey, error)
GenerateKeyPairFromSeed creates a deterministic private key and the corresponding public key from a seed
func (*Scheme) NewPrivateKeyFromBytes ¶
func (s *Scheme) NewPrivateKeyFromBytes(data []byte) (signing.PrivateKey, error)
NewPrivateKeyFromBytes creates a private key from bytes
func (*Scheme) NewPrivateKeyFromHexString ¶ added in v0.0.2
func (s *Scheme) NewPrivateKeyFromHexString(hex string) (signing.PrivateKey, error)
NewPrivateKeyFromHexString creates a private key from a hex string
func (*Scheme) NewPublicKeyFromBytes ¶
NewPublicKeyFromBytes creates a public key from bytes
func (*Scheme) NewPublicKeyFromHexString ¶
type Signature ¶
type Signature struct {
SigBytes []byte
// contains filtered or unexported fields
}
Signature represents a BLS signature
func AggregateSignatures ¶
AggregateSignatures combines multiple signatures into a single signature
func NewSignatureFromBytes ¶
NewSignatureFromBytes creates a signature from bytes