Versions in this module Expand all Collapse all v1 v1.2.2 Apr 7, 2024 Changes in this version + const BLS12377Curve + const BLS12381Curve + const BLSCryptoType + const BN256Curve + const EPOCHENTROPYBYTES + const G1PUBLICKEYBYTES + const MODULUS256 + const MODULUSBITS + const MODULUSMASK + const PUBLICKEYBYTES + const SIGNATUREBYTES + func GenKeyPair(randReader io.Reader) (*PublicKey, *SecretKey, error) + func PerformHash(msg []byte) ([]byte, error) + func PrivateToG1Public(privateKeyBytes []byte) ([]byte, error) + func PrivateToPublic(privateKeyBytes []byte) ([]byte, error) + func UnmarshalG1Pk(g1pkmsg []byte) (*cfbn256.G1, error) + func Verify(apk *Apk, msg []byte, sigma *Signature) error + func Verify2(apk *Apk, msg []byte, sigma *Signature) error + func VerifyBatch(apks []*Apk, msgs [][]byte, sigma *Signature) error + func VerifyCompressed(pks []*cfbn256.G2, msgList [][]byte, compressedSig []byte, allowDistinct bool) error + func VerifyG1Pk(g1pk []byte, g2pk []byte) error + func VerifyUnsafe(pkey *PublicKey, msg []byte, signature *UnsafeSignature) error + func VerifyUnsafe2(pkey *PublicKey, msg []byte, signature *UnsafeSignature) error + func VerifyUnsafeBatch(pkeys []*PublicKey, msgList [][]byte, signature *UnsafeSignature) error + type Apk struct + func AggregateApk(pks []*PublicKey) (*Apk, error) + func NewApk(pk *PublicKey) *Apk + func UnmarshalApk(b []byte) (*Apk, error) + func (apk *Apk) Aggregate(pk *PublicKey) error + func (apk *Apk) AggregateBytes(b []byte) error + func (apk *Apk) Copy() *Apk + type BLSCryptoSelector interface + AggregateSignatures func(signatures [][]byte) ([]byte, error) + ECDSAToBLS func(privateKeyECDSA *ecdsa.PrivateKey) ([]byte, error) + EncodeEpochSnarkDataCIP22 func(newValSet []SerializedPublicKey, maximumNonSigners, maxValidators uint32, ...) ([]byte, []byte, error) + PrivateToG1Public func(privateKeyBytes []byte) (SerializedG1PublicKey, error) + PrivateToPublic func(privateKeyBytes []byte) (SerializedPublicKey, error) + UncompressKey func(serialized SerializedPublicKey) ([]byte, error) + VerifyAggregatedSignature func(publicKeys []SerializedPublicKey, message []byte, extraData []byte, ...) error + VerifySignature func(publicKey SerializedPublicKey, message []byte, extraData []byte, ...) error + func CryptoType() BLSCryptoSelector + type BN256 struct + func (BN256) AggregateSignatures(signatures [][]byte) ([]byte, error) + func (BN256) ECDSAToBLS(privateKeyECDSA *ecdsa.PrivateKey) ([]byte, error) + func (BN256) EncodeEpochSnarkDataCIP22(newValSet []SerializedPublicKey, maximumNonSigners, maxValidators uint32, ...) ([]byte, []byte, error) + func (BN256) PrivateToG1Public(privateKeyBytes []byte) (SerializedG1PublicKey, error) + func (BN256) PrivateToPublic(privateKeyBytes []byte) (SerializedPublicKey, error) + func (BN256) UncompressKey(serialized SerializedPublicKey) ([]byte, error) + func (BN256) VerifyAggregatedSignature(publicKeys []SerializedPublicKey, message []byte, extraData []byte, ...) error + func (BN256) VerifySignature(publicKey SerializedPublicKey, message []byte, extraData []byte, ...) error + type EpochEntropy [EPOCHENTROPYBYTES]byte + func EpochEntropyFromHash(hash common.Hash) EpochEntropy + type PublicKey struct + func AggregatePK(pks []*PublicKey) *PublicKey + func UnmarshalPk(b []byte) (*PublicKey, error) + func (pk *PublicKey) Aggregate(pp *PublicKey) *PublicKey + func (pk *PublicKey) Marshal() []byte + func (pk *PublicKey) MarshalText() ([]byte, error) + func (pk *PublicKey) Unmarshal(data []byte) error + func (pk *PublicKey) UnmarshalText(data []byte) error + type SecretKey struct + func DeserializePrivateKey(privateKeyBytes []byte) (*SecretKey, error) + func (self *SecretKey) Serialize() ([]byte, error) + func (self *SecretKey) ToG1Public() []byte + func (self *SecretKey) ToPublic() *PublicKey + type SerializedG1PublicKey [G1PUBLICKEYBYTES]byte + func (pk *SerializedG1PublicKey) UnmarshalJSON(input []byte) error + func (pk *SerializedG1PublicKey) UnmarshalText(input []byte) error + func (pk SerializedG1PublicKey) MarshalText() ([]byte, error) + type SerializedPublicKey [PUBLICKEYBYTES]byte + func (pk *SerializedPublicKey) UnmarshalJSON(input []byte) error + func (pk *SerializedPublicKey) UnmarshalText(input []byte) error + func (pk SerializedPublicKey) MarshalText() ([]byte, error) + type SerializedSignature [SIGNATUREBYTES]byte + func SerializedSignatureFromBytes(serializedSignature []byte) (SerializedSignature, error) + func (sig *SerializedSignature) UnmarshalJSON(input []byte) error + func (sig *SerializedSignature) UnmarshalText(input []byte) error + func (sig SerializedSignature) MarshalText() ([]byte, error) + type Signature struct + func Sign(sk *SecretKey, pk *PublicKey, msg []byte) (*Signature, error) + func Sign2(sk *SecretKey, pk *PublicKey, msg []byte) (*Signature, error) + func UnmarshalSignature(sig []byte) (*Signature, error) + func (sigma *Signature) Add(pk *PublicKey, sig *UnsafeSignature) error + func (sigma *Signature) Aggregate(other *Signature) *Signature + func (sigma *Signature) AggregateBytes(other []byte) error + func (sigma *Signature) Compress() []byte + func (sigma *Signature) Copy() *Signature + func (sigma *Signature) Decompress(x []byte) error + func (sigma *Signature) Marshal() []byte + func (sigma *Signature) Unmarshal(msg []byte) error + type UnsafeSignature struct + func UnsafeAggregate(one, other *UnsafeSignature) *UnsafeSignature + func UnsafeBatch(sigs ...*UnsafeSignature) (*UnsafeSignature, error) + func UnsafeSign(key *SecretKey, msg []byte) (*UnsafeSignature, error) + func UnsafeSign2(key *SecretKey, msg []byte) (*UnsafeSignature, error) + func (usig *UnsafeSignature) Compress() []byte + func (usig *UnsafeSignature) Decompress(x []byte) error + func (usig *UnsafeSignature) Marshal() []byte + func (usig *UnsafeSignature) Unmarshal(msg []byte) error