Documentation

CslibFrontier.Crypto.Protocols.MPC.IKNP.Family

IKNP oblivious-transfer extension as a protocol family #

CslibFrontier/Crypto/Protocols/MPC/IKNP.lean defines iknpProtocol H for one hash family H and proves its privacy at one instance. This module runs it as the protocol family iknpFamily hash m (Cslib.Crypto.Protocols.MPC.ProtocolFamily): at the security parameter n, n base transfers of (m n)-bit strings, the hybrid batchOTSpec n (BitString (m n)), extend to m n transfers of bits, with the hash CorrelationRobust.atLevel hash n (m n), which hashes the bits of a row with the word function hash. There are no public parameters. iknpEncoding writes inputs, outputs and views as bit words (IKNPSenderViewWords, IKNPReceiverViewWords).

CorrelationRobust.iknpSemiHonestSecure proves that the family is semi-honest secure against a corrupted sender and against a corrupted receiver (ProtocolFamily.SemiHonestSecure), assuming only that hash is correlation robust (Cslib.Crypto.CorrelationRobust) and that m is polynomially bounded.

Proof. Against the sender, the simulator iknpSenderSim is perfect (idealJoint_iknp_sender), and it is PPT (isPPT_iknpSenderSim): it draws n bits for the choice string and n words of m n bits for the columns. Against the receiver, the reduction iknpReceiverToCR Z turns an environment Z into a correlation-robustness distinguisher: it runs Z.choose, then the per-instance reduction iknpReduction. The real game is the real correlation-robustness game of the reduction at level n with m n queries, and the ideal game with iknpReceiverSim is its ideal game, with no loss (realGame_iknp_receiver_eq, idealGame_iknp_receiver_eq). isPPT_iknpReceiverToCR proves the reduction PPT whenever Z is, and isPPT_iknpReceiverSim proves the receiver's simulator PPT; both use the assumption's polyTime.

Comparison with [IKNP03] #

CorrelationRobust.iknpSemiHonestSecure formalizes the two Claims of §3.1 for Fig. 1 (p. 152), with the random oracle replaced by a correlation robust hash as §5 describes (p. 157):

Theorems 2 (p. 147) and 3 (p. 157) are not formalized. They concern oblivious transfer in the source's default sense, secure against malicious parties (p. 146): the fully secure variant of §4 (p. 154), modified for correlation robustness in Theorem 3, composed with the reduction of OT^k_m to OT^k_k with a pseudorandom generator (§2.2, p. 151, and Appendix B). The formalized statement differs from the two Claims as follows.

Main definitions #

Main results #

References #

Views as words #

The words of a corrupted sender's view in iknpProtocol with bit values: the first and the second entries of its pairs, its base choice string s, and the columns of the matrix it received from the base transfers.

  • pairs₀ : List Bool

    The bits x_{j,0}.

  • pairs₁ : List Bool

    The bits x_{j,1}.

  • choice : List Bool

    The base choice string s.

  • columns : List (List Bool)

    The columns qⁱ received from the base transfers.

theorem Cslib.Crypto.Protocols.MPC.encIKNPSenderViewWords_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} {x3 : γ → List (List Bool)} {T3 S3 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBits T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encBits T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) T3 S3) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { pairs₀ := x0 x, pairs₁ := x1 x, choice := x2 x, columns := x3 x }) encIn encIKNPSenderViewWords (fun (x : γ) => T0 x + (T1 x + (T2 x + T3 x))) fun (x : γ) => S0 x + (S1 x + (S2 x + S3 x))

The encoding of a sender's view words: each field in turn, all but the last framed.

theorem Cslib.Crypto.Protocols.MPC.encIKNPSenderViewWords_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 x2 : γ → List Bool} {x3 : γ → List (List Bool)} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encBits budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { pairs₀ := x0 x, pairs₁ := x1 x, choice := x2 x, columns := x3 x }) encIn encIKNPSenderViewWords budget

The words of a corrupted receiver's view in iknpProtocol with bit values: its choice bits r, the rows tⱼ of its matrix, and the first and the second entries of the masked pairs it received.

  • choices : List Bool

    The choice bits r.

  • rows : List (List Bool)

    The rows tⱼ of the receiver's matrix.

  • masked₀ : List Bool

    The masked bits y_{j,0}.

  • masked₁ : List Bool

    The masked bits y_{j,1}.

theorem Cslib.Crypto.Protocols.MPC.encIKNPReceiverViewWords_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List (List Bool)} {T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} {x3 : γ → List Bool} {T3 S3 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBits T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encBits T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encBits T3 S3) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { choices := x0 x, rows := x1 x, masked₀ := x2 x, masked₁ := x3 x }) encIn encIKNPReceiverViewWords (fun (x : γ) => T0 x + (T1 x + (T2 x + T3 x))) fun (x : γ) => S0 x + (S1 x + (S2 x + S3 x))
theorem Cslib.Crypto.Protocols.MPC.encIKNPReceiverViewWords_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → List Bool} {x1 : γ → List (List Bool)} {x2 x3 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encBits budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { choices := x0 x, rows := x1 x, masked₀ := x2 x, masked₁ := x3 x }) encIn encIKNPReceiverViewWords budget

The encoding of a receiver's view words: each field in turn, all but the last framed.

@[reducible, inline]

The view words of the two parties of iknpProtocol: IKNPSenderViewWords for the sender (party 0) and IKNPReceiverViewWords for the receiver (party 1).

The words of a sender's view: its pairs as two bit words, its choice string, and the received columns as bit words.

The words of a receiver's view: its choice bits, the rows of its matrix, and the masked pairs as two bit words.

The protocol family and its encoding #

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.Protocols.MPC.iknpFamily (hash : List Bool → Bool) (m : ℕ → ℕ) :

IKNP bit-transfer extension as a protocol family: at the security parameter n, iknpProtocol with the hash CorrelationRobust.atLevel hash n (m n) extends n base transfers of (m n)-bit strings (the batchOTSpec n (BitString (m n)) hybrid) to m n transfers of bits. There are no public parameters.

@[reducible, inline]

The words of a party's input: the sender's pairs as two bit words, the receiver's choice bits as one.

@[reducible, inline]

The words of a party's output: nothing for the sender, the received bits for the receiver.

noncomputable def Cslib.Crypto.Protocols.MPC.iknpEncoding (hash : List Bool → Bool) (m : ℕ → ℕ) :

The encoding of iknpFamily hash m for machines. There are no public parameters (encUnit). The sender's input X is the pair of bit words (x_{j,0})ⱼ and (x_{j,1})ⱼ (encPair encBits encBits), and the receiver's input is the word of its choice bits. The sender's output () is the empty word, and the receiver's output is the word of its bits. The views are their view words (iknpSenderViewWords, iknpReceiverViewWords), encoded by encIKNPSenderViewWords and encIKNPReceiverViewWords.

Efficiency of the simulator families #

theorem Cslib.Crypto.Protocols.MPC.isPPT_iknpSenderSim (hash : List Bool → Bool) (m : ℕ → ℕ) :
SimulatorFamily.IsPPT (iknpEncoding hash m) fun (n : ℕ) (x : (iknpFamily hash m).Desc) => iknpSenderSim n (m n) Bool

The simulator family iknpSenderSim for a corrupted sender is PPT for iknpEncoding: it draws n bits for s and n words of m n bits for the columns.

The simulator family iknpReceiverSim for a corrupted receiver is PPT for iknpEncoding when the hash is computed in polynomial time: it draws m n words of n bits for the rows and m n bits for the unchosen entries, and hashes the rows.

Corrupted receiver: the reduction to correlation robustness #

The correlation-robustness distinguisher built from an environment Z that corrupts the receiver: at level k, given the inputs t and the bits w, run Z.choose, then iknpReduction with Z.guess, which writes t as the receiver's matrix and masks the chosen entries with hash tⱼ and the unchosen ones with wⱼ.

The real game against a corrupted receiver is the real correlation-robustness game of the reduction.

theorem Cslib.Crypto.Protocols.MPC.idealGame_iknp_receiver_eq (hash : List Bool → Bool) (m : ℕ → ℕ) (Z : Environment (iknpFamily hash m) {1}) (n : ℕ) :
(iknpFamily hash m).idealGame (fun (x : ℕ) => PMF.pure ()) {1} (fun (n : ℕ) (x : (iknpFamily hash m).Desc) => iknpReceiverSim (CorrelationRobust.atLevel hash n (m n))) Z n = CorrelationRobust.idealGame (iknpReceiverToCR hash m Z n)

The ideal game against a corrupted receiver with iknpReceiverSim is the ideal correlation-robustness game of the reduction.

Corrupted receiver: efficiency of the reduction #

iknpReceiverToCR Z is uniform strict PPT whenever Z is and the hash is computed in polynomial time.

Semi-honest security of IKNP oblivious-transfer extension: if hash is correlation robust and the number m n of extended transfers is polynomially bounded, then iknpFamily hash m is semi-honest secure against a corrupted sender ({0}) and against a corrupted receiver ({1}), for the encoding iknpEncoding (ProtocolFamily.SemiHonestSecure). These are the two Claims of [IKNP03] §3.1 for Fig. 1, the sender's (p. 153) in its semi-honest case and the receiver's (p. 154), with the random oracle replaced by a correlation robust hash as §5 describes (p. 157): n ideal base transfers of (m n)-bit strings (the source's OT^k_m hybrid), and bit transfers with one hash at every position. Theorems 2 and 3 of the source, which concern the fully secure variant of §4 composed with the reduction of OT^k_m to OT^k_k, are not formalized. Environments are uniform and choose the inputs, and corruption is static and of one party (module documentation). The simulators are iknpSenderSim, perfect, and iknpReceiverSim, certified by isPPT_iknpSenderSim and isPPT_iknpReceiverSim; the reduction is certified by isPPT_iknpReceiverToCR.