bls

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2022 License: Apache-2.0, MIT Imports: 1 Imported by: 15

Documentation

Index

Constants

View Source
const (
	MODULUS377        = blsRoute.MODULUS377
	MODULUSBITS       = blsRoute.MODULUSBITS
	MODULUSMASK       = blsRoute.MODULUSMASK
	PRIVATEKEYBYTES   = blsRoute.PRIVATEKEYBYTES
	PUBLICKEYBYTES    = blsRoute.PUBLICKEYBYTES
	SIGNATUREBYTES    = blsRoute.SIGNATUREBYTES
	EPOCHENTROPYBYTES = blsRoute.EPOCHENTROPYBYTES
)

Variables

View Source
var (
	GeneralError       = blsRoute.GeneralError
	NotVerifiedError   = blsRoute.NotVerifiedError
	IncorrectSizeError = blsRoute.IncorrectSizeError
	NilPointerError    = blsRoute.NilPointerError
	EmptySliceError    = blsRoute.EmptySliceError
)

Functions

func BatchVerifyEpochs

func BatchVerifyEpochs(signedHeaders []*SignedBlockHeader, shouldUseCompositeHasher, shouldUseCIP22 bool) error

func BatchVerifyStrict added in v0.6.1

func BatchVerifyStrict(batches []*Batch, shouldUseCompositeHasher, shouldUseCIP22 bool) ([]bool, error)

func CompressPublickey

func CompressPublickey(pubkey []byte) ([]byte, error)

func CompressSignature

func CompressSignature(signature []byte) ([]byte, error)

func EncodeEpochToBytes

func EncodeEpochToBytes(epochIndex uint16, maximumNonSigners uint32, addedPublicKeys []*PublicKey) ([]byte, error)

func EncodeEpochToBytesCIP22 added in v0.2.4

func EncodeEpochToBytesCIP22(epochIndex uint16, round uint8, blockHash, parentHash EpochEntropy, maximumNonSigners, maximumValidators uint32, addedPublicKeys []*PublicKey) ([]byte, []byte, error)

func HashCRH added in v0.2.5

func HashCRH(message []byte, hashBytes int32) ([]byte, error)

func HashComposite

func HashComposite(message []byte, extraData []byte) ([]byte, error)

func HashCompositeCIP22 added in v0.2.5

func HashCompositeCIP22(message []byte, extraData []byte) ([]byte, uint8, error)

func HashDirect

func HashDirect(message []byte, usePoP bool) ([]byte, error)

func HashDirectFirstStep added in v0.3.0

func HashDirectFirstStep(message []byte, hashBytes int32) ([]byte, error)

func HashDirectWithAttempt added in v0.3.0

func HashDirectWithAttempt(message []byte, usePoP bool) ([]byte, uint, error)

func InitBLSCrypto

func InitBLSCrypto()

Types

type Batch added in v0.6.1

type Batch = blsRoute.Batch

type EpochEntropy added in v0.2.4

type EpochEntropy = blsRoute.EpochEntropy

type PrivateKey

type PrivateKey = blsRoute.PrivateKey

func DeserializePrivateKey

func DeserializePrivateKey(privateKeyBytes []byte) (*PrivateKey, error)

func GeneratePrivateKey

func GeneratePrivateKey() (*PrivateKey, error)

type PublicKey

type PublicKey = blsRoute.PublicKey

func AggregatePublicKeys

func AggregatePublicKeys(publicKeys []*PublicKey) (*PublicKey, error)

func AggregatePublicKeysSubtract

func AggregatePublicKeysSubtract(aggregatedPublicKey *PublicKey, publicKeys []*PublicKey) (*PublicKey, error)

func DeserializePublicKey

func DeserializePublicKey(publicKeyBytes []byte) (*PublicKey, error)

func DeserializePublicKeyCached

func DeserializePublicKeyCached(publicKeyBytes []byte) (*PublicKey, error)

type Signature

type Signature = blsRoute.Signature

func AggregateSignatures

func AggregateSignatures(signatures []*Signature) (*Signature, error)

func DeserializeSignature

func DeserializeSignature(signatureBytes []byte) (*Signature, error)

type SignedBlockHeader

type SignedBlockHeader = blsRoute.SignedBlockHeader

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL