Documentation ¶
Index ¶
- Constants
- type AVSSAuth
- type AVSSKeygen
- type AVSSKeygenStorage
- type AVSSKeygenTransport
- type KEYGENBuffer
- func (buf *KEYGENBuffer) CheckLengthOfEcho(keyIndex big.Int, dealer big.Int) int
- func (buf *KEYGENBuffer) CheckLengthOfReady(keyIndex big.Int, dealer big.Int) int
- func (buf *KEYGENBuffer) InitializeMsgBuffer(startIndex big.Int, numOfKeys int, nodeList []big.Int)
- func (buf *KEYGENBuffer) RetrieveKEYGENDKGComplete(nonce int, dealer big.Int) map[string]*KEYGENDKGComplete
- func (buf *KEYGENBuffer) RetrieveKEYGENEchoes(keyIndex big.Int, dealer big.Int) map[string]*KEYGENEcho
- func (buf *KEYGENBuffer) RetrieveKEYGENReadys(keyIndex big.Int, dealer big.Int) map[string]*KEYGENReady
- func (buf *KEYGENBuffer) RetrieveKEYGENSends(keyIndex big.Int, dealer big.Int) *KEYGENSend
- func (buf *KEYGENBuffer) StoreKEYGENEcho(msg KEYGENEcho, from big.Int) error
- func (buf *KEYGENBuffer) StoreKEYGENReady(msg KEYGENReady, from big.Int) error
- func (buf *KEYGENBuffer) StoreKEYGENSend(msg KEYGENSend, from big.Int) error
- type KEYGENDKGComplete
- type KEYGENEcho
- type KEYGENInitiate
- type KEYGENLog
- type KEYGENMsgLog
- type KEYGENPropose
- type KEYGENReady
- type KEYGENSecrets
- type KEYGENSend
- type KEYGENShareComplete
- type KeyIndex
- type KeygenInstance
- func (ki *KeygenInstance) InitiateKeygen() error
- func (ki *KeygenInstance) OnInitiateKeygen(msg KEYGENInitiate, nodeIndex big.Int) error
- func (ki *KeygenInstance) OnKEYGENDKGComplete(msg KEYGENDKGComplete, fromNodeIndex big.Int) error
- func (ki *KeygenInstance) OnKEYGENEcho(msg KEYGENEcho, fromNodeIndex big.Int) error
- func (ki *KeygenInstance) OnKEYGENPropose(msg KEYGENPropose, fromNodeIndex big.Int) error
- func (ki *KeygenInstance) OnKEYGENReady(msg KEYGENReady, fromNodeIndex big.Int) error
- func (ki *KeygenInstance) OnKEYGENSend(msg KEYGENSend, fromNodeIndex big.Int) error
- func (ki *KeygenInstance) TriggerRoundOneTimebound() error
- type NodeIndex
- type NodeLog
Constants ¶
const SIKeygenCompleted = "keygen_completed"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AVSSKeygen ¶
type AVSSKeygen interface { // Trigger Start for Keygen and Initialize InitiateKeygen() error // For this, these listeners must be triggered on incoming messages // Listeners and Reactions OnInitiateKeygen(msg KEYGENInitiate, nodeIndex big.Int) error OnKEYGENSend(msg KEYGENSend, fromNodeIndex big.Int) error OnKEYGENEcho(msg KEYGENEcho, fromNodeIndex big.Int) error OnKEYGENReady(msg KEYGENReady, fromNodeIndex big.Int) error OnKEYGENPropose(keygenPropose KEYGENPropose, fromNodeIndex big.Int) error OnKEYGENDKGComplete(keygenShareCompletes KEYGENDKGComplete, fromNodeIndex big.Int) error }
type AVSSKeygenStorage ¶
type AVSSKeygenStorage interface { StoreCommitmentMatrix(keyIndex big.Int, c [][]common.Point) error StoreKEYGENSecret(keyIndex big.Int, secret KEYGENSecrets) error }
To store necessary shares and secrets
type AVSSKeygenTransport ¶
type AVSSKeygenTransport interface { // Implementing the Code below will allow KEYGEN to run // "Client" Actions BroadcastInitiateKeygen(msg KEYGENInitiate) error SendKEYGENSend(msg KEYGENSend, nodeIndex big.Int) error SendKEYGENEcho(msg KEYGENEcho, nodeIndex big.Int) error SendKEYGENReady(msg KEYGENReady, nodeIndex big.Int) error BroadcastKEYGENPropose(msg KEYGENPropose) error BroadcastKEYGENDKGComplete(msg KEYGENDKGComplete) error KEYGENGuaranteed(startIndex big.Int, numOfKeys int) }
type KEYGENBuffer ¶
type KEYGENBuffer struct { idmutex.Mutex Buffer map[string](map[string]*KEYGENMsgLog) // keyIndex => nodeIndex => buffer ReceivedDKGCompletes map[int](map[string]*KEYGENDKGComplete) // From int (array ) to M big.Int (in hex) to DKGComplete }
Here we store by Key index to allow for faster fetching (less iteration) when accessing the buffer
func (*KEYGENBuffer) CheckLengthOfEcho ¶
func (*KEYGENBuffer) CheckLengthOfReady ¶
func (*KEYGENBuffer) InitializeMsgBuffer ¶
Initialize message buffer
func (*KEYGENBuffer) RetrieveKEYGENDKGComplete ¶
func (buf *KEYGENBuffer) RetrieveKEYGENDKGComplete(nonce int, dealer big.Int) map[string]*KEYGENDKGComplete
func (*KEYGENBuffer) RetrieveKEYGENEchoes ¶
func (buf *KEYGENBuffer) RetrieveKEYGENEchoes(keyIndex big.Int, dealer big.Int) map[string]*KEYGENEcho
func (*KEYGENBuffer) RetrieveKEYGENReadys ¶
func (buf *KEYGENBuffer) RetrieveKEYGENReadys(keyIndex big.Int, dealer big.Int) map[string]*KEYGENReady
func (*KEYGENBuffer) RetrieveKEYGENSends ¶
func (buf *KEYGENBuffer) RetrieveKEYGENSends(keyIndex big.Int, dealer big.Int) *KEYGENSend
TODO: Handle failed message Retrieve from the message buffer and iterate over messages
func (*KEYGENBuffer) StoreKEYGENEcho ¶
func (buf *KEYGENBuffer) StoreKEYGENEcho(msg KEYGENEcho, from big.Int) error
func (*KEYGENBuffer) StoreKEYGENReady ¶
func (buf *KEYGENBuffer) StoreKEYGENReady(msg KEYGENReady, from big.Int) error
func (*KEYGENBuffer) StoreKEYGENSend ¶
func (buf *KEYGENBuffer) StoreKEYGENSend(msg KEYGENSend, from big.Int) error
This could be done genericly, but its more efficient this way
type KEYGENDKGComplete ¶
type KEYGENDKGComplete struct {
Proofs []KEYGENShareComplete
}
type KEYGENEcho ¶
type KEYGENInitiate ¶
type KEYGENLog ¶
type KEYGENLog struct { KeyIndex big.Int NodeIndex big.Int C [][]common.Point // big.Int (in hex) to Commitment matrix ReceivedSend *KEYGENSend // Polynomials for respective commitment matrix. ReceivedEchoes map[string]KEYGENEcho // From(M) big.Int (in hex) to Echo ReceivedReadys map[string]KEYGENReady // From(M) big.Int (in hex) to Ready SentEcho bool // Tracking of sent ready SentReady bool // Tracking of sent ready }
KeyIndex => NodeIndex => KEYGENLog
type KEYGENMsgLog ¶
type KEYGENMsgLog struct { ReceivedSend *KEYGENSend // Polynomials for respective commitment matrix. ReceivedEchoes map[string]*KEYGENEcho // From(M) big.Int (in hex) to Echo ReceivedReadys map[string]*KEYGENReady // From(M) big.Int (in hex) to Ready }
type KEYGENPropose ¶
type KEYGENReady ¶
type KEYGENSecrets ¶
KeyIndex => KEYGENSecrets Used to keep secrets and polynomials for secrets (As well as KEYGENSends sent by the node)
type KEYGENSend ¶
type KEYGENSend struct { KeyIndex big.Int AIY common.PrimaryPolynomial AIprimeY common.PrimaryPolynomial BIX common.PrimaryPolynomial BIprimeX common.PrimaryPolynomial }
Below are the stated Keygen Types necessary for Communication between nodes
type KEYGENShareComplete ¶
type KEYGENShareComplete struct {}
type KeygenInstance ¶
type KeygenInstance struct { idmutex.Mutex NodeIndex big.Int Threshold int // in AVSS Paper this is k NumMalNodes int // in AVSS Paper this is t TotalNodes int // in AVSS Paper this is n NodeLog map[string]int // nodeindex => count of PerfectSubshares UnqualifiedNodes map[string]int // nodeindex => count of PerfectSubshares KeyLog map[string](map[string]*KEYGENLog) // keyindex => nodeindex => log Secrets map[string]KEYGENSecrets // keyindex => KEYGENSecrets StartIndex big.Int NumOfKeys int Transport AVSSKeygenTransport Store AVSSKeygenStorage MsgBuffer KEYGENBuffer Auth AVSSAuth FinalNodeSet []string // Final Nodeset Decided by the first valid DKGComplete FinalAllSumCommitments [][][]common.Point // Cache for verification instead of summing it up all the time SentDKGComplete bool ReceivedDKGCompleted map[string]*KEYGENDKGComplete // KeyIndex => KEYGENDKGComplete Ended bool ComChannel chan string }
Main Keygen Struct
func NewAVSSKeygen ¶
func NewAVSSKeygen(startingIndex big.Int, numOfKeys int, nodeIndexes []big.Int, threshold int, numMalNodes int, nodeIndex big.Int, transport AVSSKeygenTransport, store AVSSKeygenStorage, auth AVSSAuth, comChannel chan string) (*KeygenInstance, error)
func (*KeygenInstance) InitiateKeygen ¶
func (ki *KeygenInstance) InitiateKeygen() error
TODO: Potentially Stuff specific KEYGEN Debugger | set up transport here as well & store
func (*KeygenInstance) OnInitiateKeygen ¶
func (ki *KeygenInstance) OnInitiateKeygen(msg KEYGENInitiate, nodeIndex big.Int) error
func (*KeygenInstance) OnKEYGENDKGComplete ¶
func (ki *KeygenInstance) OnKEYGENDKGComplete(msg KEYGENDKGComplete, fromNodeIndex big.Int) error
func (*KeygenInstance) OnKEYGENEcho ¶
func (ki *KeygenInstance) OnKEYGENEcho(msg KEYGENEcho, fromNodeIndex big.Int) error
func (*KeygenInstance) OnKEYGENPropose ¶
func (ki *KeygenInstance) OnKEYGENPropose(msg KEYGENPropose, fromNodeIndex big.Int) error
func (*KeygenInstance) OnKEYGENReady ¶
func (ki *KeygenInstance) OnKEYGENReady(msg KEYGENReady, fromNodeIndex big.Int) error
func (*KeygenInstance) OnKEYGENSend ¶
func (ki *KeygenInstance) OnKEYGENSend(msg KEYGENSend, fromNodeIndex big.Int) error
func (*KeygenInstance) TriggerRoundOneTimebound ¶
func (ki *KeygenInstance) TriggerRoundOneTimebound() error
Call this (to be triggered by timing set and checked by tendermint) when time has exceeded timebound one (t1)