client

package
v0.0.0-...-5ae0b98 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ServerA int = 0

ServerA is the ID (index) of the first server

View Source
const ServerB int = 1

ServerB is the ID (index) of the second server (only used for secret-sharing based API calls)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ServerAddresses []string
	ServerPorts     []string
	SessionParams   *api.SessionParameters

	// all timing information collected during protocol execution
	Experiment *RuntimeExperiment
}

Client is used to store all relevant client information

func (*Client) InitSession

func (client *Client) InitSession()

InitSession creates a new API session with the server

func (*Client) PrivateANNQuery

func (client *Client) PrivateANNQuery(keys [][]uint64) int

PrivateANNQuery privately retrieves the values in buckets with associated keys keys from each table and returns the first non-zero candidate. keys: (NumTables, NumProbes) array keys to probe in each table keywordBits: size of each keyword (DPF bits)

func (*Client) TerminateSessions

func (client *Client) TerminateSessions()

TerminateSessions ends the client session on both servers

func (*Client) WaitForExperimentStart

func (client *Client) WaitForExperimentStart()

WaitForExperimentStart completes once the servers are ready to start the experiment

type RuntimeExperiment

type RuntimeExperiment struct {
	DatasetName             string  `json:"dataset_name"`
	DatasetSize             int     `json:"dataset_size"`
	NumFeatures             int     `json:"num_features"`
	NumTables               int     `json:"num_tables"`
	NumProbes               int     `json:"num_probes"`
	HashFunctionRange       int     `json:"hash_function_range"`
	NumServerProcs          int     `json:"num_server_procs"`
	ServerPreprocessingMS   int64   `json:"server_preprocessing_ms"`
	QueryUpBandwidthBytes   []int64 `json:"query_up_bandwidth_bytes"`
	QueryDownBandwidthBytes []int64 `json:"query_down_bandwidth_bytes"`
	QueryServerMS           []int64 `json:"dpf_server_ms"`
	QueryMaskingServerUS    []int64 `json:"masking_server_us"`
	QueryClientMS           []int64 `json:"query_client_ms"`
}

RuntimeExperiment captures all the information needed to evaluate a two-server deployment

Jump to

Keyboard shortcuts

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