wire

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Code generated by fastssz. DO NOT EDIT. Hash: 81322cdab5a24228c538893db5d77a4a237844ca8b21fb8d434fc2b3fc29cb84 Version: 0.1.3

Index

Constants

View Source
const NonceLength = 32

NonceLength is the length of the nonce

Variables

This section is empty.

Functions

func DecodeDealBundle

func DecodeDealBundle(byts []byte, suite dkg.Suite) (*dkg.DealBundle, error)

EncodeDealBundle decodes a DKG deal bundle

func DecodeJustificationBundle

func DecodeJustificationBundle(byts []byte, suite dkg.Suite) (*dkg.JustificationBundle, error)

func DecodeResponseBundle

func DecodeResponseBundle(byts []byte) (*dkg.ResponseBundle, error)

func EncodeDealBundle

func EncodeDealBundle(bundle *dkg.DealBundle) ([]byte, error)

EncodeDealBundle encodes a DKG deal bundle

func EncodeJustificationBundle

func EncodeJustificationBundle(bundle *dkg.JustificationBundle) ([]byte, error)

func EncodeResponseBundle

func EncodeResponseBundle(bundle *dkg.ResponseBundle) ([]byte, error)

func GetErr

func GetErr(msg []byte) (parsedErr, err error)

GetErr extracts an error from a message

func MakeErr

func MakeErr(err error) (reterr []byte)

MakeErr creates an error message

func NewDKGProtocol

func NewDKGProtocol(dkgConfig *dkg.Config, b dkg.Board, logger *zap.Logger) (*dkg.Protocol, error)

NewDKGProtocol initializes and starts phases of the DKG protocol

Types

type ErrSSZ

type ErrSSZ struct {
	Error []byte `ssz-max:"512"`
}

func (*ErrSSZ) GetTree

func (e *ErrSSZ) GetTree() (*ssz.Node, error)

GetTree ssz hashes the ErrSSZ object

func (*ErrSSZ) HashTreeRoot

func (e *ErrSSZ) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the ErrSSZ object

func (*ErrSSZ) HashTreeRootWith

func (e *ErrSSZ) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the ErrSSZ object with a hasher

func (*ErrSSZ) MarshalSSZ

func (e *ErrSSZ) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the ErrSSZ object

func (*ErrSSZ) MarshalSSZTo

func (e *ErrSSZ) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the ErrSSZ object to a target array

func (*ErrSSZ) SizeSSZ

func (e *ErrSSZ) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the ErrSSZ object

func (*ErrSSZ) UnmarshalSSZ

func (e *ErrSSZ) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the ErrSSZ object

type Exchange

type Exchange struct {
	PK      []byte `ssz-max:"2048"`
	Commits []byte `ssz-max:"2048"`
}

Exchange contains the session auth/ encryption key for each node

func (*Exchange) GetTree

func (e *Exchange) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Exchange object

func (*Exchange) HashTreeRoot

func (e *Exchange) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Exchange object

func (*Exchange) HashTreeRootWith

func (e *Exchange) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Exchange object with a hasher

func (*Exchange) MarshalSSZ

func (e *Exchange) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Exchange object

func (*Exchange) MarshalSSZTo

func (e *Exchange) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Exchange object to a target array

func (*Exchange) SizeSSZ

func (e *Exchange) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Exchange object

func (*Exchange) UnmarshalSSZ

func (e *Exchange) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Exchange object

type Init

type Init struct {
	// Operators involved in the DKG
	Operators []*Operator `ssz-max:"13"`
	// T is the threshold for signing
	T uint64
	// WithdrawalCredentials for deposit data
	WithdrawalCredentials []byte `ssz-max:"32"`
	// Fork ethereum fork for signing
	Fork [4]byte `ssz-size:"4"`
	// Owner address
	Owner [20]byte `ssz-size:"20"`
	// Owner nonce
	Nonce uint64
	// Initiator public key
	InitiatorPublicKey []byte `ssz-max:"612"`
}

func (*Init) GetTree

func (i *Init) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Init object

func (*Init) HashTreeRoot

func (i *Init) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Init object

func (*Init) HashTreeRootWith

func (i *Init) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Init object with a hasher

func (*Init) MarshalSSZ

func (i *Init) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Init object

func (*Init) MarshalSSZTo

func (i *Init) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Init object to a target array

func (*Init) SizeSSZ

func (i *Init) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Init object

func (*Init) UnmarshalSSZ

func (i *Init) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Init object

type KyberMessage

type KyberMessage struct {
	Type TransportType
	Data []byte `ssz-max:"4096"`
}

func (*KyberMessage) GetTree

func (k *KyberMessage) GetTree() (*ssz.Node, error)

GetTree ssz hashes the KyberMessage object

func (*KyberMessage) HashTreeRoot

func (k *KyberMessage) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the KyberMessage object

func (*KyberMessage) HashTreeRootWith

func (k *KyberMessage) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the KyberMessage object with a hasher

func (*KyberMessage) MarshalSSZ

func (k *KyberMessage) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the KyberMessage object

func (*KyberMessage) MarshalSSZTo

func (k *KyberMessage) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the KyberMessage object to a target array

func (*KyberMessage) SizeSSZ

func (k *KyberMessage) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the KyberMessage object

func (*KyberMessage) UnmarshalSSZ

func (k *KyberMessage) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the KyberMessage object

type LogWrapper

type LogWrapper struct {
	Logger *zap.Logger
}

LogWrapper is needed because drand/kyber uses dkg.Logger which differs from zap in some methods

func New

func New(logger *zap.Logger) *LogWrapper

func (*LogWrapper) Error

func (l *LogWrapper) Error(vals ...interface{})

func (*LogWrapper) Info

func (l *LogWrapper) Info(vals ...interface{})

type MultipleSignedTransports

type MultipleSignedTransports struct {
	Identifier [24]byte           `ssz-size:"24"` // this is kinda wasteful, maybe take it out of the msgs?
	Messages   []*SignedTransport `ssz-max:"13"`  // max num of operators
	Signature  []byte             `ssz-max:"2048"`
}

func (*MultipleSignedTransports) GetTree

func (m *MultipleSignedTransports) GetTree() (*ssz.Node, error)

GetTree ssz hashes the MultipleSignedTransports object

func (*MultipleSignedTransports) HashTreeRoot

func (m *MultipleSignedTransports) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the MultipleSignedTransports object

func (*MultipleSignedTransports) HashTreeRootWith

func (m *MultipleSignedTransports) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the MultipleSignedTransports object with a hasher

func (*MultipleSignedTransports) MarshalSSZ

func (m *MultipleSignedTransports) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the MultipleSignedTransports object

func (*MultipleSignedTransports) MarshalSSZTo

func (m *MultipleSignedTransports) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the MultipleSignedTransports object to a target array

func (*MultipleSignedTransports) SizeSSZ

func (m *MultipleSignedTransports) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the MultipleSignedTransports object

func (*MultipleSignedTransports) UnmarshalSSZ

func (m *MultipleSignedTransports) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the MultipleSignedTransports object

type Operator

type Operator struct {
	ID     uint64
	PubKey []byte `ssz-max:"2048"`
}

func (*Operator) GetTree

func (o *Operator) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Operator object

func (*Operator) HashTreeRoot

func (o *Operator) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Operator object

func (*Operator) HashTreeRootWith

func (o *Operator) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Operator object with a hasher

func (*Operator) MarshalSSZ

func (o *Operator) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Operator object

func (*Operator) MarshalSSZTo

func (o *Operator) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Operator object to a target array

func (*Operator) SizeSSZ

func (o *Operator) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Operator object

func (*Operator) UnmarshalSSZ

func (o *Operator) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Operator object

type Output

type Output struct {
	EncryptedShare              []byte `ssz-max:"4096"`
	SharePK                     []byte `ssz-max:"4096"`
	ValidatorPK                 []byte `ssz-size:"48"`
	DepositDataPartialSignature []byte `ssz-size:"96"`
}

func (*Output) GetTree

func (o *Output) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Output object

func (*Output) HashTreeRoot

func (o *Output) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Output object

func (*Output) HashTreeRootWith

func (o *Output) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Output object with a hasher

func (*Output) MarshalSSZ

func (o *Output) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Output object

func (*Output) MarshalSSZTo

func (o *Output) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Output object to a target array

func (*Output) SizeSSZ

func (o *Output) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Output object

func (*Output) UnmarshalSSZ

func (o *Output) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Output object

type Ping added in v1.1.0

type Ping struct {
	// Operators involved in the DKG
	Operators []*Operator `ssz-max:"13"`
	// Initiator public key
	InitiatorPublicKey []byte `ssz-max:"2048"`
}

func (*Ping) GetTree added in v1.1.0

func (p *Ping) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Ping object

func (*Ping) HashTreeRoot added in v1.1.0

func (p *Ping) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Ping object

func (*Ping) HashTreeRootWith added in v1.1.0

func (p *Ping) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Ping object with a hasher

func (*Ping) MarshalSSZ added in v1.1.0

func (p *Ping) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Ping object

func (*Ping) MarshalSSZTo added in v1.1.0

func (p *Ping) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Ping object to a target array

func (*Ping) SizeSSZ added in v1.1.0

func (p *Ping) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Ping object

func (*Ping) UnmarshalSSZ added in v1.1.0

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

UnmarshalSSZ ssz unmarshals the Ping object

type Pong added in v1.1.0

type Pong struct {
	PubKey []byte `ssz-max:"2048"`
}

func (*Pong) GetTree added in v1.1.0

func (p *Pong) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Pong object

func (*Pong) HashTreeRoot added in v1.1.0

func (p *Pong) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Pong object

func (*Pong) HashTreeRootWith added in v1.1.0

func (p *Pong) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Pong object with a hasher

func (*Pong) MarshalSSZ added in v1.1.0

func (p *Pong) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Pong object

func (*Pong) MarshalSSZTo added in v1.1.0

func (p *Pong) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Pong object to a target array

func (*Pong) SizeSSZ added in v1.1.0

func (p *Pong) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Pong object

func (*Pong) UnmarshalSSZ added in v1.1.0

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

UnmarshalSSZ ssz unmarshals the Pong object

type Reshare added in v1.0.0

type Reshare struct {
	// Operators involved in the DKG
	OldOperators []*Operator `ssz-max:"13"`
	// Operators involved in the resharing
	NewOperators []*Operator `ssz-max:"13"`
	// OldT is the old threshold for signing
	OldT uint64
	// NewT is the old threshold for signing
	NewT uint64
	// Owner address
	Owner [20]byte `ssz-size:"20"`
	// Owner nonce
	Nonce uint64
	// Encrypted BLS shares
	Keyshares []byte `ssz-max:"32768"`
	// Ceremony signatures
	CeremonySigs []byte `ssz-max:"16384"`
	// Initiator public key
	InitiatorPublicKey []byte `ssz-max:"612"`
}

func (*Reshare) GetTree added in v1.0.0

func (r *Reshare) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Reshare object

func (*Reshare) HashTreeRoot added in v1.0.0

func (r *Reshare) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Reshare object

func (*Reshare) HashTreeRootWith added in v1.0.0

func (r *Reshare) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Reshare object with a hasher

func (*Reshare) MarshalSSZ added in v1.0.0

func (r *Reshare) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Reshare object

func (*Reshare) MarshalSSZTo added in v1.0.0

func (r *Reshare) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Reshare object to a target array

func (*Reshare) SizeSSZ added in v1.0.0

func (r *Reshare) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Reshare object

func (*Reshare) UnmarshalSSZ added in v1.0.0

func (r *Reshare) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Reshare object

type ReshareKyberMessage added in v1.0.0

type ReshareKyberMessage struct {
	Type TransportType
	Data []byte `ssz-max:"4096"`
}

func (*ReshareKyberMessage) GetTree added in v1.0.0

func (r *ReshareKyberMessage) GetTree() (*ssz.Node, error)

GetTree ssz hashes the ReshareKyberMessage object

func (*ReshareKyberMessage) HashTreeRoot added in v1.0.0

func (r *ReshareKyberMessage) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the ReshareKyberMessage object

func (*ReshareKyberMessage) HashTreeRootWith added in v1.0.0

func (r *ReshareKyberMessage) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the ReshareKyberMessage object with a hasher

func (*ReshareKyberMessage) MarshalSSZ added in v1.0.0

func (r *ReshareKyberMessage) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the ReshareKyberMessage object

func (*ReshareKyberMessage) MarshalSSZTo added in v1.0.0

func (r *ReshareKyberMessage) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the ReshareKyberMessage object to a target array

func (*ReshareKyberMessage) SizeSSZ added in v1.0.0

func (r *ReshareKyberMessage) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the ReshareKyberMessage object

func (*ReshareKyberMessage) UnmarshalSSZ added in v1.0.0

func (r *ReshareKyberMessage) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the ReshareKyberMessage object

type ResultData added in v1.1.0

type ResultData struct {
	// Operators involved in the DKG
	Operators []*Operator `ssz-max:"13"`
	// Initiator public key
	Identifier    [24]byte `ssz-size:"24"`
	DepositData   []byte   `ssz-max:"8192"`
	KeysharesData []byte   `ssz-max:"32768"`
	CeremonySigs  []byte   `ssz-max:"16384"`
}

func (*ResultData) GetTree added in v1.1.0

func (r *ResultData) GetTree() (*ssz.Node, error)

GetTree ssz hashes the ResultData object

func (*ResultData) HashTreeRoot added in v1.1.0

func (r *ResultData) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the ResultData object

func (*ResultData) HashTreeRootWith added in v1.1.0

func (r *ResultData) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the ResultData object with a hasher

func (*ResultData) MarshalSSZ added in v1.1.0

func (r *ResultData) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the ResultData object

func (*ResultData) MarshalSSZTo added in v1.1.0

func (r *ResultData) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the ResultData object to a target array

func (*ResultData) SizeSSZ added in v1.1.0

func (r *ResultData) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the ResultData object

func (*ResultData) UnmarshalSSZ added in v1.1.0

func (r *ResultData) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the ResultData object

type SSZMarshaller added in v1.1.0

type SSZMarshaller interface {
	MarshalSSZ() ([]byte, error)
	UnmarshalSSZ(buf []byte) error
}

type SignedTransport

type SignedTransport struct {
	Message   *Transport
	Signer    uint64
	Signature []byte `ssz-max:"2048"`
}

func (*SignedTransport) GetTree

func (s *SignedTransport) GetTree() (*ssz.Node, error)

GetTree ssz hashes the SignedTransport object

func (*SignedTransport) HashTreeRoot

func (s *SignedTransport) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the SignedTransport object

func (*SignedTransport) HashTreeRootWith

func (s *SignedTransport) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the SignedTransport object with a hasher

func (*SignedTransport) MarshalSSZ

func (s *SignedTransport) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the SignedTransport object

func (*SignedTransport) MarshalSSZTo

func (s *SignedTransport) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the SignedTransport object to a target array

func (*SignedTransport) SizeSSZ

func (s *SignedTransport) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the SignedTransport object

func (*SignedTransport) UnmarshalSSZ

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

UnmarshalSSZ ssz unmarshals the SignedTransport object

type Transport

type Transport struct {
	Type       TransportType
	Identifier [24]byte `ssz-size:"24"`
	Data       []byte   `ssz-max:"8388608"` // 2^23
	Version    []byte   `ssz-max:"128"`
}

func (*Transport) GetTree

func (t *Transport) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Transport object

func (*Transport) HashTreeRoot

func (t *Transport) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Transport object

func (*Transport) HashTreeRootWith

func (t *Transport) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Transport object with a hasher

func (*Transport) MarshalSSZ

func (t *Transport) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Transport object

func (*Transport) MarshalSSZTo

func (t *Transport) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Transport object to a target array

func (*Transport) SizeSSZ

func (t *Transport) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Transport object

func (*Transport) UnmarshalSSZ

func (t *Transport) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Transport object

type TransportType

type TransportType uint64
const (
	InitMessageType TransportType = iota
	ReshareMessageType
	KyberMessageType
	ReshareKyberMessageType
	ExchangeMessageType
	ReshareExchangeMessageType
	OutputMessageType
	KyberDealBundleMessageType
	KyberResponseBundleMessageType
	KyberJustificationBundleMessageType
	BlsSignRequestType
	ErrorMessageType
	PingMessageType
	PongMessageType
	ResultMessageType
)

func (TransportType) String

func (t TransportType) String() string

Jump to

Keyboard shortcuts

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