setup

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

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

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

type Description struct {
	Cpk bool
	Rlk bool
	Gks []uint64
}

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 Event added in v0.2.0

type Event struct {
	protocols.Event
}

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

func (s *Service) GetCollectivePublicKey(ctx context.Context) (*rlwe.PublicKey, error)

GetCollectivePublicKey returns the collective public key when available. The method blocks until the corresponding protocol completes.

func (*Service) GetGaloisKey

func (s *Service) GetGaloisKey(ctx context.Context, galEl uint64) (*rlwe.GaloisKey, error)

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

func (s *Service) GetRelinearizationKey(ctx context.Context) (*rlwe.RelinearizationKey, error)

GetRelinearizationKey returns the relinearization key when available. The method blocks until the corresponding protocol completes.

func (*Service) Incoming

func (s *Service) Incoming() <-chan protocols.Event

Incoming returns the incoming event channel for the protocols.Coordinator interface.

func (*Service) Logf

func (s *Service) Logf(msg string, v ...any)

Logf prints a log message.

func (*Service) NodeID

func (s *Service) NodeID() sessions.NodeID

NodeID returns the node ID associated with this service.

func (*Service) Outgoing

func (s *Service) Outgoing() chan<- protocols.Event

Outgoing returns the outgoing event channel for the protocols.Coordinator interface.

func (*Service) Register

func (s *Service) Register(nid sessions.NodeID) error

Register registers a connected node to the service.

func (*Service) Run

func (s *Service) Run(ctx context.Context, upstream Coordinator, trans Transport) error

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

func (s *Service) RunSignature(ctx context.Context, sig protocols.Signature) error

RunSignature queues the given signature for execution. This method is called by the helper.

func (*Service) Unregister

func (s *Service) Unregister(nid sessions.NodeID) error

Unregister unregisters a disconnected node from the service

type ServiceConfig

type ServiceConfig struct {
	Protocols protocols.ExecutorConfig
}

ServiceConfig is the configuration for the setup service.

type SignatureList

type SignatureList []protocols.Signature

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.

func (SignatureList) Contains

func (sl SignatureList) Contains(other protocols.Signature) bool

Contains checks if a list of signatures contains a given signature.

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.

Jump to

Keyboard shortcuts

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