Documentation
¶
Overview ¶
Package keygen MPC implementation of generating pubkey
Index ¶
- func CheckFull(msg []smpc.Message) bool
- func NewLocalDNode(out chan<- smpc.Message, end chan<- LocalDNodeSaveData, DNodeCountInGroup int, ...) smpc.DNode
- type KGRound0Message
- type KGRound1Message
- type KGRound2Message
- type KGRound2Message1
- type KGRound2Message2
- type KGRound3Message
- type KGRound3Message1
- type KGRound4Message
- type KGRound5Message
- type KGRound5Message1
- type KGRound5Message2
- type KGRound6Message
- type KGRoundMessage
- type LocalDNode
- func (p *LocalDNode) DNodeID() string
- func (p *LocalDNode) DulMessage(msg smpc.Message) bool
- func (p *LocalDNode) Finalize() bool
- func (p *LocalDNode) FinalizeRound() smpc.Round
- func (p *LocalDNode) FirstRound() smpc.Round
- func (p *LocalDNode) SetDNodeID(id string)
- func (p *LocalDNode) Start() error
- func (p *LocalDNode) StoreMessage(msg smpc.Message) (bool, error)
- func (p *LocalDNode) Update(msg smpc.Message) (ok bool, err error)
- type LocalDNodeSaveData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KGRound0Message ¶
type KGRound0Message struct {
*KGRoundMessage
}
KGRound0Message Round 0 sending message
func (*KGRound0Message) GetFromID ¶
func (kg *KGRound0Message) GetFromID() string
GetFromID get the ID of sending nodes in the group
func (*KGRound0Message) GetFromIndex ¶
func (kg *KGRound0Message) GetFromIndex() int
GetFromIndex get the Serial number of sending nodes in the group
func (*KGRound0Message) GetMsgType ¶
func (kg *KGRound0Message) GetMsgType() string
GetMsgType get msg type
func (*KGRound0Message) GetToID ¶
func (kg *KGRound0Message) GetToID() []string
GetToID get the ID of the node that broacasting message to
func (*KGRound0Message) IsBroadcast ¶
func (kg *KGRound0Message) IsBroadcast() bool
IsBroadcast weather broacast the message
func (*KGRound0Message) OutMap ¶
func (kg *KGRound0Message) OutMap() map[string]string
OutMap transfer *KGRound0Message to map
type KGRound1Message ¶
type KGRound1Message struct { *KGRoundMessage ComC *big.Int `json:"ComC"` ComCBip32 *big.Int `json:"ComCBip32"` U1PaillierPk *ec2.PublicKey `json:"U1PaillierPk"` }
KGRound1Message Round 1 sending message
func (*KGRound1Message) GetFromID ¶
func (kg *KGRound1Message) GetFromID() string
GetFromID get the ID of sending nodes in the group
func (*KGRound1Message) GetFromIndex ¶
func (kg *KGRound1Message) GetFromIndex() int
GetFromIndex get the Serial number of sending nodes in the group
func (*KGRound1Message) GetMsgType ¶
func (kg *KGRound1Message) GetMsgType() string
GetMsgType get msg type
func (*KGRound1Message) GetToID ¶
func (kg *KGRound1Message) GetToID() []string
GetToID get the ID of the node that broacasting message to
func (*KGRound1Message) IsBroadcast ¶
func (kg *KGRound1Message) IsBroadcast() bool
IsBroadcast weather broacast the message
func (*KGRound1Message) OutMap ¶
func (kg *KGRound1Message) OutMap() map[string]string
OutMap transfer *KGRound1Message to map
type KGRound2Message ¶
type KGRound2Message struct { *KGRoundMessage ID *big.Int }
KGRound2Message Round 2 sending message
func (*KGRound2Message) GetFromID ¶
func (kg *KGRound2Message) GetFromID() string
GetFromID get the ID of sending nodes in the group
func (*KGRound2Message) GetFromIndex ¶
func (kg *KGRound2Message) GetFromIndex() int
GetFromIndex get the Serial number of sending nodes in the group
func (*KGRound2Message) GetMsgType ¶
func (kg *KGRound2Message) GetMsgType() string
GetMsgType get msg type
func (*KGRound2Message) GetToID ¶
func (kg *KGRound2Message) GetToID() []string
GetToID get the ID of the node that broacasting message to
func (*KGRound2Message) IsBroadcast ¶
func (kg *KGRound2Message) IsBroadcast() bool
IsBroadcast weather broacast the message
func (*KGRound2Message) OutMap ¶
func (kg *KGRound2Message) OutMap() map[string]string
OutMap transfer *KGRound2Message to map
type KGRound2Message1 ¶
type KGRound2Message1 struct { *KGRoundMessage C1 *big.Int }
KGRound2Message1 Round 2 sending message
func (*KGRound2Message1) GetFromID ¶
func (kg *KGRound2Message1) GetFromID() string
GetFromID get the ID of sending nodes in the group
func (*KGRound2Message1) GetFromIndex ¶
func (kg *KGRound2Message1) GetFromIndex() int
GetFromIndex get the Serial number of sending nodes in the group
func (*KGRound2Message1) GetMsgType ¶
func (kg *KGRound2Message1) GetMsgType() string
GetMsgType get msg type
func (*KGRound2Message1) GetToID ¶
func (kg *KGRound2Message1) GetToID() []string
GetToID get the ID of the node that broacasting message to
func (*KGRound2Message1) IsBroadcast ¶
func (kg *KGRound2Message1) IsBroadcast() bool
IsBroadcast weather broacast the message
func (*KGRound2Message1) OutMap ¶
func (kg *KGRound2Message1) OutMap() map[string]string
OutMap transfer *KGRound2Message1 to map
type KGRound2Message2 ¶
type KGRound2Message2 struct { *KGRoundMessage Num *big.Int SfPf *ec2.SquareFreeProof }
KGRound2Message2 Round 2 sending message2
func (*KGRound2Message2) GetFromID ¶
func (kg *KGRound2Message2) GetFromID() string
GetFromID get the ID of sending nodes in the group
func (*KGRound2Message2) GetFromIndex ¶
func (kg *KGRound2Message2) GetFromIndex() int
GetFromIndex get the Serial number of sending nodes in the group
func (*KGRound2Message2) GetMsgType ¶
func (kg *KGRound2Message2) GetMsgType() string
GetMsgType get msg type
func (*KGRound2Message2) GetToID ¶
func (kg *KGRound2Message2) GetToID() []string
GetToID get the ID of the node that broacasting message to
func (*KGRound2Message2) IsBroadcast ¶
func (kg *KGRound2Message2) IsBroadcast() bool
IsBroadcast weather broacast the message
func (*KGRound2Message2) OutMap ¶
func (kg *KGRound2Message2) OutMap() map[string]string
OutMap transfer *KGRound2Message1 to map
type KGRound3Message ¶
type KGRound3Message struct { *KGRoundMessage ComU1GD []*big.Int ComC1GD []*big.Int U1PolyGG [][]*big.Int }
KGRound3Message Round 3 sending message
func (*KGRound3Message) GetFromID ¶
func (kg *KGRound3Message) GetFromID() string
GetFromID get the ID of sending nodes in the group
func (*KGRound3Message) GetFromIndex ¶
func (kg *KGRound3Message) GetFromIndex() int
GetFromIndex get the Serial number of sending nodes in the group
func (*KGRound3Message) GetMsgType ¶
func (kg *KGRound3Message) GetMsgType() string
GetMsgType get msg type
func (*KGRound3Message) GetToID ¶
func (kg *KGRound3Message) GetToID() []string
GetToID get the ID of the node that broacasting message to
func (*KGRound3Message) IsBroadcast ¶
func (kg *KGRound3Message) IsBroadcast() bool
IsBroadcast weather broacast the message
func (*KGRound3Message) OutMap ¶
func (kg *KGRound3Message) OutMap() map[string]string
OutMap transfer *KGRound3Message to map
type KGRound3Message1 ¶
type KGRound3Message1 struct { *KGRoundMessage Y *big.Int }
KGRound3Message1 Round 3 sending message1
func (*KGRound3Message1) GetFromID ¶
func (kg *KGRound3Message1) GetFromID() string
GetFromID get the ID of sending nodes in the group
func (*KGRound3Message1) GetFromIndex ¶
func (kg *KGRound3Message1) GetFromIndex() int
GetFromIndex get the Serial number of sending nodes in the group
func (*KGRound3Message1) GetMsgType ¶
func (kg *KGRound3Message1) GetMsgType() string
GetMsgType get msg type
func (*KGRound3Message1) GetToID ¶
func (kg *KGRound3Message1) GetToID() []string
GetToID get the ID of the node that broacasting message to
func (*KGRound3Message1) IsBroadcast ¶
func (kg *KGRound3Message1) IsBroadcast() bool
IsBroadcast weather broacast the message
func (*KGRound3Message1) OutMap ¶
func (kg *KGRound3Message1) OutMap() map[string]string
OutMap transfer *KGRound3Message1 to map
type KGRound4Message ¶
type KGRound4Message struct { *KGRoundMessage U1NtildeH1H2 *ec2.NtildeH1H2 //add for ntilde zk NtildeProof1 *ec2.NtildeProof NtildeProof2 *ec2.NtildeProof // add for xi commitment ComXiC *big.Int //pubkey PubKeyX *big.Int PubKeyY *big.Int }
KGRound4Message Round 4 sending message
func (*KGRound4Message) GetFromID ¶
func (kg *KGRound4Message) GetFromID() string
GetFromID get the ID of sending nodes in the group
func (*KGRound4Message) GetFromIndex ¶
func (kg *KGRound4Message) GetFromIndex() int
GetFromIndex get the Serial number of sending nodes in the group
func (*KGRound4Message) GetMsgType ¶
func (kg *KGRound4Message) GetMsgType() string
GetMsgType get msg type
func (*KGRound4Message) GetToID ¶
func (kg *KGRound4Message) GetToID() []string
GetToID get the ID of the node that broacasting message to
func (*KGRound4Message) IsBroadcast ¶
func (kg *KGRound4Message) IsBroadcast() bool
IsBroadcast weather broacast the message
func (*KGRound4Message) OutMap ¶
func (kg *KGRound4Message) OutMap() map[string]string
OutMap transfer *KGRound4Message to map
type KGRound5Message ¶
type KGRound5Message struct { *KGRoundMessage ComXiGD []*big.Int }
KGRound5Message Round 5 sending message
func (*KGRound5Message) GetFromID ¶
func (kg *KGRound5Message) GetFromID() string
GetFromID get the ID of sending nodes in the group
func (*KGRound5Message) GetFromIndex ¶
func (kg *KGRound5Message) GetFromIndex() int
GetFromIndex get the Serial number of sending nodes in the group
func (*KGRound5Message) GetMsgType ¶
func (kg *KGRound5Message) GetMsgType() string
GetMsgType get msg type
func (*KGRound5Message) GetToID ¶
func (kg *KGRound5Message) GetToID() []string
GetToID get the ID of the node that broacasting message to
func (*KGRound5Message) IsBroadcast ¶
func (kg *KGRound5Message) IsBroadcast() bool
IsBroadcast weather broacast the message
func (*KGRound5Message) OutMap ¶
func (kg *KGRound5Message) OutMap() map[string]string
OutMap transfer *KGRound5Message to map
type KGRound5Message1 ¶
type KGRound5Message1 struct { *KGRoundMessage Num *big.Int HvPf *ec2.HvProof }
KGRound5Message1 Round 5-1 sending message
func (*KGRound5Message1) GetFromID ¶
func (kg *KGRound5Message1) GetFromID() string
GetFromID get the ID of sending nodes in the group
func (*KGRound5Message1) GetFromIndex ¶
func (kg *KGRound5Message1) GetFromIndex() int
GetFromIndex get the Serial number of sending nodes in the group
func (*KGRound5Message1) GetMsgType ¶
func (kg *KGRound5Message1) GetMsgType() string
GetMsgType get msg type
func (*KGRound5Message1) GetToID ¶
func (kg *KGRound5Message1) GetToID() []string
GetToID get the ID of the node that broacasting message to
func (*KGRound5Message1) IsBroadcast ¶
func (kg *KGRound5Message1) IsBroadcast() bool
IsBroadcast weather broacast the message
func (*KGRound5Message1) OutMap ¶
func (kg *KGRound5Message1) OutMap() map[string]string
OutMap transfer *KGRound5Message1 to map
type KGRound5Message2 ¶
type KGRound5Message2 struct { *KGRoundMessage Num *big.Int SfPf *ec2.SquareFreeProof }
KGRound5Message2 Round 5 sending message2
func (*KGRound5Message2) GetFromID ¶
func (kg *KGRound5Message2) GetFromID() string
GetFromID get the ID of sending nodes in the group
func (*KGRound5Message2) GetFromIndex ¶
func (kg *KGRound5Message2) GetFromIndex() int
GetFromIndex get the Serial number of sending nodes in the group
func (*KGRound5Message2) GetMsgType ¶
func (kg *KGRound5Message2) GetMsgType() string
GetMsgType get msg type
func (*KGRound5Message2) GetToID ¶
func (kg *KGRound5Message2) GetToID() []string
GetToID get the ID of the node that broacasting message to
func (*KGRound5Message2) IsBroadcast ¶
func (kg *KGRound5Message2) IsBroadcast() bool
IsBroadcast weather broacast the message
func (*KGRound5Message2) OutMap ¶
func (kg *KGRound5Message2) OutMap() map[string]string
OutMap transfer *KGRound5Message2 to map
type KGRound6Message ¶
type KGRound6Message struct { *KGRoundMessage U1zkXiProof *ec2.ZkXiProof CheckPubkeyStatus bool }
KGRound6Message Round 6 sending message
func (*KGRound6Message) GetFromID ¶
func (kg *KGRound6Message) GetFromID() string
GetFromID get the ID of sending nodes in the group
func (*KGRound6Message) GetFromIndex ¶
func (kg *KGRound6Message) GetFromIndex() int
GetFromIndex get the Serial number of sending nodes in the group
func (*KGRound6Message) GetMsgType ¶
func (kg *KGRound6Message) GetMsgType() string
GetMsgType get msg type
func (*KGRound6Message) GetToID ¶
func (kg *KGRound6Message) GetToID() []string
GetToID get the ID of the node that broacasting message to
func (*KGRound6Message) IsBroadcast ¶
func (kg *KGRound6Message) IsBroadcast() bool
IsBroadcast weather broacast the message
func (*KGRound6Message) OutMap ¶
func (kg *KGRound6Message) OutMap() map[string]string
OutMap transfer *KGRound6Message to map
type KGRoundMessage ¶
type KGRoundMessage struct { FromID string `json:"FromID"` //DNodeID FromIndex int `json:"FromIndex"` ToID []string `json:"ToID"` }
KGRoundMessage base type of kg round message
func (*KGRoundMessage) AppendToID ¶
func (kg *KGRoundMessage) AppendToID(toid string)
AppendToID get the ID of nodes that the message will broacast to
func (*KGRoundMessage) SetFromID ¶
func (kg *KGRoundMessage) SetFromID(id string)
SetFromID set sending nodes's ID
func (*KGRoundMessage) SetFromIndex ¶
func (kg *KGRoundMessage) SetFromIndex(index int)
SetFromIndex set sending nodes's serial number in group
type LocalDNode ¶
LocalDNode current local node
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) FinalizeRound ¶
func (p *LocalDNode) FinalizeRound() smpc.Round
FinalizeRound get finalize 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) StoreMessage ¶
func (p *LocalDNode) StoreMessage(msg smpc.Message) (bool, error)
StoreMessage Collect data from other nodes
type LocalDNodeSaveData ¶
type LocalDNodeSaveData struct { //save to local db Pkx *big.Int Pky *big.Int C *big.Int SkU1 *big.Int U1PaillierSk *ec2.PrivateKey U1PaillierPk []*ec2.PublicKey U1NtildePrivData *ec2.NtildePrivData U1NtildeH1H2 []*ec2.NtildeH1H2 IDs smpc.SortableIDSSlice CurDNodeID *big.Int }
LocalDNodeSaveData the data will save to local db after keygen
func GetLocalDNodeSaveData ¶
func GetLocalDNodeSaveData(data map[string]string) *LocalDNodeSaveData
GetLocalDNodeSaveData get LocalDNodeSaveData from map
func NewLocalDNodeSaveData ¶
func NewLocalDNodeSaveData(DNodeCount int) (saveData LocalDNodeSaveData)
NewLocalDNodeSaveData init a LocalDNodeSaveData data struct
func (*LocalDNodeSaveData) OutMap ¶
func (sd *LocalDNodeSaveData) OutMap() map[string]string
OutMap Convert LocalDNodeSaveData into map