Documentation
¶
Index ¶
Constants ¶
const ServiceName = "CoSi"
ServiceName is the name to refer to the CoSi service
Variables ¶
var CosiRequestType = network.RegisterMessageType(SignatureRequest{})
CosiRequestType is the type that is embedded in the Request object for a CosiRequest
var CosiResponseType = network.RegisterMessageType(SignatureResponse{})
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 ¶
Client is a structure to communicate with the CoSi service
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 ¶
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.