Documentation ¶
Index ¶
- Constants
- func RPCCall(address string, methodName string, args interface{}, reply interface{}) error
- func SilenceLoggers()
- type BatchReadReply
- type BatchReadRequest
- type Config
- type EncodedReadArgs
- type Error
- type FrontendInterface
- type FrontendRPC
- func (f *FrontendRPC) GetConfig(_ *interface{}, reply *Config) error
- func (f *FrontendRPC) GetName(_ *interface{}, reply *string) error
- func (f *FrontendRPC) GetUpdates(args *GetUpdatesArgs, reply *GetUpdatesReply) error
- func (f *FrontendRPC) Read(args *EncodedReadArgs, reply *ReadReply) error
- func (f *FrontendRPC) Write(args *WriteArgs, reply *WriteReply) error
- type GetUpdatesArgs
- type GetUpdatesReply
- type Logger
- type PirArgs
- type PrivateTrustDomainConfig
- type Range
- type ReadArgs
- type ReadReply
- type ReadRequest
- type ReplicaInterface
- type ReplicaRPC
- type ReplicaWriteArgs
- type ReplicaWriteReply
- type TrustDomainConfig
- type WriteArgs
- type WriteReply
Constants ¶
const EnvPrefix = "TALEK"
EnvPrefix defines the prefix for environment variables
const MsgMaxFragments = 128
MsgMaxFragments defines the maximum number of cells a message can span
Variables ¶
This section is empty.
Functions ¶
func SilenceLoggers ¶
func SilenceLoggers()
SilenceLoggers will disable all loggers created with this library
Types ¶
type BatchReadReply ¶
BatchReadReply is a response to a BatchReadRequest.
type BatchReadRequest ¶
type BatchReadRequest struct { Args []EncodedReadArgs // Set of Read requests SeqNoRange Range ReplyChan chan *BatchReadReply `json:"-"` }
BatchReadRequest are a batch of requests sent to PIR servers from frontend.
type Config ¶
type Config struct { // How many buckets are in the server? NumBuckets uint64 // How many items are in a bucket? BucketDepth uint64 // How many bytes are in an item? DataSize uint64 // Number of bytes // False positive rate of interest vectors BloomFalsePositive float64 // Minimum period between writes WriteInterval time.Duration `json:",string"` // Minimum period between reads ReadInterval time.Duration `json:",string"` // On what multiple of write intervals will new interest vectors be computed InterestMultiple uint64 // Base seed for hashing interest vectors InterestSeed int64 // Max fraction of DB capacity that can store messages MaxLoadFactor float64 /** @todo remove below **/ // What fraction of items should be removed from the DB when items are removed? LoadFactorStep float64 }
Config is a shared configuration needed by both libtalek and server
func ConfigFromFile ¶
ConfigFromFile restores a JSON file. returns the config on success or nil if loading or parsing the file fails.
func (*Config) WindowSize ¶
WindowSize is a computed property of Config for how many items are available at a time
type EncodedReadArgs ¶
type EncodedReadArgs struct { ClientKey [32]byte Nonce [24]byte PirArgs [][]byte //An encrypted PirArgs for each trust domain }
EncodedReadArgs are a trust-domain-encrypted form of ReadArgs
func (*EncodedReadArgs) Decode ¶
func (r *EncodedReadArgs) Decode(id int, trustDomain *TrustDomainConfig) (out PirArgs, err error)
Decode decrypts a specific trust domain of encoded args to recover the pad and request vector.
type FrontendInterface ¶
type FrontendInterface interface { GetName(args *interface{}, reply *string) error GetConfig(args *interface{}, reply *Config) error Write(args *WriteArgs, reply *WriteReply) error Read(args *EncodedReadArgs, reply *ReadReply) error GetUpdates(args *GetUpdatesArgs, reply *GetUpdatesReply) error }
FrontendInterface is the interface between libtalek and the frontend
type FrontendRPC ¶
type FrontendRPC struct {
// contains filtered or unexported fields
}
FrontendRPC is a stub for RPCs to the talek server.
func NewFrontendRPC ¶
func NewFrontendRPC(name string, address string) *FrontendRPC
NewFrontendRPC instantiates a LeaderRPC stub
func (*FrontendRPC) GetConfig ¶
func (f *FrontendRPC) GetConfig(_ *interface{}, reply *Config) error
GetConfig tells the client about current config.
func (*FrontendRPC) GetName ¶
func (f *FrontendRPC) GetName(_ *interface{}, reply *string) error
GetName returns the name of the leader.
func (*FrontendRPC) GetUpdates ¶
func (f *FrontendRPC) GetUpdates(args *GetUpdatesArgs, reply *GetUpdatesReply) error
GetUpdates provides the global interest vector.
func (*FrontendRPC) Read ¶
func (f *FrontendRPC) Read(args *EncodedReadArgs, reply *ReadReply) error
func (*FrontendRPC) Write ¶
func (f *FrontendRPC) Write(args *WriteArgs, reply *WriteReply) error
type GetUpdatesArgs ¶
type GetUpdatesArgs struct { }
GetUpdatesArgs is the empty pointer fullfilling the RPC calling convention.
type GetUpdatesReply ¶
GetUpdatesReply has the interestvector response for a getupdates call
type Logger ¶
type Logger struct { Trace *log.Logger Info *log.Logger Warn *log.Logger Error *log.Logger // contains filtered or unexported fields }
Logger tracks status.
type PrivateTrustDomainConfig ¶
type PrivateTrustDomainConfig struct { *TrustDomainConfig PrivateKey [32]byte SignPrivateKey [64]byte }
PrivateTrustDomainConfig allows export of the trust domain Private Key.
type Range ¶
Range is a range of sequence numbers
type ReadArgs ¶
type ReadArgs struct {
TD []PirArgs
}
ReadArgs have the ReadArgs for each trust domain in unencrypted form.
func (*ReadArgs) Bucket ¶
Bucket returns the bucket index that a read requests, or -1 for invalid args.
func (*ReadArgs) Encode ¶
func (r *ReadArgs) Encode(trustDomains []*TrustDomainConfig) (out EncodedReadArgs, err error)
Encode encrypts a read request for a given trust domain configuration.
type ReadRequest ¶
type ReadRequest struct { Args *EncodedReadArgs ReplyChan chan *ReadReply }
ReadRequest is the actual request sent to the frontend from libtalek. response occurs on the provided replychan
func (*ReadRequest) Reply ¶
func (r *ReadRequest) Reply(reply *ReadReply)
Reply returns the response to the client.
type ReplicaInterface ¶
type ReplicaInterface interface { Write(args *ReplicaWriteArgs, reply *ReplicaWriteReply) error BatchRead(args *BatchReadRequest, reply *BatchReadReply) error }
ReplicaInterface dictates the methods used for server-server communication in the Talek system
type ReplicaRPC ¶
type ReplicaRPC struct {
// contains filtered or unexported fields
}
ReplicaRPC is a stub for the replica RPC interface
func NewReplicaRPC ¶
func NewReplicaRPC(name string, config *TrustDomainConfig) *ReplicaRPC
NewReplicaRPC creates a new ReplicaRPC
func (*ReplicaRPC) BatchRead ¶
func (r *ReplicaRPC) BatchRead(args *BatchReadRequest, reply *BatchReadReply) error
BatchRead performs a set of PIR reads.
func (*ReplicaRPC) Write ¶
func (r *ReplicaRPC) Write(args *ReplicaWriteArgs, reply *ReplicaWriteReply) error
type ReplicaWriteArgs ¶
ReplicaWriteArgs forwards a client write from frontend to replicas.
type ReplicaWriteReply ¶
ReplicaWriteReply contain return status of writes
type TrustDomainConfig ¶
type TrustDomainConfig struct { Name string Address string IsValid bool IsDistributed bool PublicKey [32]byte // For PIR Encryption SignPublicKey [32]byte // For Signing Interest Vectors // contains filtered or unexported fields }
TrustDomainConfig holds the keys for the different talek trust domains.
func NewTrustDomainConfig ¶
func NewTrustDomainConfig(name string, address string, isValid bool, isDistributed bool) *TrustDomainConfig
NewTrustDomainConfig creates a TrustDomainConfig with a freshly generated keypair.
func (*TrustDomainConfig) GetAddress ¶
func (td *TrustDomainConfig) GetAddress() (string, bool)
GetAddress returns the remote address of the TrustDomain
func (*TrustDomainConfig) GetName ¶
func (td *TrustDomainConfig) GetName() (string, bool)
GetName provides the name of the trust domain.
func (*TrustDomainConfig) Private ¶
func (td *TrustDomainConfig) Private() *PrivateTrustDomainConfig
Private exposes the Private key of a trust domain config for marshalling.
bytes, err := json.Marshal(trustdomainconfig.Private())
func (*TrustDomainConfig) UnmarshalJSON ¶
func (td *TrustDomainConfig) UnmarshalJSON(marshaled []byte) error
UnmarshalJSON creates a TrustDomainConfig from a serialized form.
type WriteArgs ¶
type WriteArgs struct { Bucket1 uint64 Bucket2 uint64 Data []byte InterestVector []byte // sha256 hash - expect 32bytes //Internal GlobalSeqNo uint64 ReplyChan chan *WriteReply `json:"-"` }
WriteArgs are passed in writes.
type WriteReply ¶
WriteReply contain return status of writes