To meet the large-scale demand of OTs, OT extensions can be used. An OT
extension protocol works by running a small number of base OTs that are used as
a base for obtaining many OTs via the use of cheap symmetric cryptographic
operations only. This is conceptually similar to hybrid encryption.
In this subsection, we focus on the maliciously secure OT extension presented in
KOS15.
To be compatible with the garbled circuit optimizations, Correlated OT (COT) is
considered here. COT is a variant of OT, where the sender chooses a secret
string Δ and the receiver has a choice bit b. After the protocol, then
sender obtains two strings X0=X and X1=X⊕Δ and the
receiver obtains Xb, where X is a random string.
Sender Receiver
+----------+
Delta ------->| |<------ b
| COT Prot.|
x_0 = x, x_1 = x + Delta <-------| |-------> x_b
+----------+
Notation. Let λ be the security parameter, we use λ=128 in
zkOracles. Identify F2λ with the finite field F2λ. Use
"⋅" for multiplication in F2λ and "⋆" for the
component-wise product in F2λ. Given a matrix A, denote its rows
by subindices ai and its columns by superindices ak. Use
v[i] to denote the i-th entry of v.
The KOS15 OT protocol to generate ℓ(≫λ) OTs is described as
follows.
-
Initialize
-
The receiver samples λ pairs of λ-bit seeds
{(k0i,k1i)}i=1λ.
-
The sender choose a uniformly random λ-bit string Δ.
-
The two parties calls the base OT with inputs Δ and
{(k0i,k1i)}i=1λ.
- Note that the sender acts as the receiver in the base OT, and the
receiver acts as the sender in the base OT.
-
The sender obtains kΔii for i∈[λ].
-
Extend
-
The receiver takes as input the choice bits x1,...,xℓ, defines
ℓ′=ℓ+λ+s, where s is the statistic parameter, and we
set s=40 in zkOracles. Let
x=x1∥x2∥...∥xℓ∥x′∈F2ℓ′, with
x′∈F2ℓ′−ℓ uniformly chosen.
-
The receiver defines vectors x1,...,xℓ′ as
xi=x[i]⋅(1,...,1)∈F2λ for
i∈[ℓ′].
-
The receiver expands k0i and k1i with a pseudo
random generator (PRG), letting
t0i=PRG(k0i)∈F2ℓ′ and t1i=PRG(k1i)∈F2ℓ′ for i∈[λ]
-
The sender expands kΔii with the same PRG and gets
tΔii=PRG(kΔii) for i∈[λ]
-
The receiver computes
ui=t0i⊕t1i⊕x∈F2ℓ′ for i∈[λ]
and sends them to the sender.
-
The sender computes
qi=Δi⋅ui⊕tΔii=t0i⊕Δi⋅x∈F2ℓ′ for i∈[λ]
-
Let qj be the j-th row of the ℓ′×λ matrix
Q=[q1∣q2∣⋯∣qλ], and similarly
let tj be the j-th row of
T=[t01∣t02∣⋯∣t0λ]. Note
that
qj=tj⊕(xj⋆Δ)=tj⊕(x[j]⋅Δ) for j∈[ℓ′]
-
Correlation Check
-
The sender and receiver run a
πRAND(F2λℓ′) protocol to obtain random
elements χ1,...,χℓ′.
πRAND(F2λℓ′) will be described later.
-
The receiver computes
x=∑j=1ℓ′x[j]⋅χj and t=∑j=1ℓ′tj⋅χj
and sends them to the sender.
-
The sender computes q=∑j=1ℓ′qj⋅χj and
checks t=q⊕x⋅Δ. If the check fails, abort.
-
Output
-
The sender computes
vj=H(j,qj)⊕H(j,qj⊕Δ)⊕Δ for j∈[ℓ]
and sends them to the receiver. H is a tweakable hash function as used
in garbled circuit.
-
The sender outputs
(H(j,qj), H(j,qj)⊕Δ)
-
For j∈[ℓ], the receiver outputs the following:
If xj=0, outputs H(j,tj); If xj=1, outputs H(j,tj)⊕vj
This ends the description of the KOS15 protocol. We note that a very
recent work pointed out that there is a
flaw in the security proof of the main lemma of KOS15 and provided a fix, which
is less efficient. They also pointed out that this the original KOS15 protocol
is still secure in practice. Therefore, we choose the original KOS15 protocol in
zkOracles in this version.
We begin to describe the πRAND(F2λℓ) protocol as
follows.
-
The sender and receiver locally choose uniformly 128-bit random seeds s0
and s1, respectively.
-
The sender and receiver compute commitments of the seeds by choosing 128-bit
random strings r0,r1 and generate c0=SHA256(s0∥r0) and
c1=SHA256(s1∥r1), respectively.
-
The sender sends c0 to the receiver, and the receiver sends c1 to the
sender.
-
On receiving the commitments, the sender and receiver open the commitments by
sending (s0,r0) and (s1,r1) to each other, respectively.
-
The sender checks c1 by re-computing it with s1,r1, and the receiver
checks c0 by re-computing it with s0,r0. If checks fail, abort.
-
The sender and receiver locally compute s=s0⊕s1 and generate
random elements with a PRG as χ1,...,χℓ←PRG(s)