Documentation
¶
Index ¶
- Constants
- func ConvertToPublicKey(pub crypto.PubKey) (*bls.PublicKey, error)
- func ConvertToSignature(sig crypto.Signature) (*bls.Sign, error)
- type Driver
- func (d *Driver) Aggregate(sigs []crypto.Signature) (crypto.Signature, error)
- func (d *Driver) AggregatePublic(pubs []crypto.PubKey) (crypto.PubKey, error)
- func (d *Driver) GenKey() (k crypto.PrivKey, e error)
- func (d *Driver) PrivKeyFromBytes(b []byte) (privKey crypto.PrivKey, err error)
- func (d *Driver) PubKeyFromBytes(b []byte) (pubKey crypto.PubKey, err error)
- func (d *Driver) SignatureFromBytes(b []byte) (sig crypto.Signature, err error)
- func (d *Driver) Validate(msg, pub, sig []byte) error
- func (d *Driver) VerifyAggregatedN(pubs []crypto.PubKey, ms [][]byte, sig crypto.Signature) error
- func (d *Driver) VerifyAggregatedOne(pubs []crypto.PubKey, m []byte, sig crypto.Signature) error
- type PrivKeyBLS
- type PubKeyBLS
- type SignatureBLS
- type SignatureS
Constants ¶
View Source
const ( BLSPrivateKeyLength = 32 BLSPublicKeyLength = 48 BLSSignatureLength = 96 BLSMsgHashSize = 32 )
Variables ¶
This section is empty.
Functions ¶
func ConvertToPublicKey ¶
ConvertToPublicKey convert to BLS PublicKey
Types ¶
type Driver ¶
type Driver struct{}
Driver driver
func (*Driver) AggregatePublic ¶
func (*Driver) PrivKeyFromBytes ¶
PrivKeyFromBytes create private key from bytes
func (*Driver) PubKeyFromBytes ¶
PubKeyFromBytes create public key from bytes
func (*Driver) SignatureFromBytes ¶
SignatureFromBytes create signature from bytes
func (*Driver) VerifyAggregatedN ¶
由于cgo库的规则,需要每个ms都不大于32byte,或者后面
type PrivKeyBLS ¶
type PrivKeyBLS [BLSPrivateKeyLength]byte
PrivKeyBLS PrivKey
func (PrivKeyBLS) Equals ¶
func (privKey PrivKeyBLS) Equals(other crypto.PrivKey) bool
Equals check privkey is equal
func (PrivKeyBLS) PubKey ¶
func (privKey PrivKeyBLS) PubKey() crypto.PubKey
PubKey convert to public key
type PubKeyBLS ¶
type PubKeyBLS [BLSPublicKeyLength]byte
PubKeyBLS PubKey
type SignatureBLS ¶
type SignatureBLS [BLSSignatureLength]byte
SignatureBLS Signature
func (SignatureBLS) Equals ¶
func (sig SignatureBLS) Equals(other crypto.Signature) bool
Equals check signature equals
func (SignatureBLS) String ¶
func (sig SignatureBLS) String() string
String convert signature to string
Click to show internal directories.
Click to hide internal directories.