types

package
v0.0.0-...-ee95d54 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DKGCommits                    OperationType = "dkg_commits"
	SignatureReconstructed        fsm.Event     = "signature_reconstructed"
	SignatureReconstructionFailed fsm.Event     = "signature_reconstruction_failed"
	ReinitDKG                     fsm.State     = "reinit_dkg"

	// OperationProcessed common event type for successfully processed operations but with an empty result
	OperationProcessed fsm.Event = "operation_processed_successfully"
)

Variables

This section is empty.

Functions

func CalcStartReInitDKGMessageHash

func CalcStartReInitDKGMessageHash(payload []byte) ([]byte, error)

func FSMRequestFromMessage

func FSMRequestFromMessage(message storage.Message) (interface{}, error)

FSMRequestFromMessage converts a message data to a necessary FSM struct

Types

type Operation

type Operation struct {
	ID            string // UUID4
	Type          OperationType
	Payload       []byte
	ResultMsgs    []storage.Message
	CreatedAt     time.Time
	DKGIdentifier string
	To            string
	Event         fsm.Event

	// field for some additional helping data
	ExtraData []byte
}

Operation is the type for any Operation that might be required for both DKG and signing process (e.g.,

func NewOperation

func NewOperation(
	dkgRoundID string,
	payload []byte,
	state fsm.State,
) *Operation

func (*Operation) Equal

func (o *Operation) Equal(o2 *Operation) error

func (*Operation) Filename

func (o *Operation) Filename() (filename string)

func (*Operation) IsSigningState

func (o *Operation) IsSigningState() bool

type OperationType

type OperationType string

type Participant

type Participant struct {
	DKGPubKey     []byte `json:"dkg_pub_key"`
	OldCommPubKey []byte `json:"old_comm_pub_key"`
	NewCommPubKey []byte `json:"new_comm_pub_key"`
	Name          string `json:"name"`
}

type ReDKG

type ReDKG struct {
	DKGID        string            `json:"dkg_id"`
	Threshold    int               `json:"threshold"`
	Participants []Participant     `json:"participants"`
	Messages     []storage.Message `json:"messages"`
}

func GenerateReDKGMessage

func GenerateReDKGMessage(messages []storage.Message, newCommPubKeys map[string][]byte) (*ReDKG, error)

GenerateReDKGMessage returns a ReDKG message based on an append log dump. newCommPubKeys will be used add new public communication keys to each participant; this value can be nil.

Jump to

Keyboard shortcuts

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