blscrypto

package
v0.0.0-...-7de49f1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PUBLICKEYBYTES    = bls.PUBLICKEYBYTES
	SIGNATUREBYTES    = bls.SIGNATUREBYTES
	EPOCHENTROPYBYTES = bls.EPOCHENTROPYBYTES
)

Variables

This section is empty.

Functions

func AggregateSignatures

func AggregateSignatures(signatures [][]byte) ([]byte, error)

func ECDSAToBLS

func ECDSAToBLS(privateKeyECDSA *ecdsa.PrivateKey) ([]byte, error)

func EncodeEpochSnarkData

func EncodeEpochSnarkData(newValSet []SerializedPublicKey, maximumNonSigners uint32, epochIndex uint16) ([]byte, []byte, error)

func EncodeEpochSnarkDataCIP22

func EncodeEpochSnarkDataCIP22(newValSet []SerializedPublicKey, maximumNonSigners, maxValidators uint32, epochIndex uint16, round uint8, blockHash, parentHash bls.EpochEntropy) ([]byte, []byte, error)

func EpochEntropyFromHash

func EpochEntropyFromHash(hash common.Hash) bls.EpochEntropy

EpochEntropyFromHash truncates the given hash to the length of epoch SNARK entropy.

func UncompressKey

func UncompressKey(serialized SerializedPublicKey) ([]byte, error)

func VerifyAggregatedSignature

func VerifyAggregatedSignature(publicKeys []SerializedPublicKey, message []byte, extraData []byte, signature []byte, shouldUseCompositeHasher, cip22 bool) error

func VerifySignature

func VerifySignature(publicKey SerializedPublicKey, message []byte, extraData []byte, signature []byte, shouldUseCompositeHasher, cip22 bool) error

Types

type SerializedPublicKey

type SerializedPublicKey [PUBLICKEYBYTES]byte

func PrivateToPublic

func PrivateToPublic(privateKeyBytes []byte) (SerializedPublicKey, error)

func (SerializedPublicKey) MarshalText

func (pk SerializedPublicKey) MarshalText() ([]byte, error)

MarshalText returns the hex representation of pk.

func (*SerializedPublicKey) UnmarshalJSON

func (pk *SerializedPublicKey) UnmarshalJSON(input []byte) error

UnmarshalJSON parses a BLS public key in hex syntax.

func (*SerializedPublicKey) UnmarshalText

func (pk *SerializedPublicKey) UnmarshalText(input []byte) error

UnmarshalText parses a BLS public key in hex syntax.

type SerializedSignature

type SerializedSignature [SIGNATUREBYTES]byte

func SerializedSignatureFromBytes

func SerializedSignatureFromBytes(serializedSignature []byte) (SerializedSignature, error)

func (SerializedSignature) MarshalText

func (sig SerializedSignature) MarshalText() ([]byte, error)

MarshalText returns the hex representation of sig.

func (*SerializedSignature) UnmarshalJSON

func (sig *SerializedSignature) UnmarshalJSON(input []byte) error

UnmarshalJSON parses a BLS signature in hex syntax.

func (*SerializedSignature) UnmarshalText

func (sig *SerializedSignature) UnmarshalText(input []byte) error

UnmarshalText parses a BLS signature in hex syntax.

Jump to

Keyboard shortcuts

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