本文整理匯總了Golang中github.com/dedis/cothority/sda.TreeNodeInstance.List方法的典型用法代碼示例。如果您正苦於以下問題:Golang TreeNodeInstance.List方法的具體用法?Golang TreeNodeInstance.List怎麽用?Golang TreeNodeInstance.List使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/dedis/cothority/sda.TreeNodeInstance
的用法示例。
在下文中一共展示了TreeNodeInstance.List方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewJVSS
// NewJVSS creates a new JVSS protocol instance and returns it.
func NewJVSS(node *sda.TreeNodeInstance) (sda.ProtocolInstance, error) {
kp := &config.KeyPair{Suite: node.Suite(), Public: node.Public(), Secret: node.Private()}
n := len(node.List())
pk := make([]abstract.Point, n)
for i, tn := range node.List() {
pk[i] = tn.ServerIdentity.Public
}
// NOTE: T <= R <= N (for simplicity we use T = R = N; might change later)
info := poly.Threshold{T: n, R: n, N: n}
jv := &JVSS{
TreeNodeInstance: node,
keyPair: kp,
pubKeys: pk,
info: info,
schnorr: new(poly.Schnorr),
secrets: make(map[SID]*Secret),
ltssInit: false,
secretsDone: make(chan bool, 1),
sigChan: make(chan *poly.SchnorrSig),
}
// Setup message handlers
h := []interface{}{
jv.handleSecInit,
jv.handleSecConf,
jv.handleSigReq,
jv.handleSigResp,
}
err := jv.RegisterHandlers(h...)
return jv, err
}