Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // domain used to map hash to G1 used by (child) validator set DomainValidatorSet = pcrypto.Keccak256([]byte("DOMAIN_CHILD_VALIDATOR_SET")) // domain used to map hash to G1 used by child checkpoint manager DomainCheckpointManager = pcrypto.Keccak256([]byte("DOMAIN_CHECKPOINT_MANAGER")) DomainCommonSigning = pcrypto.Keccak256([]byte("DOMAIN_COMMON_SIGNING")) DomainStateReceiver = pcrypto.Keccak256([]byte("DOMAIN_STATE_RECEIVER")) )
Functions ¶
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
PrivateKey holds private key for bls implementation
func CreateRandomBlsKeys ¶
func CreateRandomBlsKeys(total int) ([]*PrivateKey, error)
CreateRandomBlsKeys creates an array of random private and their corresponding public keys
func GenerateBlsKey ¶
func GenerateBlsKey() (*PrivateKey, error)
GenerateBlsKey creates a random private and its corresponding public keys
func UnmarshalPrivateKey ¶
func UnmarshalPrivateKey(data []byte) (*PrivateKey, error)
UnmarshalPrivateKey unmarshals the private key from the given byte slice
func (*PrivateKey) Marshal ¶
func (p *PrivateKey) Marshal() ([]byte, error)
Marshal marshals private key to byte slice
func (*PrivateKey) PublicKey ¶
func (p *PrivateKey) PublicKey() *PublicKey
PublicKey returns the public key from the PrivateKey
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey represents bls public key
func UnmarshalPublicKey ¶
UnmarshalPublicKey unmarshals bytes to public key
func UnmarshalPublicKeyFromBigInt ¶
UnmarshalPublicKeyFromBigInt unmarshals public key from 4 big ints Order of coordinates is [A.Y, A.X, B.Y, B.X]
func (*PublicKey) MarshalText ¶
MarshalText implements the json.Marshaler interface.
func (*PublicKey) UnmarshalText ¶
UnmarshalText implements encoding.TextMarshaler interface
type PublicKeys ¶
type PublicKeys []*PublicKey
func (PublicKeys) Aggregate ¶
func (pks PublicKeys) Aggregate() *PublicKey
Aggregate aggregates all public keys into one
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
Signature represents bls signature which is point on the curve
func UnmarshalSignature ¶
UnmarshalSignature reads the signature from the given byte array
func (Signature) ToBigInt ¶
ToBigInt marshalls signature (which is point) to 2 big ints - one for each coordinate
type Signatures ¶
type Signatures []*Signature
Signatures is a slice of signatures
func (Signatures) Aggregate ¶
func (sigs Signatures) Aggregate() *Signature
Aggregate aggregates all signatures into one