Documentation ¶
Overview ¶
Code generated by fastssz. DO NOT EDIT. Hash: b914c35429e0d34e52f00d7f8c5de8dcc0ee1dc294d9118d79dc182fe1ec0785 Version: 0.1.3
Index ¶
- Constants
- func DecodeDealBundle(byts []byte, suite dkg.Suite) (*dkg.DealBundle, error)
- func DecodeJustificationBundle(byts []byte, suite dkg.Suite) (*dkg.JustificationBundle, error)
- func DecodeResponseBundle(byts []byte) (*dkg.ResponseBundle, error)
- func EncodeDealBundle(bundle *dkg.DealBundle) ([]byte, error)
- func EncodeJustificationBundle(bundle *dkg.JustificationBundle) ([]byte, error)
- func EncodeResponseBundle(bundle *dkg.ResponseBundle) ([]byte, error)
- func GetErr(msg []byte) (error, error)
- func GetNonce(input []byte) []byte
- func MakeErr(err error) []byte
- func NewDKGProtocol(config *Config) (*dkg.Protocol, error)
- func NewReshareProtocolNewNodes(config *Config) (*dkg.Protocol, error)
- func NewReshareProtocolOldNodes(config *Config) (*dkg.Protocol, error)
- type Config
- type ErrSSZ
- func (e *ErrSSZ) GetTree() (*ssz.Node, error)
- func (e *ErrSSZ) HashTreeRoot() ([32]byte, error)
- func (e *ErrSSZ) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (e *ErrSSZ) MarshalSSZ() ([]byte, error)
- func (e *ErrSSZ) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (e *ErrSSZ) SizeSSZ() (size int)
- func (e *ErrSSZ) UnmarshalSSZ(buf []byte) error
- type Exchange
- func (e *Exchange) GetTree() (*ssz.Node, error)
- func (e *Exchange) HashTreeRoot() ([32]byte, error)
- func (e *Exchange) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (e *Exchange) MarshalSSZ() ([]byte, error)
- func (e *Exchange) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (e *Exchange) SizeSSZ() (size int)
- func (e *Exchange) UnmarshalSSZ(buf []byte) error
- type Init
- func (i *Init) GetTree() (*ssz.Node, error)
- func (i *Init) HashTreeRoot() ([32]byte, error)
- func (i *Init) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (i *Init) MarshalSSZ() ([]byte, error)
- func (i *Init) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (i *Init) SizeSSZ() (size int)
- func (i *Init) UnmarshalSSZ(buf []byte) error
- type KyberMessage
- func (k *KyberMessage) GetTree() (*ssz.Node, error)
- func (k *KyberMessage) HashTreeRoot() ([32]byte, error)
- func (k *KyberMessage) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (k *KyberMessage) MarshalSSZ() ([]byte, error)
- func (k *KyberMessage) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (k *KyberMessage) SizeSSZ() (size int)
- func (k *KyberMessage) UnmarshalSSZ(buf []byte) error
- type LogWrapper
- type MultipleSignedTransports
- func (m *MultipleSignedTransports) GetTree() (*ssz.Node, error)
- func (m *MultipleSignedTransports) HashTreeRoot() ([32]byte, error)
- func (m *MultipleSignedTransports) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (m *MultipleSignedTransports) MarshalSSZ() ([]byte, error)
- func (m *MultipleSignedTransports) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (m *MultipleSignedTransports) SizeSSZ() (size int)
- func (m *MultipleSignedTransports) UnmarshalSSZ(buf []byte) error
- type Operator
- func (o *Operator) GetTree() (*ssz.Node, error)
- func (o *Operator) HashTreeRoot() ([32]byte, error)
- func (o *Operator) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (o *Operator) MarshalSSZ() ([]byte, error)
- func (o *Operator) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (o *Operator) SizeSSZ() (size int)
- func (o *Operator) UnmarshalSSZ(buf []byte) error
- type Output
- func (o *Output) GetTree() (*ssz.Node, error)
- func (o *Output) HashTreeRoot() ([32]byte, error)
- func (o *Output) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (o *Output) MarshalSSZ() ([]byte, error)
- func (o *Output) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (o *Output) SizeSSZ() (size int)
- func (o *Output) UnmarshalSSZ(buf []byte) error
- type Reshare
- func (r *Reshare) GetTree() (*ssz.Node, error)
- func (r *Reshare) HashTreeRoot() ([32]byte, error)
- func (r *Reshare) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (r *Reshare) MarshalSSZ() ([]byte, error)
- func (r *Reshare) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (r *Reshare) SizeSSZ() (size int)
- func (r *Reshare) UnmarshalSSZ(buf []byte) error
- type ReshareKyberMessage
- func (r *ReshareKyberMessage) GetTree() (*ssz.Node, error)
- func (r *ReshareKyberMessage) HashTreeRoot() ([32]byte, error)
- func (r *ReshareKyberMessage) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (r *ReshareKyberMessage) MarshalSSZ() ([]byte, error)
- func (r *ReshareKyberMessage) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (r *ReshareKyberMessage) SizeSSZ() (size int)
- func (r *ReshareKyberMessage) UnmarshalSSZ(buf []byte) error
- type SignedTransport
- func (s *SignedTransport) GetTree() (*ssz.Node, error)
- func (s *SignedTransport) HashTreeRoot() ([32]byte, error)
- func (s *SignedTransport) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (s *SignedTransport) MarshalSSZ() ([]byte, error)
- func (s *SignedTransport) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (s *SignedTransport) SizeSSZ() (size int)
- func (s *SignedTransport) UnmarshalSSZ(buf []byte) error
- type Transport
- func (t *Transport) GetTree() (*ssz.Node, error)
- func (t *Transport) HashTreeRoot() ([32]byte, error)
- func (t *Transport) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (t *Transport) MarshalSSZ() ([]byte, error)
- func (t *Transport) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (t *Transport) SizeSSZ() (size int)
- func (t *Transport) UnmarshalSSZ(buf []byte) error
- type TransportType
Constants ¶
const NonceLength = 32
NonceLength is the length of the nonce
Variables ¶
This section is empty.
Functions ¶
func DecodeDealBundle ¶
EncodeDealBundle decodes a DKG deal bundle
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 NewDKGProtocol ¶
NewDKGProtocol initializes and starts phases of the DKG protocol
func NewReshareProtocolNewNodes ¶ added in v1.0.0
Types ¶
type Config ¶
type Config struct { Identifier []byte // DKG instance ID 24 bytes Secret kyber.Scalar // a secret key crated at Instance initiation OldNodes []dkg.Node // DKG operators participating at the ceremony NewNodes []dkg.Node // DKG operators participating at the ceremony Suite pairing.Suite // parameters on the fields being used T int // threshold - minimum number of participants needed to restore a master private key NewT int // threshold - minimum number of participants needed to restore a master private key Board dkg.Board // structure to process DKG messages from other participants PublicCoeffs []kyber.Point Logger *zap.Logger }
Config structure to configure a DKG protocol instance
type ErrSSZ ¶
type ErrSSZ struct {
Error []byte `ssz-max:"512"`
}
func (*ErrSSZ) HashTreeRoot ¶
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 ¶
MarshalSSZ ssz marshals the ErrSSZ object
func (*ErrSSZ) MarshalSSZTo ¶
MarshalSSZTo ssz marshals the ErrSSZ object to a target array
func (*ErrSSZ) UnmarshalSSZ ¶
UnmarshalSSZ ssz unmarshals the ErrSSZ object
type Exchange ¶
Exchange contains the session auth/ encryption key for each node
func (*Exchange) HashTreeRoot ¶
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 ¶
MarshalSSZ ssz marshals the Exchange object
func (*Exchange) MarshalSSZTo ¶
MarshalSSZTo ssz marshals the Exchange object to a target array
func (*Exchange) UnmarshalSSZ ¶
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:"2048"` }
func (*Init) HashTreeRoot ¶
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 ¶
MarshalSSZ ssz marshals the Init object
func (*Init) MarshalSSZTo ¶
MarshalSSZTo ssz marshals the Init object to a target array
func (*Init) UnmarshalSSZ ¶
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 ¶
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 ¶
func (*Operator) HashTreeRoot ¶
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 ¶
MarshalSSZ ssz marshals the Operator object
func (*Operator) MarshalSSZTo ¶
MarshalSSZTo ssz marshals the Operator object to a target array
func (*Operator) UnmarshalSSZ ¶
UnmarshalSSZ ssz unmarshals the Operator object
type Output ¶
type Output struct { ValidatorPK []byte `ssz-size:"48"` DepositDataPartialSignature []byte `ssz-size:"96"` }
func (*Output) HashTreeRoot ¶
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 ¶
MarshalSSZ ssz marshals the Output object
func (*Output) MarshalSSZTo ¶
MarshalSSZTo ssz marshals the Output object to a target array
func (*Output) UnmarshalSSZ ¶
UnmarshalSSZ ssz unmarshals the Output object
type Reshare ¶ added in v1.0.0
type Reshare struct { Operator `ssz-max:"13"` NewOperators []*Operator `ssz-max:"13"` OldT uint64 NewT uint64 InitiatorPublicKey []byte `ssz-max:"2048"` OldID [24]byte `ssz-size:"24"` Owner [20]byte `ssz-size:"20"` Nonce uint64 }OldOperators []*
func (*Reshare) HashTreeRoot ¶ added in v1.0.0
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
MarshalSSZ ssz marshals the Reshare object
func (*Reshare) MarshalSSZTo ¶ added in v1.0.0
MarshalSSZTo ssz marshals the Reshare object to a target array
func (*Reshare) SizeSSZ ¶ added in v1.0.0
SizeSSZ returns the ssz encoded size in bytes for the Reshare object
func (*Reshare) UnmarshalSSZ ¶ added in v1.0.0
UnmarshalSSZ ssz unmarshals the Reshare object
type ReshareKyberMessage ¶ added in v1.0.0
type ReshareKyberMessage struct {}
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 SignedTransport ¶
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 }
func (*Transport) HashTreeRoot ¶
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 ¶
MarshalSSZ ssz marshals the Transport object
func (*Transport) MarshalSSZTo ¶
MarshalSSZTo ssz marshals the Transport object to a target array
func (*Transport) UnmarshalSSZ ¶
UnmarshalSSZ ssz unmarshals the Transport object
type TransportType ¶
type TransportType uint64
const ( InitMessageType TransportType = iota KyberMessageType ExchangeMessageType OutputMessageType KyberDealBundleMessageType KyberResponseBundleMessageType KyberJustificationBundleMessageType BlsSignRequestType ErrorMessageType )
func (TransportType) String ¶
func (t TransportType) String() string