oprf

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

Oblivious Pseudorandom Function (OPRF)

Introduction

An Oblivious Pseudorandom Function (OPRF) is a two-party protocol for computing the output of a pseudorandom function (PRF). A PRF F(k, x) is an efficiently computable function taking a secret key k and an input x that produces a pseudorandom output. This function is pseudorandom if the keyed function is indistinguishable from a randomly sampled function acting on the same domain and range. In the KKRT OPRF [1], one party (the sender) holds the PRF secret key, and the other (the receiver) holds the PRF output evaluated using the secret key on his inputs. The sender can later on use the same secret key to evaluate the OPRF output on any input. The 'obliviousness' property ensures that the sender does not learn anything about the receiver's input during the evaluation. The receiver should also not learn anything about the sender's secret PRF key. This can be efficiently implemented by slightly modifying the KKRT 1 out of n OT extension protocol.

Implementation

We have implemented an OPRF that is inspired by [1], [2] and [3] that uses Naor-Pinkas as its underlying baseOT.

References

[1] V. Kolesnikov, R. Kumaresan, M. Rosulek, N.Trieu. Efficient Batched Oblivious PRF with Applications to Private Set Intersection. Source: https://eprint.iacr.org/2016/799.pdf, and ACM version at https://dl.acm.org/doi/pdf/10.1145/2976749.2978381.

[2] Y. Ishai, J. Kilian, K. Nissim, E. Petrank. "Extending oblivious transfers efficiently." In Annual International Cryptology Conference (pp. 145-161). Springer, Berlin, Heidelberg, 2003. Source: https://www.iacr.org/archive/crypto2003/27290145/27290145.pdf

[3] G. Asharov, Y. Lindell, T. Schneider, M. Zohner. "More Efficient Oblivious Transfer Extensions". Source: https://dl.acm.org/doi/10.1007/s00145-016-9236-6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

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

Key contains the relaxed OPRF keys: (C, s), (j, q_j) oprfKeys is the received OT extension matrix oprfKeys chosen with choice bytes secret.

func (Key) Encode

func (k Key) Encode(rowIdx uint64, pseudorandomEncoding []byte)

Encode computes and returns the OPRF encoding of a byte slice using an OPRF Key

type OPRF

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

OPRF implements the oprf struct containing the base OT as well as the number of message tuples.

func NewOPRF

func NewOPRF(m int) *OPRF

NewOPRF returns an OPRF where m specifies the number of message tuples being exchanged.

func (*OPRF) Receive

func (ext *OPRF) Receive(choices *cuckoo.Cuckoo, secretKey []byte, rw io.ReadWriter) ([]map[uint64]uint64, error)

Receive returns the hashes of OPRF encodings of choice strings embedded in the cuckoo hash table using OPRF keys

func (*OPRF) Send

func (ext *OPRF) Send(rw io.ReadWriter) (*Key, error)

Send returns the OPRF keys

Jump to

Keyboard shortcuts

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