Documentation ¶
Overview ¶
Package bls implements a go-wrapper around a library implementing the the BLS12-381 curve and signature scheme. This package exposes a public API for verifying and aggregating BLS signatures used by Ethereum.
Index ¶
- Constants
- func AggregateCompressedSignatures(multiSigs [][]byte) (common.Signature, error)
- func AggregateSignatures(sigs []common.Signature) common.Signature
- func E2P(err error)
- func NewAggregateSignature() common.Signature
- func RandKey() (common.SecretKey, error)
- func SecretKeyFromRandom32Byte(ikm [32]byte) (common.SecretKey, error)
- func TestAggregateVerify2() error
- func TestAggregateVerify_CompressedSignatures2() error
- func TestCopy2() error
- func TestEth2FastAggregateVerify2() error
- func TestEth2FastAggregateVerify_ReturnsFalseOnEmptyPubKeyList2() error
- func TestEth2FastAggregateVerify_ReturnsTrueOnG2PointAtInfinity2() error
- func TestFastAggregateVerify2() error
- func TestFastAggregateVerify_ReturnsFalseOnEmptyPubKeyList2() error
- func TestMultipleSignatureFromBytes2() error
- func TestMultipleSignatureVerification2() error
- func TestSecretKeyFromBytes2() error
- func TestSignVerify2() error
- func TestSignatureFromBytes2() error
- func TestVerifyCompressed2() error
- func VerifyMultipleSignatures(sigs [][]byte, msgs [][32]byte, pubKeys []common.PublicKey) (bool, error)
- type PublicKey
- type SecretKey
- type Signature
- type SignatureBatch
- func (s *SignatureBatch) AggregateBatch() (*SignatureBatch, error)
- func (s *SignatureBatch) Copy() *SignatureBatch
- func (s *SignatureBatch) Join(set *SignatureBatch) *SignatureBatch
- func (s *SignatureBatch) RemoveDuplicates() (int, *SignatureBatch, error)
- func (s *SignatureBatch) Verify() (bool, error)
Constants ¶
const CurveOrder = "52435875175126190479447740508185965837690552500527637822603658699938581184513"
CurveOrder for the BLS12-381 curve.
const DomainByteLength = 4
DomainByteLength length of domain byte array.
Variables ¶
This section is empty.
Functions ¶
func AggregateCompressedSignatures ¶
AggregateCompressedSignatures converts a list of compressed signatures into a single, aggregated sig.
func AggregateSignatures ¶
AggregateSignatures converts a list of signatures into a single, aggregated sig.
func NewAggregateSignature ¶
NewAggregateSignature creates a blank aggregate signature.
func SecretKeyFromRandom32Byte ¶
SecretKeyFromRandom32Byte creates a new private key using random 32 bytes
func TestAggregateVerify2 ¶
func TestAggregateVerify2() error
func TestAggregateVerify_CompressedSignatures2 ¶
func TestAggregateVerify_CompressedSignatures2() error
func TestEth2FastAggregateVerify2 ¶
func TestEth2FastAggregateVerify2() error
func TestEth2FastAggregateVerify_ReturnsFalseOnEmptyPubKeyList2 ¶
func TestEth2FastAggregateVerify_ReturnsFalseOnEmptyPubKeyList2() error
func TestEth2FastAggregateVerify_ReturnsTrueOnG2PointAtInfinity2 ¶
func TestEth2FastAggregateVerify_ReturnsTrueOnG2PointAtInfinity2() error
func TestFastAggregateVerify2 ¶
func TestFastAggregateVerify2() error
func TestFastAggregateVerify_ReturnsFalseOnEmptyPubKeyList2 ¶
func TestFastAggregateVerify_ReturnsFalseOnEmptyPubKeyList2() error
func TestMultipleSignatureFromBytes2 ¶
func TestMultipleSignatureFromBytes2() error
func TestMultipleSignatureVerification2 ¶
func TestMultipleSignatureVerification2() error
func TestSecretKeyFromBytes2 ¶
func TestSecretKeyFromBytes2() error
func TestSignVerify2 ¶
func TestSignVerify2() error
func TestSignatureFromBytes2 ¶
func TestSignatureFromBytes2() error
func TestVerifyCompressed2 ¶
func TestVerifyCompressed2() error
Types ¶
type PublicKey ¶
PublicKey represents a BLS public key.
func AggregateMultiplePubkeys ¶
AggregateMultiplePubkeys aggregates the provided decompressed keys into a single key.
func AggregatePublicKeys ¶
AggregatePublicKeys aggregates the provided raw public keys into a single key.
func PublicKeyFromBytes ¶
PublicKeyFromBytes creates a BLS public key from a BigEndian byte slice.
type SecretKey ¶
SecretKey represents a BLS secret or private key.
func SecretKeyFromBytes ¶
SecretKeyFromBytes creates a BLS private key from a BigEndian byte slice.
type Signature ¶
Signature represents a BLS signature.
func MultipleSignaturesFromBytes ¶
MultipleSignaturesFromBytes creates a slice of BLS signatures from a LittleEndian 2d-byte slice.
func SignatureFromBytes ¶
SignatureFromBytes creates a BLS signature from a LittleEndian byte slice.
type SignatureBatch ¶
SignatureBatch refers to the defined set of signatures and its respective public keys and messages required to verify it.
func (*SignatureBatch) AggregateBatch ¶
func (s *SignatureBatch) AggregateBatch() (*SignatureBatch, error)
AggregateBatch aggregates common messages in the provided batch to reduce the number of pairings required when we finally verify the whole batch.
func (*SignatureBatch) Copy ¶
func (s *SignatureBatch) Copy() *SignatureBatch
Copy the attached signature batch and return it to the caller.
func (*SignatureBatch) Join ¶
func (s *SignatureBatch) Join(set *SignatureBatch) *SignatureBatch
Join merges the provided signature batch to out current one.
func (*SignatureBatch) RemoveDuplicates ¶
func (s *SignatureBatch) RemoveDuplicates() (int, *SignatureBatch, error)
RemoveDuplicates removes duplicate signature sets from the signature batch.
func (*SignatureBatch) Verify ¶
func (s *SignatureBatch) Verify() (bool, error)
Verify the current signature batch using the batch verify algorithm.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package blst implements a go-wrapper around a library implementing the the BLS12-381 curve and signature scheme.
|
Package blst implements a go-wrapper around a library implementing the the BLS12-381 curve and signature scheme. |
Package common provides the BLS interfaces that are implemented by the various BLS wrappers.
|
Package common provides the BLS interfaces that are implemented by the various BLS wrappers. |