oblivious_transfer_protocols/lib.rs
1//! # Oblivious Transfer (OT), Oblivious Transfer Extensions (OTE) and multi-party protocols based on that.
2//!
3//! ## Oblivious Transfer protocols
4//!
5//! 1. [Simplest OT protocol](./src/base_ot/simplest_ot.rs)
6//! 2. [Naor Pinkas OT](./src/base_ot/naor_pinkas_ot.rs)
7//! 3. [Endemic OT](./src/base_ot/endemic_ot.rs)
8//!
9//! ## Oblivious Transfer Extensions
10//! 1. [ALSZ](./src/ot_extensions/alsz_ote.rs)
11//! 2. [KOS](./src/ot_extensions/kos_ote.rs)
12//!
13//! ## Oblivious Transfer based multiplication
14//! 1. [DKLS18](./src/ot_based_multiplication/dkls18_mul_2p.rs) - 2 party multiplication of where each party has a single input
15//! 2. [DKLS19](./src/ot_based_multiplication/dkls19_batch_mul_2p.rs) - 2 party batch-multiplication of where each party has multiple inputs, say `n` inputs and those inputs will be multiplied, i.e. a total of `2*n` multiplications will be done with each being between 2 inputs
16//!
17
18#![cfg_attr(not(feature = "std"), no_std)]
19#![allow(non_snake_case)]
20
21pub mod error;
22
23pub mod base_ot;
24pub mod cointoss;
25/// 2-party and multi-party multiplication protocols built on Oblivious Transfer (OT)
26pub mod ot_based_multiplication;
27pub mod ot_extensions;
28pub mod zero_sharing;
29
30pub mod configs;
31
32mod aes_prng;
33pub mod util;
34
35use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
36use ark_std::vec::Vec;
37use serde::{Deserialize, Serialize};
38
39pub type Key = Vec<u8>;
40pub type Bit = bool;
41pub type Message = Vec<u8>;
42
43/// A bit matrix stored in row-major order, i.e. the first byte has the first 8 bits, second byte has
44/// next 8 bits, and so on.
45#[derive(
46 Clone, Debug, PartialEq, Eq, CanonicalSerialize, CanonicalDeserialize, Serialize, Deserialize,
47)]
48pub struct BitMatrix(pub Vec<u8>);
49
50pub type ParticipantId = u16;