ot

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: 5 Imported by: 0

README

Oblivious Transfer (OT)

Introduction

Oblivious transfer is a cryptographic primitive crucial to building secure multiparty computation (MPC) protocols. A secure OT protocol allows for two untrusted parties, a sender and a receiver, to perform data exchange in the following way. A sender has as input two messages M0, M1, and a receiver has a selection bit b. After the OT protocol, the receiver will learn only the message Mb and not M1-b, while the sender does not learn the selection bit b. This way the receiver does not learn the unintended message (protect against malicious receiver), and the sender cannot forge messages, since he does not know which message will be learnt by the receiver (protect against malicious sender). After 40 years since its invention, two notable base OT protocols are the Naor-Pinkas OT[1] and the Simplest Protocol for OT[2]. The Naor-Pinkas[1] OT protocol using crypto/elliptic is implemented here.

References

[1] M. Naor, B. Pinkas. "Efficient oblivious transfer protocols." In SODA (Vol. 1, pp. 448-457), 2001. Paper available here: https://link.springer.com/content/pdf/10.1007/978-3-662-46800-5_26.pdf

[2] T. Chou, O. Claudio. "The simplest protocol for oblivious transfer." In International Conference on Cryptology and Information Security in Latin America (pp. 40-58). Springer, Cham, 2015. Paper available here: https://eprint.iacr.org/2015/267.pdf

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBaseCountMissMatch = errors.New("provided slices is not the same length as the number of base OT")
	ErrEmptyMessage       = errors.New("attempt to perform OT on empty messages")
)

Functions

This section is empty.

Types

type OT

type OT interface {
	Send(messages []OTMessage, rw io.ReadWriter) error
	Receive(choices []uint8, messages [][]byte, rw io.ReadWriter) error
}

OT implements a BaseOT

func NewNaorPinkas

func NewNaorPinkas(msgLens []int) OT

type OTMessage

type OTMessage [2][]byte

OTMessage represent a pair of messages where an OT receiver with choice bit 0 will correctly decode the first message and an OT receiver with choice bit 1 will correctly decode the second message

Jump to

Keyboard shortcuts

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