client

package
v0.0.0-...-7a7f204 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const BlockLength = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Amplify

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

func NewAmplify

func NewAmplify(rnd io.Reader, info *database.Info, params *utils.ParamsLWE, tECC int) *Amplify

func (*Amplify) Query

func (a *Amplify) Query(i, j int) []*matrix.Matrix

func (*Amplify) QueryBytes

func (a *Amplify) QueryBytes(index int) ([]byte, error)

func (*Amplify) Reconstruct

func (a *Amplify) Reconstruct(answers []*matrix.Matrix) (uint32, error)

func (*Amplify) ReconstructBytes

func (a *Amplify) ReconstructBytes(answers []byte) (uint32, error)

type Client

type Client interface {
	QueryBytes([]byte, int) ([][]byte, error)
	ReconstructBytes([][]byte) (interface{}, error)
}

Client represents the client for all (A)PIR clients implemented in the package

type DH

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

Single-server tag retrieval scheme

func NewDH

func NewDH(rnd io.Reader, info *database.Info) *DH

NewDH returns an instance of a DH-based client for the single-server scheme

func (*DH) QueryBytes

func (c *DH) QueryBytes(index int) ([]byte, error)

QueryBytes takes as input the index of an entry in the database and returns the query for the server encoded in bytes

func (*DH) ReconstructBytes

func (c *DH) ReconstructBytes(a []byte) (interface{}, error)

type LWE

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

Client description

func NewLWE

func NewLWE(rnd io.Reader, info *database.Info, params *utils.ParamsLWE) *LWE

func (*LWE) Query

func (c *LWE) Query(i, j int) *matrix.Matrix

func (*LWE) QueryBytes

func (c *LWE) QueryBytes(index int) ([]byte, error)

func (*LWE) Reconstruct

func (c *LWE) Reconstruct(answers *matrix.Matrix) (uint32, error)

func (*LWE) ReconstructBytes

func (c *LWE) ReconstructBytes(a []byte) (uint32, error)

type LWE128

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

Client description

func NewLWE128

func NewLWE128(rnd io.Reader, info *database.Info, params *utils.ParamsLWE) *LWE128

func (*LWE128) Query

func (c *LWE128) Query(i, j int) *matrix.Matrix128

func (*LWE128) QueryBytes

func (c *LWE128) QueryBytes(index int) ([]byte, error)

func (*LWE128) Reconstruct

func (c *LWE128) Reconstruct(answers *matrix.Matrix128) (uint32, error)

func (*LWE128) ReconstructBytes

func (c *LWE128) ReconstructBytes(a []byte) (uint32, error)

type PIR

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

Client for the information theoretic classical PIR multi-bit scheme

func NewPIR

func NewPIR(rnd io.Reader, info *database.Info) *PIR

NewPIR return a client for the classical PIR multi-bit scheme in GF(2), working both with the vector and the rebalanced representation of the database.

func (*PIR) Query

func (c *PIR) Query(index int, numServers int) [][]byte

Query performs a client query for the given database index to numServers servers. This function performs both vector and rebalanced query depending on the database representation

func (*PIR) QueryBytes

func (c *PIR) QueryBytes(in []byte, numServers int) ([][]byte, error)

QueryBytes is wrapper around Query to implement the Client interface

func (*PIR) Reconstruct

func (c *PIR) Reconstruct(answers [][]byte) ([]byte, error)

Reconstruct reconstruct the entry of the database from answers

func (*PIR) ReconstructBytes

func (c *PIR) ReconstructBytes(a [][]byte) (interface{}, error)

ReconstructBytes returns []byte

type PredicateAPIR

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

PredicateAPIR represent the client for the FSS-based complex-queries non-verifiable PIR

func NewPredicateAPIR

func NewPredicateAPIR(rnd io.Reader, info *database.Info) *PredicateAPIR

NewFSS returns a new client for the FSS-based single- and multi-bit schemes

func (*PredicateAPIR) Query

func (c *PredicateAPIR) Query(q *query.ClientFSS, numServers int) []*query.FSS

Query takes as input the index of the entry to be retrieved and the number of servers (= 2 in the DPF case). It returns the two FSS keys.

func (*PredicateAPIR) QueryBytes

func (c *PredicateAPIR) QueryBytes(in []byte, numServers int) ([][]byte, error)

QueryBytes executes Query and encodes the result a byte array for each server

func (*PredicateAPIR) Reconstruct

func (c *PredicateAPIR) Reconstruct(answers [][]uint32) (uint32, error)

Reconstruct takes as input the answers from the client and returns the reconstructed entry after the appropriate integrity check.

func (*PredicateAPIR) ReconstructBytes

func (c *PredicateAPIR) ReconstructBytes(a [][]byte) (interface{}, error)

ReconstructBytes decodes the answers from the servers and reconstruct the entry, returned as []uint32

type PredicatePIR

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

PredicatePIR represent the client for the FSS-based complex-queries non-verifiable PIR

func NewPredicatePIR

func NewPredicatePIR(rnd io.Reader, info *database.Info) *PredicatePIR

NewPredicatePIR returns a new client for the DPF-base multi-bit classical PIR scheme

func (*PredicatePIR) Query

func (c *PredicatePIR) Query(q *query.ClientFSS, numServers int) []*query.FSS

Query outputs the queries, i.e. DPF keys, for index i. The DPF implementation assumes two servers.

func (*PredicatePIR) QueryBytes

func (c *PredicatePIR) QueryBytes(in []byte, numServers int) ([][]byte, error)

QueryBytes executes Query and encodes the result a byte array for each server

func (*PredicatePIR) Reconstruct

func (c *PredicatePIR) Reconstruct(answers [][]uint32) (uint32, error)

Reconstruct reconstruct the entry of the database from answers

func (*PredicatePIR) ReconstructBytes

func (c *PredicatePIR) ReconstructBytes(answers [][]byte) (interface{}, error)

ReconstructBytes returns []byte

type StateLWE

type StateLWE struct {
	A *matrix.Matrix
	// contains filtered or unexported fields
}

type StateLWE128

type StateLWE128 struct {
	A *matrix.Matrix128
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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