Documentation ¶
Index ¶
- Constants
- type CipherBlob
- type Client
- func (c *Client[T]) CopySecret(oc *Client[matrix.Elem64])
- func (c *Client[T]) Free()
- func (c *Client[T]) HintQuery() *HintQuery
- func (c *Client[T]) HintRecover(ans *HintAnswer)
- func (c *Client[T]) PreprocessQuery()
- func (c *Client[T]) PreprocessQueryLHE()
- func (c *Client[T]) Query(q uint64) *pir.Query[T]
- func (c *Client[T]) QueryLHE(q *matrix.Matrix[T]) *pir.Query[T]
- func (c *Client[T]) Recover(ansIn *pir.Answer[T]) []uint64
- func (c *Client[T]) RecoverLHE(ansIn *pir.Answer[T]) *matrix.Matrix[T]
- type HintAnswer
- type HintQuery
- type KeyBlob
- type Server
Constants ¶
const BitsPerLimb = 4
We break each 64-bit (or 32-bit) element of the SimplePIR hint into limbs.
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.
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.
const SecretMax = 2
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 ¶
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]) PreprocessQuery ¶
func (c *Client[T]) PreprocessQuery()
func (*Client[T]) PreprocessQueryLHE ¶
func (c *Client[T]) PreprocessQueryLHE()
type HintAnswer ¶
type HintAnswer struct { MatrixRows uint64 HintCts [][]CipherBlob }
type HintQuery ¶
type HintQuery = []CipherBlob
type Server ¶
func NewServerHintOnly ¶
Beware! You must call Free() on the output Server to clean up C++ objects.
func (*Server[T]) HintAnswer ¶
func (s *Server[T]) HintAnswer(q *HintQuery) *HintAnswer