Documentation
¶
Overview ¶
Package ot provides generalises a common interface for 1-out-of-2 Oblivious Transfer protocols. .
See README.md for details.
Index ¶
- Variables
- func TransposePackedBits(inputMatrix [][]byte) ([][]byte, error)
- type DefaultSuite
- type PackedBits
- func (pb PackedBits) BitLen() int
- func (pb PackedBits) Clear(i uint)
- func (pb PackedBits) Get(i uint) uint8
- func (pb PackedBits) Repeat(nRepetitions int) PackedBits
- func (pb PackedBits) Set(i uint)
- func (pb PackedBits) String() string
- func (pb PackedBits) Swap(i, j uint)
- func (pb PackedBits) Unpack() []uint8
- type ReceiverOutput
- type SenderOutput
- type Suite
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func TransposePackedBits ¶
TransposePackedBits transposes a 2D matrix of "packed" bits (represented in groups of 8 bits per bytes), yielding a new 2D matrix of "packed" bits. If we were to unpack the bits, inputMatrixBits[i][j] == outputMatrixBits[j][i].
Types ¶
type DefaultSuite ¶
type DefaultSuite struct {
// contains filtered or unexported fields
}
DefaultSuite implements Suite with fixed parameters.
func NewDefaultSuite ¶
func NewDefaultSuite(xi, l int) (*DefaultSuite, error)
NewDefaultSuite constructs a suite with the given batch size xi and message block length l.
func (*DefaultSuite) Xi ¶
func (s *DefaultSuite) Xi() int
Xi returns the batch size (number of parallel OTs).
type PackedBits ¶
type PackedBits []byte
PackedBits is a byte vector of little-endian packed bits.
func Pack ¶
func Pack(unpackedBits []uint8) (PackedBits, error)
Pack compresses the bits in the input vector v, truncating each input byte to its least significant bit. E.g., [0x01,0x01,0x01,0x01, 0x00,0x00,0x01,0x00] ---> [0xF0].
func Parse ¶
func Parse(v string) (PackedBits, error)
Parse converts a binary string into PackedBits.
func (PackedBits) BitLen ¶
func (pb PackedBits) BitLen() int
BitLen returns the number of bits represented by the packed slice.
func (PackedBits) Clear ¶
func (pb PackedBits) Clear(i uint)
Clear sets the `i`th bit of a packed bits vector to 0.
func (PackedBits) Get ¶
func (pb PackedBits) Get(i uint) uint8
Get gets the `i`th bit of a packed bits vector. E.g., [0x12, 0x34] --> [0,1,0,0, 1,0,0,0, 1,1,0,0, 0,0,1,0].
func (PackedBits) Repeat ¶
func (pb PackedBits) Repeat(nRepetitions int) PackedBits
Repeat repeats the bits in the input vector `nrepetitions` times. E.g., if v = [0,1,0,1] and nrepetitions = 2, then the output is [0,0,1,1,0,0,1,1]. To do so, bits must be unpacked, repeated, and packed in the output.
func (PackedBits) Set ¶
func (pb PackedBits) Set(i uint)
Set sets the `i`th bit of a packed bits vector. Input `bit` is truncated to its least significant bit (i.e., we only consider the last bit of `bit`).
func (PackedBits) String ¶
func (pb PackedBits) String() string
String returns a string representation of the packed bits.
func (PackedBits) Unpack ¶
func (pb PackedBits) Unpack() []uint8
Unpack expands the bits of the input vector into separate bytes. E.g., [0xF0,0x12] ---> [1,1,1,1, 0,0,0,0, 0,0,0,1, 0,0,1,0].
type ReceiverOutput ¶
type ReceiverOutput[D any] struct { Choices []byte `cbor:"choices"` Messages [][]D `cbor:"messages"` }
ReceiverOutput holds the receiver's choice bits and selected messages.
func (*ReceiverOutput[D]) InferredL ¶
func (ro *ReceiverOutput[D]) InferredL() int
InferredL infers l from the first row and validates consistency across all entries.
func (*ReceiverOutput[D]) InferredXi ¶
func (ro *ReceiverOutput[D]) InferredXi() int
InferredXi infers xi from choice bits and message count, returning 0 on mismatch.
type SenderOutput ¶
type SenderOutput[D any] struct { Messages [][2][]D `cbor:"messages"` }
SenderOutput holds the sender's pair of messages for each OT and block index.
func (*SenderOutput[D]) InferredL ¶
func (so *SenderOutput[D]) InferredL() int
InferredL infers l from the first entry and validates consistency across all entries.
func (*SenderOutput[D]) InferredXi ¶
func (so *SenderOutput[D]) InferredXi() int
InferredXi infers xi from the message count, or returns 0 if inconsistent.
Directories
¶
| Path | Synopsis |
|---|---|
|
base
|
|
|
ecbbot
Package ecbbot implements the "Batched Simplest OT", an OT protocol with endemic security defined in Figure 3 of MRR21, to run Random OTs (ROT) for a batch of choice bits in parallel.
|
Package ecbbot implements the "Batched Simplest OT", an OT protocol with endemic security defined in Figure 3 of MRR21, to run Random OTs (ROT) for a batch of choice bits in parallel. |
|
vsot
Package vsot implements the "Verified Simplest OT", as defined in "protocol 7" of DKLs18.
|
Package vsot implements the "Verified Simplest OT", as defined in "protocol 7" of DKLs18. |
|
extension
|
|
|
softspoken
Package softspoken implements of maliciously secure 1-out-of-2 Correlated Oblivious Transfer extension (COTe) protocol.
|
Package softspoken implements of maliciously secure 1-out-of-2 Correlated Oblivious Transfer extension (COTe) protocol. |