ntree

package
v0.0.0-...-53feb6c Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2016 License: GPL-2.0 Imports: 8 Imported by: 0

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

func (p *Protocol) HandleSignRequest(msg structMessage) error

HandleSignRequest is a handler for incoming sign-requests. It's registered as a handler in the sda.Node.

func (*Protocol) Start

func (p *Protocol) Start() error

Start implements sda.ProtocolInstance.

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

Jump to

Keyboard shortcuts

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