Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProtocol ¶
func NewProtocol(node *sda.TreeNodeInstance) (sda.ProtocolInstance, error)
NewProtocol is used internally to register the protocol.
func NewSimulation ¶
func NewSimulation(config string) (sda.Simulation, error)
NewSimulation creates a new NTree-simulation
Types ¶
type Message ¶
type Message struct { Msg []byte // Simulation purpose // see https://github.com/dedis/cothority/issues/260 VerifySignature int }
Message contains the actual message (as a slice of bytes) that will be individually signed
type Protocol ¶
type Protocol struct { *sda.TreeNodeInstance // the message we want to sign (and the root node propagates) Message []byte // contains filtered or unexported fields }
Protocol implements the sda.ProtocolInstance interface
func (*Protocol) HandleSignBundle ¶
func (p *Protocol) HandleSignBundle(reply []structSignatureBundle)
HandleSignBundle is a handler responsible for adding the node's signature and verifying the children's signatures (verification level can be controlled by the VerifySignature flag).
func (*Protocol) HandleSignRequest ¶
HandleSignRequest is a handler for incoming sign-requests. It's registered as a handler in the sda.Node.
type SignatureBundle ¶
type SignatureBundle struct { // Child signature ChildSig *SignatureReply // Child subtree signatures SubSigs []*SignatureReply }
SignatureBundle represent the signature that one children will pass up to its parent. It contains:
- The signature reply of a direct child (sig + index)
- The whole set of signature reply of the child sub tree
type SignatureReply ¶
type SignatureReply struct { Sig crypto.SchnorrSig Index int }
SignatureReply contains a signature for the message
- SchnorrSig (signature of the current node)
- Index of the public key in the entitylist in order to verify the signature
type Simulation ¶
type Simulation struct { sda.SimulationBFTree Message string // 0 - no check // 1 - check only direct children's signature // 2 - check the whole subtree Checking int }
Simulation holds everything necessary for one NTree-round
func (*Simulation) Run ¶
func (e *Simulation) Run(config *sda.SimulationConfig) error
Run starts the simulation on the simulation-side
func (*Simulation) Setup ¶
func (e *Simulation) Setup(dir string, hosts []string) ( *sda.SimulationConfig, error)
Setup prepares the simulation on the local end