updatable

package
v0.0.0-...-0cd06db Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeRiceIntegers

func DecodeRiceIntegers(rice *RiceDeltaEncoding) ([]uint32, error)

Copied from Google's code

func EncodeRiceIntegers

func EncodeRiceIntegers(values []uint32) (*RiceDeltaEncoding, error)

func EncodeRiceIntegersWithParam

func EncodeRiceIntegersWithParam(values []uint32, riceParam int32) (*RiceDeltaEncoding, error)

func NewRiceDecoder

func NewRiceDecoder(br *bitReader, k uint32) *riceDecoder

func NewRiceEncoder

func NewRiceEncoder(bw *bitWriter, k uint32) *riceEncoder

func RiceEncodedHashes

func RiceEncodedHashes(hashInts []uint32) (*RiceDeltaEncoding, error)

Types

type Client

type Client struct {

	// For testing
	CallAsync bool
	// contains filtered or unexported fields
}

func NewClient

func NewClient(source *rand.Rand, pirType pir.PirType, servers [2]UpdatableServer) *Client

func (*Client) Init

func (c *Client) Init() error

func (*Client) Keys

func (c *Client) Keys() []uint32

func (*Client) Read

func (c *Client) Read(key uint32) (pir.Row, error)

func (*Client) StorageNumBytes

func (c *Client) StorageNumBytes(sizeFunc func(interface{}) (int, error)) int

func (*Client) Update

func (c *Client) Update() error

type KeyUpdatesReq

type KeyUpdatesReq struct {
	DefragTimestamp int32
	NextTimestamp   int32
}

type KeyUpdatesResp

type KeyUpdatesResp struct {
	InitialTimestamp int32
	DefragTimestamp  int

	Keys     []uint32
	KeysRice *sb.RiceDeltaEncoding

	//Bit vector
	IsDeletion []byte
	RowLen     int

	ShouldDeleteHistory bool
}

type Server

type Server struct {
	pir.StaticDB
	// contains filtered or unexported fields
}

func NewUpdatableServer

func NewUpdatableServer() *Server

func (*Server) AddRows

func (s *Server) AddRows(keys []uint32, rows []pir.Row)

func (*Server) DeleteRows

func (s *Server) DeleteRows(keys []uint32)

func (*Server) KeyUpdates

func (s *Server) KeyUpdates(req KeyUpdatesReq, resp *KeyUpdatesResp) error

func (*Server) NumKeys

func (s *Server) NumKeys() int

func (*Server) Row

func (s *Server) Row(idx int) (uint32, pir.Row, error)

func (*Server) SomeKeys

func (s *Server) SomeKeys(num int) []uint32

type UpdatableHintReq

type UpdatableHintReq struct {
	Req      pir.HintReq
	FirstRow int
	NumRows  int
}

func (*UpdatableHintReq) Process

func (req *UpdatableHintReq) Process(db pir.StaticDB) (pir.HintResp, error)

type UpdatableQueryReq

type UpdatableQueryReq struct {
	Reqs     []pir.QueryReq
	FirstRow []int
}

func (UpdatableQueryReq) Process

func (req UpdatableQueryReq) Process(db pir.StaticDB) (interface{}, error)

type UpdatableQueryResp

type UpdatableQueryResp []interface{}

type UpdatableServer

type UpdatableServer interface {
	pir.Server
	KeyUpdates(req KeyUpdatesReq, resp *KeyUpdatesResp) error
}

type WaterfallClient

type WaterfallClient struct {
	// contains filtered or unexported fields
}

func NewWaterfallClient

func NewWaterfallClient(source *rand.Rand, pirType pir.PirType) *WaterfallClient

func (*WaterfallClient) HintUpdateReq

func (c *WaterfallClient) HintUpdateReq(numNewRows int, rowLen int) (*UpdatableHintReq, error)

func (*WaterfallClient) InitHint

func (c *WaterfallClient) InitHint(resp pir.HintResp) error

func (*WaterfallClient) LayersMaxSize

func (c *WaterfallClient) LayersMaxSize(nRows int) []int

func (*WaterfallClient) Query

func (c *WaterfallClient) Query(pos int) ([]pir.QueryReq, pir.ReconstructFunc)

func (*WaterfallClient) State

func (c *WaterfallClient) State() (bitsPerKey, fixedBytes int)

Jump to

Keyboard shortcuts

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