dkg

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDkgServer

func RegisterDkgServer(s *grpc.Server, srv DkgServer)

Types

type DKGPacket

type DKGPacket struct {
	Deal                 *Deal          `protobuf:"bytes,1,opt,name=deal,proto3" json:"deal,omitempty"`
	Response             *Response      `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
	Justification        *Justification `protobuf:"bytes,3,opt,name=justification,proto3" json:"justification,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

DKGPacket is used by the nodes to run the dkg protocol before being able to generate randomness beacons.

func (*DKGPacket) Descriptor

func (*DKGPacket) Descriptor() ([]byte, []int)

func (*DKGPacket) GetDeal

func (m *DKGPacket) GetDeal() *Deal

func (*DKGPacket) GetJustification

func (m *DKGPacket) GetJustification() *Justification

func (*DKGPacket) GetResponse

func (m *DKGPacket) GetResponse() *Response

func (*DKGPacket) ProtoMessage

func (*DKGPacket) ProtoMessage()

func (*DKGPacket) Reset

func (m *DKGPacket) Reset()

func (*DKGPacket) String

func (m *DKGPacket) String() string

func (*DKGPacket) XXX_DiscardUnknown added in v0.3.7

func (m *DKGPacket) XXX_DiscardUnknown()

func (*DKGPacket) XXX_Marshal added in v0.3.7

func (m *DKGPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DKGPacket) XXX_Merge added in v0.3.7

func (dst *DKGPacket) XXX_Merge(src proto.Message)

func (*DKGPacket) XXX_Size added in v0.3.7

func (m *DKGPacket) XXX_Size() int

func (*DKGPacket) XXX_Unmarshal added in v0.3.7

func (m *DKGPacket) XXX_Unmarshal(b []byte) error

type DKGResponse

type DKGResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DKGResponse) Descriptor

func (*DKGResponse) Descriptor() ([]byte, []int)

func (*DKGResponse) ProtoMessage

func (*DKGResponse) ProtoMessage()

func (*DKGResponse) Reset

func (m *DKGResponse) Reset()

func (*DKGResponse) String

func (m *DKGResponse) String() string

func (*DKGResponse) XXX_DiscardUnknown added in v0.3.7

func (m *DKGResponse) XXX_DiscardUnknown()

func (*DKGResponse) XXX_Marshal added in v0.3.7

func (m *DKGResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DKGResponse) XXX_Merge added in v0.3.7

func (dst *DKGResponse) XXX_Merge(src proto.Message)

func (*DKGResponse) XXX_Size added in v0.3.7

func (m *DKGResponse) XXX_Size() int

func (*DKGResponse) XXX_Unmarshal added in v0.3.7

func (m *DKGResponse) XXX_Unmarshal(b []byte) error

type Deal

type Deal struct {
	// index of the dealer, the issuer of the share
	Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	// encrypted version of the deal
	Deal *vss.EncryptedDeal `protobuf:"bytes,2,opt,name=deal,proto3" json:"deal,omitempty"`
	// signature of the whole deal
	// NOTE: this is almost duplicated data, since the vss deal already includes
	// a signature. However it does not include the index of the dealer that
	// issue this deal, so another one is required. Best would be to merge vss
	// and dkg so we could use only one field of signature. For future work...
	// :)
	Signature            []byte   `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Deal contains a share for a participant.

func (*Deal) Descriptor

func (*Deal) Descriptor() ([]byte, []int)

func (*Deal) GetDeal

func (m *Deal) GetDeal() *vss.EncryptedDeal

func (*Deal) GetIndex

func (m *Deal) GetIndex() uint32

func (*Deal) GetSignature added in v0.4.0

func (m *Deal) GetSignature() []byte

func (*Deal) ProtoMessage

func (*Deal) ProtoMessage()

func (*Deal) Reset

func (m *Deal) Reset()

func (*Deal) String

func (m *Deal) String() string

func (*Deal) XXX_DiscardUnknown added in v0.3.7

func (m *Deal) XXX_DiscardUnknown()

func (*Deal) XXX_Marshal added in v0.3.7

func (m *Deal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Deal) XXX_Merge added in v0.3.7

func (dst *Deal) XXX_Merge(src proto.Message)

func (*Deal) XXX_Size added in v0.3.7

func (m *Deal) XXX_Size() int

func (*Deal) XXX_Unmarshal added in v0.3.7

func (m *Deal) XXX_Unmarshal(b []byte) error

type DkgClient

type DkgClient interface {
	Setup(ctx context.Context, in *DKGPacket, opts ...grpc.CallOption) (*DKGResponse, error)
	Reshare(ctx context.Context, in *ResharePacket, opts ...grpc.CallOption) (*ReshareResponse, error)
}

DkgClient is the client API for Dkg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDkgClient

func NewDkgClient(cc *grpc.ClientConn) DkgClient

type DkgServer

type DkgServer interface {
	Setup(context.Context, *DKGPacket) (*DKGResponse, error)
	Reshare(context.Context, *ResharePacket) (*ReshareResponse, error)
}

DkgServer is the server API for Dkg service.

type Justification

type Justification struct {
	// index of the dealer who is issuing this justification
	Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	// justification from the dealer
	Justification        *vss.Justification `protobuf:"bytes,2,opt,name=justification,proto3" json:"justification,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

Justification holds the justification from a dealer after a participant issued a complaint response because of a supposedly invalid deal.

func (*Justification) Descriptor

func (*Justification) Descriptor() ([]byte, []int)

func (*Justification) GetIndex

func (m *Justification) GetIndex() uint32

func (*Justification) GetJustification

func (m *Justification) GetJustification() *vss.Justification

func (*Justification) ProtoMessage

func (*Justification) ProtoMessage()

func (*Justification) Reset

func (m *Justification) Reset()

func (*Justification) String

func (m *Justification) String() string

func (*Justification) XXX_DiscardUnknown added in v0.3.7

func (m *Justification) XXX_DiscardUnknown()

func (*Justification) XXX_Marshal added in v0.3.7

func (m *Justification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Justification) XXX_Merge added in v0.3.7

func (dst *Justification) XXX_Merge(src proto.Message)

func (*Justification) XXX_Size added in v0.3.7

func (m *Justification) XXX_Size() int

func (*Justification) XXX_Unmarshal added in v0.3.7

func (m *Justification) XXX_Unmarshal(b []byte) error

type ResharePacket added in v0.4.0

type ResharePacket struct {
	GroupHash            string     `protobuf:"bytes,1,opt,name=group_hash,json=groupHash,proto3" json:"group_hash,omitempty"`
	Packet               *DKGPacket `protobuf:"bytes,2,opt,name=packet,proto3" json:"packet,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

special wrapper for resharing operation that serves two purposes: - indicate to non-leader old nodes that they should generate and send their deals - indicate to which new group are we resharing. drand should keep a list of new ready-to-operate groups allowed.

func (*ResharePacket) Descriptor added in v0.4.0

func (*ResharePacket) Descriptor() ([]byte, []int)

func (*ResharePacket) GetGroupHash added in v0.4.0

func (m *ResharePacket) GetGroupHash() string

func (*ResharePacket) GetPacket added in v0.4.0

func (m *ResharePacket) GetPacket() *DKGPacket

func (*ResharePacket) ProtoMessage added in v0.4.0

func (*ResharePacket) ProtoMessage()

func (*ResharePacket) Reset added in v0.4.0

func (m *ResharePacket) Reset()

func (*ResharePacket) String added in v0.4.0

func (m *ResharePacket) String() string

func (*ResharePacket) XXX_DiscardUnknown added in v0.4.1

func (m *ResharePacket) XXX_DiscardUnknown()

func (*ResharePacket) XXX_Marshal added in v0.4.1

func (m *ResharePacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ResharePacket) XXX_Merge added in v0.4.1

func (dst *ResharePacket) XXX_Merge(src proto.Message)

func (*ResharePacket) XXX_Size added in v0.4.1

func (m *ResharePacket) XXX_Size() int

func (*ResharePacket) XXX_Unmarshal added in v0.4.1

func (m *ResharePacket) XXX_Unmarshal(b []byte) error

type ReshareResponse added in v0.4.0

type ReshareResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

empty return response

func (*ReshareResponse) Descriptor added in v0.4.0

func (*ReshareResponse) Descriptor() ([]byte, []int)

func (*ReshareResponse) ProtoMessage added in v0.4.0

func (*ReshareResponse) ProtoMessage()

func (*ReshareResponse) Reset added in v0.4.0

func (m *ReshareResponse) Reset()

func (*ReshareResponse) String added in v0.4.0

func (m *ReshareResponse) String() string

func (*ReshareResponse) XXX_DiscardUnknown added in v0.4.1

func (m *ReshareResponse) XXX_DiscardUnknown()

func (*ReshareResponse) XXX_Marshal added in v0.4.1

func (m *ReshareResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ReshareResponse) XXX_Merge added in v0.4.1

func (dst *ReshareResponse) XXX_Merge(src proto.Message)

func (*ReshareResponse) XXX_Size added in v0.4.1

func (m *ReshareResponse) XXX_Size() int

func (*ReshareResponse) XXX_Unmarshal added in v0.4.1

func (m *ReshareResponse) XXX_Unmarshal(b []byte) error

type Response

type Response struct {
	// index of the dealer for which this response is for
	Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	// response from the participant which received a deal
	Response             *vss.Response `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

Response holds the response that a participant broadcast after having received a deal.

func (*Response) Descriptor

func (*Response) Descriptor() ([]byte, []int)

func (*Response) GetIndex

func (m *Response) GetIndex() uint32

func (*Response) GetResponse

func (m *Response) GetResponse() *vss.Response

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) String

func (m *Response) String() string

func (*Response) XXX_DiscardUnknown added in v0.3.7

func (m *Response) XXX_DiscardUnknown()

func (*Response) XXX_Marshal added in v0.3.7

func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Response) XXX_Merge added in v0.3.7

func (dst *Response) XXX_Merge(src proto.Message)

func (*Response) XXX_Size added in v0.3.7

func (m *Response) XXX_Size() int

func (*Response) XXX_Unmarshal added in v0.3.7

func (m *Response) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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