bls

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToKeystore

func ToKeystore(k *Key, password string) ([]byte, error)

Types

type Key

type Key struct {
	Id  string
	Pub *PublicKey
	Prv *SecretKey
}

Key is a reference to a key in the keymanager

func FromKeystore

func FromKeystore(content []byte, password string) (*Key, error)

func NewKeyFromPriv

func NewKeyFromPriv(priv []byte) (*Key, error)

func NewRandomKey

func NewRandomKey() *Key

func (*Key) Equal

func (k *Key) Equal(kk *Key) bool

func (*Key) Marshal

func (k *Key) Marshal() ([]byte, error)

func (*Key) PubKey

func (k *Key) PubKey() (out [48]byte)

func (*Key) Sign

func (k *Key) Sign(root [32]byte) ([]byte, error)

func (*Key) Unmarshal

func (k *Key) Unmarshal(data []byte) error

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

PublicKey is a Bls public key

func (*PublicKey) Deserialize

func (p *PublicKey) Deserialize(buf []byte) error

func (*PublicKey) HashTreeRootWith

func (p *PublicKey) HashTreeRootWith(hh *ssz.Hasher) error

HashTreeRootWith implements the fastssz.HashRoot interface

func (*PublicKey) MarshalSSZTo

func (p *PublicKey) MarshalSSZTo(dst []byte) ([]byte, error)

MarshalSSZTo implements the fastssz.MarshalSSZTo interface

func (*PublicKey) Serialize

func (p *PublicKey) Serialize() []byte

func (*PublicKey) SizeSSZ

func (p *PublicKey) SizeSSZ() int

SizeSSZ implements the fastssz.SizeSSZ interface

func (*PublicKey) UnmarshalSSZ

func (p *PublicKey) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ implements the fastssz.Unmarshaler interface

type SecretKey

type SecretKey struct {
	// contains filtered or unexported fields
}

SecretKey is a Bls secret key

func RandomKey

func RandomKey() *SecretKey

func (*SecretKey) GetPublicKey

func (s *SecretKey) GetPublicKey() *PublicKey

func (*SecretKey) Marshal

func (s *SecretKey) Marshal() ([]byte, error)

func (*SecretKey) Sign

func (s *SecretKey) Sign(msg []byte) *Signature

func (*SecretKey) Unmarshal

func (s *SecretKey) Unmarshal(data []byte) error

type Signature

type Signature struct {
	// contains filtered or unexported fields
}

Signature is a Bls signature

func (*Signature) Deserialize

func (s *Signature) Deserialize(buf []byte) error

func (*Signature) HashTreeRootWith

func (s *Signature) HashTreeRootWith(hh *ssz.Hasher) error

HashTreeRootWith implements the fastssz.HashRoot interface

func (*Signature) MarshalSSZTo

func (s *Signature) MarshalSSZTo(dst []byte) ([]byte, error)

MarshalSSZTo implements the fastssz.MarshalSSZTo interface

func (*Signature) Serialize

func (s *Signature) Serialize() []byte

func (*Signature) SizeSSZ

func (s *Signature) SizeSSZ() int

SizeSSZ implements the fastssz.SizeSSZ interface

func (*Signature) UnmarshalSSZ

func (s *Signature) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ implements the fastssz.Unmarshaler interface

func (*Signature) VerifyByte

func (s *Signature) VerifyByte(pub *PublicKey, msg []byte) bool

Jump to

Keyboard shortcuts

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