Documentation ¶
Overview ¶
Package setup implements the MHE setup phase as a service. This serices executes the key generation protocols and makes their outputs available.
Index ¶
- func CheckTestSetup(ctx context.Context, t *testing.T, lt *sessions.TestSession, setup Description, ...)
- type Coordinator
- type Description
- type Event
- type Service
- func (s *Service) AggregationOutputHandler(ctx context.Context, aggOut protocols.AggregationOutput) error
- func (s *Service) GetAggregationOutput(ctx context.Context, pd protocols.Descriptor) (out *protocols.AggregationOutput, err error)
- func (s *Service) GetCollectivePublicKey(ctx context.Context) (*rlwe.PublicKey, error)
- func (s *Service) GetGaloisKey(ctx context.Context, galEl uint64) (*rlwe.GaloisKey, error)
- func (s *Service) GetProtocolInput(ctx context.Context, pd protocols.Descriptor) (protocols.Input, error)
- func (s *Service) GetRelinearizationKey(ctx context.Context) (*rlwe.RelinearizationKey, error)
- func (s *Service) Incoming() <-chan protocols.Event
- func (s *Service) Logf(msg string, v ...any)
- func (s *Service) NodeID() sessions.NodeID
- func (s *Service) Outgoing() chan<- protocols.Event
- func (s *Service) Register(nid sessions.NodeID) error
- func (s *Service) Run(ctx context.Context, upstream Coordinator, trans Transport) error
- func (s *Service) RunSignature(ctx context.Context, sig protocols.Signature) error
- func (s *Service) Unregister(nid sessions.NodeID) error
- type ServiceConfig
- type SignatureList
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckTestSetup ¶
func CheckTestSetup(ctx context.Context, t *testing.T, lt *sessions.TestSession, setup Description, n sessions.PublicKeyProvider)
CheckTestSetup checks if a public key provider is able to produce valid keys for a given test session and setup description.
Types ¶
type Coordinator ¶ added in v0.2.0
type Coordinator coordinator.Coordinator[Event]
type Description ¶
Description is a struct for specifying an MHE setup phase. It contains the information about the keys that should be generated: - Cpk: The collective public key - Rlk: The relinearization key - Gks: The Galois keys, identified by their Galois elements
func (Description) String ¶
func (sd Description) String() string
String returns a string representation of the Description.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents an instance of the setup service.
func NewSetupService ¶
func NewSetupService(ownID sessions.NodeID, sessProv sessions.Provider, conf ServiceConfig, backend objectstore.ObjectStore) (s *Service, err error)
NewSetupService creates a new setup service.
func (*Service) AggregationOutputHandler ¶
func (s *Service) AggregationOutputHandler(ctx context.Context, aggOut protocols.AggregationOutput) error
AggregationOutputHandler is called when a protocol aggregation completes. It is meant to be passed to a protocols.Executor as a protocols.AggregationOutputHandler method.
func (*Service) GetAggregationOutput ¶
func (s *Service) GetAggregationOutput(ctx context.Context, pd protocols.Descriptor) (out *protocols.AggregationOutput, err error)
GetAggregationOutput returns the aggregation output for the given protocol descriptor. If the output is not available locally, it queries the protocol's aggregator. If called at the aggregator, it runs the protocol and returns the output.
func (*Service) GetCollectivePublicKey ¶
GetCollectivePublicKey returns the collective public key when available. The method blocks until the corresponding protocol completes.
func (*Service) GetGaloisKey ¶
GetGaloisKey returns the Galois key for the given Galois element when available. The method blocks until the corresponding protocol completes.
func (*Service) GetProtocolInput ¶
func (s *Service) GetProtocolInput(ctx context.Context, pd protocols.Descriptor) (protocols.Input, error)
GetProtocolInput returns the protocol inputs for the given protocol descriptor. It is meant to be passed to a protocols.Executor as a protocols.InputProvider method.
func (*Service) GetRelinearizationKey ¶
GetRelinearizationKey returns the relinearization key when available. The method blocks until the corresponding protocol completes.
func (*Service) Incoming ¶
Incoming returns the incoming event channel for the protocols.Coordinator interface.
func (*Service) Outgoing ¶
Outgoing returns the outgoing event channel for the protocols.Coordinator interface.
func (*Service) Run ¶
Run runs the setup service as coordinated by the given coordinator. It processes and forwards incoming events from upstream (coordinator) and downstream (executor). It returns when the upstream coordinator is done and the downstream executor is done.
func (*Service) RunSignature ¶
RunSignature queues the given signature for execution. This method is called by the helper.
type ServiceConfig ¶
type ServiceConfig struct {
Protocols protocols.ExecutorConfig
}
ServiceConfig is the configuration for the setup service.
type SignatureList ¶
SignatureList provides utility functions for a list of signatures.
func DescriptionToSignatureList ¶
func DescriptionToSignatureList(sd Description) SignatureList
DescriptionToSignatureList converts a Description to a list of protocol signatures to be executed.
type Transport ¶
type Transport interface { protocols.Transport // GetAggregationOutput returns the aggregation output for the given protocol. GetAggregationOutput(context.Context, protocols.Descriptor) (*protocols.AggregationOutput, error) }
Transport defines the transport interface needed by the setup service. In the current implementation, this corresponds to the helper interface.