ot

package
v0.0.0-...-f3f2e40 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BreakCorrelation

func BreakCorrelation(rows [][]byte) []byte

func Clmul128

func Clmul128(a, b []byte) []byte

Types

type OTReceiver

type OTReceiver struct {
	T0 [][]byte
	T1 [][]byte

	A   *ristretto.Point
	RT0 []byte
	// contains filtered or unexported fields
}

func (*OTReceiver) CreateRequest

func (o *OTReceiver) CreateRequest(choiceBits []int) []byte

CreateRequest creates a request for OT for the choice bits.

func (*OTReceiver) Init

func (o *OTReceiver) Init(otCount int)

func (*OTReceiver) ParseResponse

func (o *OTReceiver) ParseResponse(choiceBits []int, encodedOT []byte) []byte

ParseResponse parses (i.e. decodes) the OT response from the OT sender and returns the plaintext result of OT. For every choice bit, it unmasks one of the two 16-byte messages.

func (*OTReceiver) SetupStep1

func (o *OTReceiver) SetupStep1() ([]byte, []byte)

func (*OTReceiver) SetupStep2

func (o *OTReceiver) SetupStep2(allBsBlob, senderSeedShare []byte) ([]byte, []byte, []byte, []byte)

type OTSender

type OTSender struct {
	TotalOT int
	// contains filtered or unexported fields
}

OTSender implements the sender of the Oblivious Transfer acc.to. the KOS15 protocol

func (*OTSender) Init

func (o *OTSender) Init(otCount int)

func (*OTSender) ProcessRequest

func (o *OTSender) ProcessRequest(otRequest, messages []byte) []byte

ProcessRequest processes a request for OT from the OT receiver. otRequest contains bits which need to be flipped acc.to the Beaver derandomiation method. The Sender has two 16-byte messages for 1-of-2 OT and two random masks (from the KOS15 protocol) r0 and r1. If the bit to flip is 0, the Sender sends (m0 xor r0) and (m1 xor r1). If the bit to flip is 1, the Sender sends (m0 xor r1) and (m1 xor r0). Returns an OT response.

func (*OTSender) SetupStep1

func (o *OTSender) SetupStep1(A_, hisCommit []byte) ([]byte, []byte)

func (*OTSender) SetupStep2

func (o *OTSender) SetupStep2(encryptedColumnsBlob, receiverSeedShare, x, t []byte)

Jump to

Keyboard shortcuts

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