Documentation
¶
Overview ¶
Copyright (c) 2021-2024 - for information on the respective copyright owner see the NOTICE file and/or the repository https://github.com/carbynestack/ephemeral.
SPDX-License-Identifier: Apache-2.0
Copyright (c) 2021-2025 - for information on the respective copyright owner see the NOTICE file and/or the repository https://github.com/carbynestack/ephemeral.
SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- type Activation
- type ActivationInput
- type AmphoraConfig
- type CastorConfig
- type CtxConfig
- type DiscoveryClient
- type DiscoveryClientConfig
- type DiscoveryClientTypedConfig
- type DiscoveryConfig
- type DiscoveryTypedConfig
- type NetworkControllerConfig
- type OpaConfig
- type OutputConfig
- type ProxyConfig
- type SPDZEngineConfig
- type SPDZEngineTypedConfig
- type WithBus
Constants ¶
const ( // DiscoveryServiceStarted indicates the discovery service has started and ready to processIn events. DiscoveryServiceStarted = "DiscoveryServiceStarted" // GameProtocolError indicates an error in the protocol as a response to the message that were not delivered to the Game state machine. GameProtocolError = "GameProtocolError" // serviceEventsTopic represents the internal discovery service events. ServiceEventsTopic = "serviceEvents" ClientIncomingEventsTopic = "clientIncomingEvents" ClientOutgoingEventsTopic = "clientOutgoingEvents" MasterOutgoingEventsTopic = "masterOutgoingEvents" DiscoveryTopic = "discovery" Init = "Init" Registering = "Registering" Register = "Register" Registered = "Registered" WaitPlayersReady = "WaitPlayersReady" TCPCheck = "TCPCheck" TCPCheckSuccess = "TCPCheckSuccess" TCPCheckFailure = "TCPCheckFailure" Playing = "Playing" PlayerFinishedWithError = "PlayerFinishedWithError" PlayerFinishedWithSuccess = "PlayerFinishedWithSuccess" PlayerReady = "PlayerReady" PlayersReady = "PlayersReady" GameIsReady = "GameIsReady" GameError = "GameError" GameID = "gameID" TupleType = "TupleType" PlayingError = "PlayingError" PlayerDone = "PlayerDone" ModeSlave = "slave" ModeMaster = "master" GameFinishedWithSuccess = "GameFinishedWithSuccess" GameFinishedWithError = "GameFinishedWithError" GameDone = "GameDone" TCPCheckSuccessAll = "TCPCheckSuccessAll" GameSuccess = "GameSuccess" WaitTCPCheck = "WaitTCPCheck" StateTimeoutError = "StateTimeoutError" PlainText = "PLAINTEXT" AmphoraSecret = "AMPHORASECRET" ConnID = "ConnID" EventScope = "EventScope" EventScopeAll = "EventScopeAll" EventScopeSelf = "EventScropeSelf" DefaultPolicy = "carbynestack.def" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activation ¶
type Activation struct {
AmphoraParams []string `json:"amphoraParams"`
SecretParams []string `json:"secretParams"`
GameID string `json:"gameID"`
Code string `json:"code"`
Output OutputConfig `json:"output"`
}
Activation is an object that is received as an input from the Ephemeral client.
type ActivationInput ¶
type AmphoraConfig ¶
type AmphoraConfig struct {
Host string `json:"host"`
Scheme string `json:"scheme"`
Path string `json:"path"`
}
AmphoraConfig specifies the amphora host parameters.
type CastorConfig ¶
type CastorConfig struct {
Host string `json:"host"`
Scheme string `json:"scheme"`
Path string `json:"path"`
TupleStock int32 `json:"tupleStock"`
}
CastorConfig specifies the castor host and tuple stock parameters.
type CtxConfig ¶
type CtxConfig struct {
AuthorizedUser string
Act *Activation
Spdz *SPDZEngineTypedConfig
ProxyEntries []*ProxyConfig
ErrCh chan error
Context context.Context
}
CtxConfig contains both execution and platform specific parameters.
type DiscoveryClient ¶
type DiscoveryClient interface {
Connect() (*grpc.ClientConn, error)
Run(client pb.DiscoveryClient)
GetIn() chan *pb.Event
GetOut() chan *pb.Event
}
DiscoveryClient is an interface for discovery service client.
type DiscoveryClientConfig ¶
type DiscoveryClientConfig struct {
Port string `json:"port"`
Host string `json:"host"`
ConnectTimeout string `json:"connectTimeout"`
}
Config contains TCP connection properties of Carrier.
type DiscoveryClientTypedConfig ¶
DiscoveryClientTypedConfig reflects DiscoveryClientConfig, but it contains the real property types.
type DiscoveryConfig ¶
type DiscoveryConfig struct {
FrontendURL string `json:"frontendURL"`
MasterHost string `json:"masterHost"`
MasterPort string `json:"masterPort"`
Slave bool `json:"slave"`
StateTimeout string `json:"stateTimeout"`
ComputationTimeout string `json:"computationTimeout"`
ConnectTimeout string `json:"connectTimeout"`
Port string `json:"port"`
BusSize int `json:"busSize"`
PortRange string `json:"portRange"`
PlayerCount int `json:"playerCount"`
}
DiscoveryConfig represents the config of discovery service.
type DiscoveryTypedConfig ¶
type DiscoveryTypedConfig struct {
FrontendURL string
MasterHost string
MasterPort string
Slave bool
StateTimeout time.Duration
ComputationTimeout time.Duration
ConnectTimeout time.Duration
Port string
BusSize int
PortRange string
PlayerCount int
}
DiscoveryTypedConfig reflects DiscoveryConfig, but it contains the real property types
type NetworkControllerConfig ¶
type NetworkControllerConfig struct {
TlsEnabled bool `json:"tlsEnabled"`
TlsSecret string `json:"tlsSecret"`
}
NetworkControllerConfig represents the config of the network-controller service.
type OutputConfig ¶
type OutputConfig struct {
Type string `json:"type"`
}
OutputConfig defines how the output of the app execution is treated.
type ProxyConfig ¶
type ProxyConfig struct {
Host string `json:"host"`
Port string `json:"port"`
LocalPort string `json:"localPort"`
}
ProxyConfig is the configuration used by the proxy when the connection between players is established.
type SPDZEngineConfig ¶
type SPDZEngineConfig struct {
ProgramIdentifier string `json:"programIdentifier"`
AuthUserIdField string `json:"authUserIdField"`
RetrySleep string `json:"retrySleep"`
NetworkEstablishTimeout string `json:"networkEstablishTimeout"`
Prime string `json:"prime"`
RInv string `json:"rInv"`
GfpMacKey string `json:"gfpMacKey"`
Gf2nMacKey string `json:"gf2nMacKey"`
Gf2nBitLength int32 `json:"gf2nBitLength"`
// Gf2nStorageSize represents the size in bytes for each gf2n element e.g. depending on the 'USE_GF2N_LONG' flag
// being set when compiling SPDZ where storage size is 16 for USE_GF2N_LONG=1, or 8 if set to 0
Gf2nStorageSize int32 `json:"gf2nStorageSize"`
PrepFolder string `json:"prepFolder"`
OpaConfig OpaConfig `json:"opaConfig"`
AmphoraConfig AmphoraConfig `json:"amphoraConfig"`
CastorConfig CastorConfig `json:"castorConfig"`
FrontendURL string `json:"frontendURL"`
TlsEnabled bool `json:"tlsEnabled"`
PlayerID int32 `json:"playerID"`
PlayerCount int32 `json:"playerCount"`
MaxBulkSize int32 `json:"maxBulkSize"`
DiscoveryConfig DiscoveryClientConfig `json:"discoveryConfig"`
StateTimeout string `json:"stateTimeout"`
ComputationTimeout string `json:"computationTimeout"`
}
SPDZEngineConfig is the VPC specific configuration.
type SPDZEngineTypedConfig ¶
type SPDZEngineTypedConfig struct {
ProgramIdentifier string
AuthUserIdField string
RetrySleep time.Duration
NetworkEstablishTimeout time.Duration
Prime big.Int
RInv big.Int
GfpMacKey big.Int
Gf2nMacKey string
Gf2nBitLength int32
Gf2nStorageSize int32
PrepFolder string
OpaClient opa.AbstractClient
AmphoraClient amphora.AbstractClient
CastorClient castor.AbstractClient
TupleStock int32
PlayerID int32
PlayerCount int32
FrontendURL string
MaxBulkSize int32
DiscoveryConfig DiscoveryClientTypedConfig
StateTimeout time.Duration
ComputationTimeout time.Duration
TlsConfig *tls.Config
}
SPDZEngineTypedConfig reflects SPDZEngineConfig, but it contains the real property types. We need this type, since the default json decoder doesn't know how to deserialize big.Int.
type WithBus ¶
type WithBus interface {
Bus() mb.MessageBus
}
WithBus is a type that contains a message bus.