Documentation ¶
Index ¶
- func BackwardNonce(round uint32) *[24]byte
- func ForwardNonce(round uint32) *[24]byte
- type Client
- func (c *Client) NewRound(ctx context.Context, servers []PublicServerConfig, settings *RoundSettings) ([][]byte, error)
- func (c *Client) RunRoundBidirectional(ctx context.Context, server PublicServerConfig, service string, round uint32, ...) ([][]byte, error)
- func (c *Client) RunRoundUnidirectional(ctx context.Context, server PublicServerConfig, service string, round uint32, ...) (string, error)
- type MixService
- type PublicServerConfig
- func (c *PublicServerConfig) FromProto(pbc *pb.PublicServerConfig) error
- func (v PublicServerConfig) MarshalEasyJSON(w *jwriter.Writer)
- func (v PublicServerConfig) MarshalJSON() ([]byte, error)
- func (c PublicServerConfig) Proto() *pb.PublicServerConfig
- func (v *PublicServerConfig) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *PublicServerConfig) UnmarshalJSON(data []byte) error
- type RoundSettings
- type Server
- func (srv *Server) AddOnions(stream pb.Mixnet_AddOnionsServer) error
- func (srv *Server) CloseRound(ctx context.Context, req *pb.CloseRoundRequest) (*pb.CloseRoundResponse, error)
- func (srv *Server) DeleteRound(ctx context.Context, req *pb.DeleteRoundRequest) (*pb.Nothing, error)
- func (srv *Server) GetOnions(req *pb.GetOnionsRequest, stream pb.Mixnet_GetOnionsServer) error
- func (srv *Server) NewRound(ctx context.Context, req *pb.NewRoundRequest) (*pb.NewRoundResponse, error)
- func (srv *Server) SetRoundSettings(ctx context.Context, req *pb.SetRoundSettingsRequest) (*pb.RoundSettingsSignature, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackwardNonce ¶
func ForwardNonce ¶
Types ¶
type Client ¶
type Client struct { Key ed25519.PrivateKey // contains filtered or unexported fields }
func (*Client) NewRound ¶
func (c *Client) NewRound(ctx context.Context, servers []PublicServerConfig, settings *RoundSettings) ([][]byte, error)
NewRound starts a new mixing round on the given servers. NewRound fills in settings.OnionKeys and returns the servers' signatures of the round settings.
settings.Round must be set.
func (*Client) RunRoundBidirectional ¶
type MixService ¶
type MixService interface { // True for mixnets that send onions in both directions (e.g., Convo), // and false for mixnets that send onions in one direction // (e.g., AddFriend and Dialing). Bidirectional() bool SizeIncomingMessage() int SizeReplyMessage() int ParseServiceData(data []byte) (interface{}, error) GenerateNoise(settings RoundSettings, myPos int) [][]byte // HandleMessages is called by the last server on the chain // with the decrypted message batch. If Bidirectional() is true, // the first return value of HandleMessages must be [][]byte, // otherwise it must be a string that is used as the Close RPC result. HandleMessages(settings RoundSettings, messages [][]byte) (interface{}, error) }
type PublicServerConfig ¶
func (*PublicServerConfig) FromProto ¶
func (c *PublicServerConfig) FromProto(pbc *pb.PublicServerConfig) error
func (PublicServerConfig) MarshalEasyJSON ¶
func (v PublicServerConfig) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PublicServerConfig) MarshalJSON ¶
func (v PublicServerConfig) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (PublicServerConfig) Proto ¶
func (c PublicServerConfig) Proto() *pb.PublicServerConfig
func (*PublicServerConfig) UnmarshalEasyJSON ¶
func (v *PublicServerConfig) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PublicServerConfig) UnmarshalJSON ¶
func (v *PublicServerConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type RoundSettings ¶
type RoundSettings struct { // Service is the name of the mixnet service. Service string // Round is the round that these settings correspond to. Round uint32 // OnionKeys are the encryption keys in mixnet order. OnionKeys []*[32]byte // RawServiceData is the extra data required by the mixnet service. RawServiceData []byte // ServiceData is the result of parsing the RawServiceData; // it is not included in the signing message. ServiceData interface{} `json:"-"` }
func (*RoundSettings) FromProto ¶
func (s *RoundSettings) FromProto(pbs *pb.RoundSettings) error
func (RoundSettings) Proto ¶
func (s RoundSettings) Proto() *pb.RoundSettings
func (RoundSettings) SigningMessage ¶
func (s RoundSettings) SigningMessage() []byte
type Server ¶
type Server struct { SigningKey ed25519.PrivateKey CoordinatorKey ed25519.PublicKey Services map[string]MixService // contains filtered or unexported fields }
func (*Server) CloseRound ¶
func (srv *Server) CloseRound(ctx context.Context, req *pb.CloseRoundRequest) (*pb.CloseRoundResponse, error)
func (*Server) DeleteRound ¶
func (*Server) GetOnions ¶
func (srv *Server) GetOnions(req *pb.GetOnionsRequest, stream pb.Mixnet_GetOnionsServer) error
func (*Server) NewRound ¶
func (srv *Server) NewRound(ctx context.Context, req *pb.NewRoundRequest) (*pb.NewRoundResponse, error)
func (*Server) SetRoundSettings ¶
func (srv *Server) SetRoundSettings(ctx context.Context, req *pb.SetRoundSettingsRequest) (*pb.RoundSettingsSignature, error)
SetRoundSettings is an RPC used by the coordinator to set the parameters for a round. The RPC returns a signature of the round settings. Clients must verify this signature from each server before participating in the round. This prevents dishonest servers from tricking clients and other servers into using different keys or a different number of mailboxes in a round (which can lead to distinguishable noise).