reshare

package
v0.0.0-...-4c49fd5 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: GPL-2.0, GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package reshare MPC implementation of reshare

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFull

func CheckFull(msg []smpc.Message) bool

CheckFull Check for empty messages

func NewLocalDNode

func NewLocalDNode(
	out chan<- smpc.Message,
	end chan<- keygen.LocalDNodeSaveData,
	DNodeCountInGroup int,
	threshold int,
	paillierkeylength int,
	sd *keygen.LocalDNodeSaveData,
	oldnode bool,
	oldindex int,
	keytype string,
) smpc.DNode

NewLocalDNode new a DNode data struct for current node

Types

type LocalDNode

type LocalDNode struct {
	*smpc.BaseDNode
	// contains filtered or unexported fields
}

LocalDNode current local node

func (*LocalDNode) CheckReshareMsg0

func (p *LocalDNode) CheckReshareMsg0(msg smpc.Message) bool

CheckReshareMsg0 add for check msg0

func (*LocalDNode) DNodeID

func (p *LocalDNode) DNodeID() string

DNodeID get the ID of current DNode

func (*LocalDNode) DulMessage

func (p *LocalDNode) DulMessage(msg smpc.Message) bool

DulMessage check whether the msg already exists in the list.

func (*LocalDNode) Finalize

func (p *LocalDNode) Finalize() bool

Finalize weather gg20 round

func (*LocalDNode) FinalizeRound

func (p *LocalDNode) FinalizeRound() smpc.Round

FinalizeRound get finalize round

func (*LocalDNode) FirstRound

func (p *LocalDNode) FirstRound() smpc.Round

FirstRound first round

func (*LocalDNode) SetDNodeID

func (p *LocalDNode) SetDNodeID(id string)

SetDNodeID set the ID of current DNode p.ID : enode --> DoubleHash --> index+1 --> Sprintf(index+1) --> []byte( Sprintf(index+1) ) --> EncodeToString *big.Int format: index+1 string format: EncodeToString

func (*LocalDNode) SetIDReshare

func (p *LocalDNode) SetIDReshare(ids smpc.SortableIDSSlice)

SetIDReshare set all IDs of nodes in group to local dnode

func (*LocalDNode) Start

func (p *LocalDNode) Start() error

Start reshare start

func (*LocalDNode) StoreMessage

func (p *LocalDNode) StoreMessage(msg smpc.Message) (bool, error)

StoreMessage Collect data from other nodes

func (*LocalDNode) Update

func (p *LocalDNode) Update(msg smpc.Message) (ok bool, err error)

Update Collect data from other nodes and enter the next round

type ReRound0Message

type ReRound0Message struct {
	*ReRoundMessage
}

ReRound0Message Round 0 sending message

func (*ReRound0Message) GetFromID

func (re *ReRound0Message) GetFromID() string

GetFromID get the ID of sending nodes in the group

func (*ReRound0Message) GetFromIndex

func (re *ReRound0Message) GetFromIndex() int

GetFromIndex get the Serial number of sending nodes in the group

func (*ReRound0Message) GetMsgType

func (re *ReRound0Message) GetMsgType() string

GetMsgType get msg type

func (*ReRound0Message) GetToID

func (re *ReRound0Message) GetToID() []string

GetToID get the ID of the node that broacasting message to

func (*ReRound0Message) IsBroadcast

func (re *ReRound0Message) IsBroadcast() bool

IsBroadcast weather broacast the message

func (*ReRound0Message) OutMap

func (re *ReRound0Message) OutMap() map[string]string

OutMap transfer *ReRound0Message to map

type ReRound1Message

type ReRound1Message struct {
	*ReRoundMessage
	ComC *big.Int
}

ReRound1Message Round 1 sending message

func (*ReRound1Message) GetFromID

func (re *ReRound1Message) GetFromID() string

GetFromID get the ID of sending nodes in the group

func (*ReRound1Message) GetFromIndex

func (re *ReRound1Message) GetFromIndex() int

GetFromIndex get the Serial number of sending nodes in the group

func (*ReRound1Message) GetMsgType

func (re *ReRound1Message) GetMsgType() string

GetMsgType get msg type

func (*ReRound1Message) GetToID

func (re *ReRound1Message) GetToID() []string

GetToID get the ID of the node that broacasting message to

func (*ReRound1Message) IsBroadcast

func (re *ReRound1Message) IsBroadcast() bool

IsBroadcast weather broacast the message

func (*ReRound1Message) OutMap

func (re *ReRound1Message) OutMap() map[string]string

OutMap transfer *ReRound1Message to map

type ReRound2Message

type ReRound2Message struct {
	*ReRoundMessage

	ID    *big.Int
	Share *big.Int
}

ReRound2Message Round 2 sending message

func (*ReRound2Message) GetFromID

func (re *ReRound2Message) GetFromID() string

GetFromID get the ID of sending nodes in the group

func (*ReRound2Message) GetFromIndex

func (re *ReRound2Message) GetFromIndex() int

GetFromIndex get the Serial number of sending nodes in the group

func (*ReRound2Message) GetMsgType

func (re *ReRound2Message) GetMsgType() string

GetMsgType get msg type

func (*ReRound2Message) GetToID

func (re *ReRound2Message) GetToID() []string

GetToID get the ID of the node that broacasting message to

func (*ReRound2Message) IsBroadcast

func (re *ReRound2Message) IsBroadcast() bool

IsBroadcast weather broacast the message

func (*ReRound2Message) OutMap

func (re *ReRound2Message) OutMap() map[string]string

OutMap transfer *ReRound2Message to map

type ReRound2Message1

type ReRound2Message1 struct {
	*ReRoundMessage

	ComD      []*big.Int
	SkP1PolyG [][]*big.Int
}

ReRound2Message1 Round 2 sending message

func (*ReRound2Message1) GetFromID

func (re *ReRound2Message1) GetFromID() string

GetFromID get the ID of sending nodes in the group

func (*ReRound2Message1) GetFromIndex

func (re *ReRound2Message1) GetFromIndex() int

GetFromIndex get the Serial number of sending nodes in the group

func (*ReRound2Message1) GetMsgType

func (re *ReRound2Message1) GetMsgType() string

GetMsgType get msg type

func (*ReRound2Message1) GetToID

func (re *ReRound2Message1) GetToID() []string

GetToID get the ID of the node that broacasting message to

func (*ReRound2Message1) IsBroadcast

func (re *ReRound2Message1) IsBroadcast() bool

IsBroadcast weather broacast the message

func (*ReRound2Message1) OutMap

func (re *ReRound2Message1) OutMap() map[string]string

OutMap transfer *ReRound2Message1 to map

type ReRound3Message

type ReRound3Message struct {
	*ReRoundMessage
	U1PaillierPk *ec2.PublicKey
}

ReRound3Message Round 3 sending message

func (*ReRound3Message) GetFromID

func (re *ReRound3Message) GetFromID() string

GetFromID get the ID of sending nodes in the group

func (*ReRound3Message) GetFromIndex

func (re *ReRound3Message) GetFromIndex() int

GetFromIndex get the Serial number of sending nodes in the group

func (*ReRound3Message) GetMsgType

func (re *ReRound3Message) GetMsgType() string

GetMsgType get msg type

func (*ReRound3Message) GetToID

func (re *ReRound3Message) GetToID() []string

GetToID get the ID of the node that broacasting message to

func (*ReRound3Message) IsBroadcast

func (re *ReRound3Message) IsBroadcast() bool

IsBroadcast weather broacast the message

func (*ReRound3Message) OutMap

func (re *ReRound3Message) OutMap() map[string]string

OutMap transfer *ReRound3Message to map

type ReRound4Message

type ReRound4Message struct {
	*ReRoundMessage
	U1NtildeH1H2 *ec2.NtildeH1H2

	//add for ntilde zk
	NtildeProof1 *ec2.NtildeProof
	NtildeProof2 *ec2.NtildeProof
}

ReRound4Message Round 4 sending message

func (*ReRound4Message) GetFromID

func (re *ReRound4Message) GetFromID() string

GetFromID get the ID of sending nodes in the group

func (*ReRound4Message) GetFromIndex

func (re *ReRound4Message) GetFromIndex() int

GetFromIndex get the Serial number of sending nodes in the group

func (*ReRound4Message) GetMsgType

func (re *ReRound4Message) GetMsgType() string

GetMsgType get msg type

func (*ReRound4Message) GetToID

func (re *ReRound4Message) GetToID() []string

GetToID get the ID of the node that broacasting message to

func (*ReRound4Message) IsBroadcast

func (re *ReRound4Message) IsBroadcast() bool

IsBroadcast weather broacast the message

func (*ReRound4Message) OutMap

func (re *ReRound4Message) OutMap() map[string]string

OutMap transfer *ReRound4Message to map

type ReRound5Message

type ReRound5Message struct {
	*ReRoundMessage
	NewSkOk string
}

ReRound5Message Round 5 sending message

func (*ReRound5Message) GetFromID

func (re *ReRound5Message) GetFromID() string

GetFromID get the ID of sending nodes in the group

func (*ReRound5Message) GetFromIndex

func (re *ReRound5Message) GetFromIndex() int

GetFromIndex get the Serial number of sending nodes in the group

func (*ReRound5Message) GetMsgType

func (re *ReRound5Message) GetMsgType() string

GetMsgType get msg type

func (*ReRound5Message) GetToID

func (re *ReRound5Message) GetToID() []string

GetToID get the ID of the node that broacasting message to

func (*ReRound5Message) IsBroadcast

func (re *ReRound5Message) IsBroadcast() bool

IsBroadcast weather broacast the message

func (*ReRound5Message) OutMap

func (re *ReRound5Message) OutMap() map[string]string

OutMap transfer *ReRound5Message to map

type ReRoundMessage

type ReRoundMessage struct {
	FromID    string   `json:"FromID"` //DNodeID
	FromIndex int      `json:"FromIndex"`
	ToID      []string `json:"ToID"`
}

ReRoundMessage base type of sign round message

func (*ReRoundMessage) AppendToID

func (re *ReRoundMessage) AppendToID(toid string)

AppendToID get the ID of nodes that the message will broacast to

func (*ReRoundMessage) SetFromID

func (re *ReRoundMessage) SetFromID(id string)

SetFromID set sending nodes's ID

func (*ReRoundMessage) SetFromIndex

func (re *ReRoundMessage) SetFromIndex(index int)

SetFromIndex set sending nodes's serial number in group

Jump to

Keyboard shortcuts

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