cosi

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: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "CoSi"

ServiceName is the name to refer to the CoSi service

Variables

CosiRequestType is the type that is embedded in the Request object for a CosiRequest

CosiResponseType is the type that is embedded in the Request object for a CosiResponse

Functions

func NewSimulation

func NewSimulation(config string) (sda.Simulation, error)

NewSimulation returns an sda.Simulation or an error if sth. is wrong. Used to register the CoSi protocol.

Types

type Client

type Client struct {
	*sda.Client
}

Client is a structure to communicate with the CoSi service

func NewClient

func NewClient() *Client

NewClient instantiates a new cosi.Client

func (*Client) SignMsg

func (c *Client) SignMsg(el *sda.EntityList, msg []byte) (*SignatureResponse, error)

SignMsg sends a CoSi sign request to the Cothority defined by the given EntityList

type Cosi

type Cosi struct {
	*sda.ServiceProcessor
	// contains filtered or unexported fields
}

Cosi is the service that handles collective signing operations

func (*Cosi) NewProtocol

func (cs *Cosi) NewProtocol(tn *sda.TreeNodeInstance, conf *sda.GenericConfig) (sda.ProtocolInstance, error)

NewProtocol is called on all nodes of a Tree (except the root, since it is the one starting the protocol) so it's the Service that will be called to generate the PI on all others node.

func (*Cosi) SignatureRequest

func (cs *Cosi) SignatureRequest(e *network.Entity, req *SignatureRequest) (network.ProtocolMessage, error)

SignatureRequest treats external request to this service.

type SignatureRequest

type SignatureRequest struct {
	Message    []byte
	EntityList *sda.EntityList
}

SignatureRequest is what the Cosi service is expected to receive from clients.

type SignatureResponse

type SignatureResponse struct {
	Sum       []byte
	Challenge abstract.Secret
	Response  abstract.Secret
}

SignatureResponse is what the Cosi service will reply to clients.

func (*SignatureResponse) MarshalJSON

func (s *SignatureResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements golang's JSON marshal interface

func (*SignatureResponse) UnmarshalJSON

func (s *SignatureResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements golang's JSON unmarshal interface

type Simulation

type Simulation struct {
	sda.SimulationBFTree
}

Simulation implements the sda.Simulation of the CoSi protocol.

func (*Simulation) Node

func (cs *Simulation) Node(sc *sda.SimulationConfig) error

Node implements sda.Simulation.

func (*Simulation) Run

func (cs *Simulation) Run(config *sda.SimulationConfig) error

Run implements sda.Simulation.

func (*Simulation) Setup

func (cs *Simulation) Setup(dir string, hosts []string) (*sda.SimulationConfig, error)

Setup implements sda.Simulation.

Jump to

Keyboard shortcuts

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