underhood

package
v0.0.0-...-f053a81 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const BitsPerLimb = 4

We break each 64-bit (or 32-bit) element of the SimplePIR hint into limbs.

View Source
const NumLimbs32 = 5

When using 32-bit values, the SimplePIR p is 2^8, so we need to recover the top 8 bits of the resulting ciphertext (to perform decryption). The max. value of each limb is again 2^16 (in practice, it's actually smaller because we use secret dimension 1408). So, to accurately get the value of the top 8 bits, we need to compute over only the top 5 (of 8) limbs.

View Source
const NumLimbs64 = 8

When using 64-bit values, the SimplePIR p is 2^17, so we need to recover the top 17 bits of the resulting ciphertext (to perform decryption). The maximum value of each limb is 2^16 (because the secret dimension is 2^11, the max secret value is 2, and the max limb value is 2^4-1). So, to accurately get the value of the top 17 bits, we need to compute over only the top 8 (of 16) limbs.

View Source
const SecretMax = 2
View Source
const SecretMin = 0

Bound on norm of entries of secret for the "inner" encryption scheme. We use ternary secrets in the range [0, 1, 2].

Variables

This section is empty.

Functions

This section is empty.

Types

type CipherBlob

type CipherBlob = []byte

type Client

type Client[T matrix.Elem] struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient[T matrix.Elem](matrixAseed *rand.PRGKey, dbinfo *pir.DBInfo) *Client[T]

WARNING: You must call Free() on this client to cleanup

func NewClientDistributed

func NewClientDistributed[T matrix.Elem](matrixAseeds []rand.PRGKey, offsets []uint64, dbinfo *pir.DBInfo) *Client[T]

WARNING: You must call Free() on this client to cleanup

func (*Client[T]) CopySecret

func (c *Client[T]) CopySecret(oc *Client[matrix.Elem64])

func (*Client[T]) Free

func (c *Client[T]) Free()

func (*Client[T]) HintQuery

func (c *Client[T]) HintQuery() *HintQuery

func (*Client[T]) HintRecover

func (c *Client[T]) HintRecover(ans *HintAnswer)

Recover H.s

func (*Client[T]) PreprocessQuery

func (c *Client[T]) PreprocessQuery()

func (*Client[T]) PreprocessQueryLHE

func (c *Client[T]) PreprocessQueryLHE()

func (*Client[T]) Query

func (c *Client[T]) Query(q uint64) *pir.Query[T]

func (*Client[T]) QueryLHE

func (c *Client[T]) QueryLHE(q *matrix.Matrix[T]) *pir.Query[T]

func (*Client[T]) Recover

func (c *Client[T]) Recover(ansIn *pir.Answer[T]) []uint64

func (*Client[T]) RecoverLHE

func (c *Client[T]) RecoverLHE(ansIn *pir.Answer[T]) *matrix.Matrix[T]

type HintAnswer

type HintAnswer struct {
	MatrixRows uint64
	HintCts    [][]CipherBlob
}

type HintQuery

type HintQuery = []CipherBlob

type KeyBlob

type KeyBlob = []byte

type Server

type Server[T matrix.Elem] struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer[T matrix.Elem](db *pir.Database[T], matrixAseed *rand.PRGKey) *Server[T]

Beware! You must call Free() on the output Server to clean up C++ objects.

func NewServerHintOnly

func NewServerHintOnly[T matrix.Elem](hintIn *matrix.Matrix[T]) *Server[T]

Beware! You must call Free() on the output Server to clean up C++ objects.

func (*Server[T]) Answer

func (s *Server[T]) Answer(q *pir.Query[T]) *pir.Answer[T]

func (*Server[T]) Free

func (s *Server[T]) Free()

func (*Server[T]) HintAnswer

func (s *Server[T]) HintAnswer(q *HintQuery) *HintAnswer

Jump to

Keyboard shortcuts

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