Three-Message DDH 1-out-of-2 Oblivious Transfer #
This module formalizes a three-message 1-out-of-2 oblivious transfer protocol from the Decision
Diffie-Hellman (DDH) assumption over a finite additive group G that is a ZMod q-module, with a
public element g, expressed as a two-party protocol ddhOTProtocol in
Cslib.Crypto.Protocols.MPC computing otFunctionality G (compatible with batchOTSpec 1 G from
CslibFrontier/Crypto/Protocols/MPC/BatchOT.lean). Groups are written additively, so the textbook
g^a is a • g. The protocol is a variant of the DDH-based protocol of [BS23],
Section 23.5.7, Figure 23.17; DDH-based oblivious transfer of this kind goes back to
[NP01]. Its rounds are:
- Round 1 (
.message 0 1 G): The sender (party0) samplesa : ZMod qand sendsu = a • gto the receiver (party1). - Round 2 (
.message 1 0 (G × G)): The receiver samplesb : ZMod q, setsv = b • g, and sends(w₀, w₁) = if σ then (u - v, v) else (v, u - v)so that the chosen branch keyw_σ = vhas known discrete logarithmb, the unchosen branch keyw_{1-σ} = u - vhas unknown discrete logarithm, andw₀ + w₁ = u. - Round 3 (
.message 0 1 ((G × G) × (G × G))): The sender checksw₀ + w₁ = u. If the check holds, it encrypts each branchi ∈ {0, 1}with fresh randomization coins(rᵢ, sᵢ) : ZMod q × ZMod qviaddhOTEncryptBranch g u wᵢ mᵢ rᵢ sᵢ a(since the sender holdsawithu = a • g, this equals ElGamal encryption underwᵢwith exponentrᵢ + a * sᵢ; if the check fails, the sender sends zeros). The receiver decrypts its chosen ciphertext(e_σ, c_σ)asc_σ - b • e_σ.
Differences from Figure 23.17 #
- In Figure 23.17 the sender samples its first message
duniformly from the group, without knowing its discrete logarithm. Here the sender samplesaand sendsu = a • g, so it knows the discrete logarithm ofu. - Figure 23.17 encrypts both branches with one exponent
βand one first componentg^β. Here each branchihas its own coins(rᵢ, sᵢ)and its own first componentrᵢ • g + sᵢ • u. - Figure 23.17 has no check. Here the sender checks
w₀ + w₁ = u, the additive form of the check in [BS23], Section 23.5.7.3, Remark 23.6, and sends zeros instead of aborting when the check fails.ddhOTUncheckedProtocolomits the check. - The honest parties of
ddhOTProtocoldraw exact uniform exponents inZMod q(sampleDDHOTSenderCoinsand the receiver'sProbComp.uniform (ZMod q)), and their views hold these exponents. The source requires the parties' only random objects to be random bit strings, from which they derive values statistically indistinguishable from uniform ([BS23], Section 23.5.7.2, "Further assumptions about randomness", p. 1059). No bounded-time fair-coin machine draws an exact uniform element ofZMod qwhenqis not a power of two;ddhOTProtocolWithparameterizes the protocol by arbitrary party coin types, samplers, and exponent projections so thatPartyView.coinsretains the actual coin objects drawn by each party, andCslibFrontier/Crypto/Protocols/MPC/DDHOT/Family.leaninstantiates it with raw fair-coin bit strings viasampleExpBits(ddhOTProbProtocol,ddhOTProbFamily). - Theorem 23.7 of [BS23] is stated for Figure 23.17 in the restricted interactive
execution framework of Section 23.5.6. The results below are proved directly for this variant in
the stand-alone
Protocolmodel.
Main definitions #
Cslib.Crypto.Protocols.MPC.DDHOTSenderCoins,Cslib.Crypto.Protocols.MPC.sampleDDHOTSenderCoins: the sender's fiveZMod qcoins and their uniform sampler.Cslib.Crypto.Protocols.MPC.ddhOTSchedule: the three-message point-to-point schedule.Cslib.Crypto.Protocols.MPC.ddhOTProtocolWith,Cslib.Crypto.Protocols.MPC.ddhOTProtocol: the checked three-message DDH OT protocol, parameterized by party coin samplers and exponent projections and specialized to exact uniform coins.Cslib.Crypto.Protocols.MPC.ddhOTViewsWith,Cslib.Crypto.Protocols.MPC.ddhOTViews: the pair of party views produced by a run ofddhOTProtocolWithon given inputs and coins.Cslib.Crypto.Protocols.MPC.ddhOTUncheckedProtocol: the variant omitting thew₀ + w₁ = ucheck.Cslib.Crypto.Protocols.MPC.ddhOTSenderReplyOf: the honest sender's Round 3 reply in a protocol alongddhOTSchedule G, for an arbitrary Round 2 message.Cslib.Crypto.Protocols.MPC.ddhOTSenderSim,Cslib.Crypto.Protocols.MPC.ddhOTReceiverSim: the semi-honest simulators for a corrupted sender ({0}) and a corrupted receiver ({1}), which draw uniform coins and returnCslib.Crypto.Protocols.MPC.ddhOTSenderSimWithCoinsandCslib.Crypto.Protocols.MPC.ddhOTReceiverSimWithCoins.Cslib.Crypto.Protocols.MPC.ddhOTReductionWithCoins,Cslib.Crypto.Protocols.MPC.ddhOTReduction: the DDH reduction induced by a receiver distinguisher, on given coins and on uniform coins.Cslib.Crypto.Protocols.MPC.ddhOTUncheckedRealGame,Cslib.Crypto.Protocols.MPC.ddhOTUncheckedIdealGame: the real and ideal games for a malicious receiver againstddhOTUncheckedProtocol.
Main results #
Cslib.Crypto.Protocols.MPC.evalWith_ddhOTProtocolWith,Cslib.Crypto.Protocols.MPC.ddhOTProtocolWith_output_of_mem_support: execution law and correctness — for any party coin samplers and exponent projections, every execution ofddhOTProtocolWithproducesddhOTViewsWithand outputsm_σfor the receiver and()for the sender.Cslib.Crypto.Protocols.MPC.idealJoint_ddhOT_sender_with,Cslib.Crypto.Protocols.MPC.idealJoint_ddhOT_sender,Cslib.Crypto.Protocols.MPC.semiHonestAdvantage_ddhOT_sender: perfect sender privacy — when the honest receiver's exponent is uniform, the ideal joint distribution equals the real one for any sender coin sampler, so inddhOTProtocolevery distinguisher has advantage zero.Cslib.Crypto.Protocols.MPC.real_receiver_eq_ddhRealExperiment_of,Cslib.Crypto.Protocols.MPC.ideal_receiver_eq_ddhRandomExperiment_of,Cslib.Crypto.Protocols.MPC.semiHonestAdvantage_ddhOT_receiver_eq: receiver privacy as a per-instance equality — whenggeneratesG, a corrupted receiver's distinguishing advantage equalsCslib.Crypto.ddhAdvantage q g (ddhOTReduction g q x D), the fixed-group DDH advantage ofCslibFrontier/Crypto/Computational/DiffieHellman/Finite.lean. There is no security parameter and no efficiency certificate forddhOTReduction, so this is not a computational privacy theorem.CslibFrontier/Crypto/Protocols/MPC/DDHOT/Family.leanruns the fair-coin protocol over aPrimeOrderGroupFamilywith raw bit-string party coins (ddhOTProbProtocol,ddhOTProbFamily) and reduces a corrupted receiver to the DDH assumption with a certified reduction (Cslib.Crypto.PrimeOrderGroupFamily.advantage_ddhOTReceiverGame_le,Cslib.Crypto.PrimeOrderGroupFamily.isPPT_ddhOTReceiverToDDHDistinguisher).CslibFrontier/Crypto/Protocols/MPC/DDHOT/Simulators.leangives PPT simulators and proves stand-alone asymptotic semi-honest security ofddhOTProbFamilyacross all static coalitions as a step toward Theorem 23.7 (Cslib.Crypto.PrimeOrderGroupFamily.DDH.ddhOTProbFamily_semiHonestSecure).Cslib.Crypto.Protocols.MPC.ddhOTSenderReply_eq_unchecked_of_add,Cslib.Crypto.Protocols.MPC.ddhOTSenderReply_eq_zero_of_add_ne,Cslib.Crypto.Protocols.MPC.ddhOTAttackBothMessages_eq,Cslib.Crypto.Protocols.MPC.succProbability_ddhOTUncheckedIdealGame_le,Cslib.Crypto.Protocols.MPC.ddhOTUnchecked_malicious_receiver_advantage: malicious-receiver attack on the unchecked variant — a malicious receiver that sends(b₀ • g, b₁ • g)in Round 2 ofddhOTUncheckedProtocolrecovers both(m₀, m₁)from one run. A simulator that chooses one query bitτand receives onlym_τoutputs both messages with probability at most(Fintype.card G : ℝ)⁻¹, so the advantage against every such simulator is at least1 - (Fintype.card G : ℝ)⁻¹.
References #
- M. Naor and B. Pinkas, Efficient Oblivious Transfer Protocols
- D. Boneh and V. Shoup, A Graduate Course in Applied Cryptography, Section 23.5.7 (Figure 23.17, Theorem 23.7, the randomness assumptions on p. 1059, and Remark 23.6).
1-out-of-2 Oblivious Transfer functionality and protocol syntax #
Deterministic output tuple of otFunctionality M: () for the sender and m_σ for the
receiver.
Ideal functionality for 1-out-of-2 Oblivious Transfer over M.
Convert a single-transfer input tuple x : (i : Fin 2) → OTIn M i into a query to
batchOTSpec 1 M from CslibFrontier/Crypto/Protocols/MPC/BatchOT.lean.
otOutputs agrees with the single-transfer specialization k = 1 of batchOTAnswer.
The sender's random coins in the DDH OT protocol over ZMod q: the Round 1 exponent a and
two encryption coins (rᵢ, sᵢ) for each branch i ∈ {0, 1}.
Per-party random coin types parameterized by sender coin type C₀ and receiver coin type
C₁.
Per-party random coin types for ddhOTProtocol.
Sample the sender's five exponents uniformly from ZMod q.
Three-message point-to-point schedule for the DDH OT protocol: sender to receiver (G),
receiver to sender (G × G), and sender to receiver ((G × G) × (G × G)).
Honest Round 2 receiver messages always satisfy the sender's check w.1 + w.2 = u.
Encrypt a single branch message m : G under (g, u, w) using coins (r, s) and sender
exponent a. When u = a • g, this equals ElGamal encryption
((r + a * s) • g, (r + a * s) • w + m) under key w.
Decrypting an honestly encrypted branch with w = b • g and u = a • g recovers m.
Round 3 sender reply in the unchecked variant: omits the w.1 + w.2 = u verification.
Final local state type at the end of ddhOTSchedule G, parameterized by coin types C₀, C₁.
Output extraction at the end of ddhOTSchedule G under receiver coin projection proj₁.
Unchecked three-message DDH OT protocol: ddhOTProtocol without the sender's
w₀ + w₁ = u check. [BS23], Section 23.5.7.3, Remark 23.6 describes the
malicious-receiver attack that the check is meant to stop; ddhOTUncheckedRealGame runs that
attack against this protocol.
The honest sender's Round 3 reply in a protocol proto along ddhOTSchedule G, on input m
and coins c, when the receiver's Round 2 message is w. The sender's local state is built as in
Steps.run; a malicious receiver may choose w freely.
The Round 3 reply of ddhOTUncheckedProtocol is ddhOTSenderReplyUnchecked.
Malicious Round 2 message (b₀ • g, b₁ • g) with known discrete logs (b₀, b₁).
Simultaneous recovery on the unchecked variant: when the sender omits w₀ + w₁ = u,
a malicious receiver sending ddhOTAttackMsg g b₀ b₁ recovers both (m.1, m.2) from
ddhOTSenderReplyUnchecked.
Round 3 sender reply in the checked protocol: verifies w.1 + w.2 = c.exponent • g before
encrypting (m.1, m.2).
When the receiver's Round 2 message satisfies w.1 + w.2 = c.exponent • g, the checked sender
reply ddhOTSenderReply coincides with ddhOTSenderReplyUnchecked.
When the receiver's Round 2 message violates w.1 + w.2 = c.exponent • g, the checked sender
reply ddhOTSenderReply aborts to ((0, 0), (0, 0)).
Three-message DDH 1-out-of-2 Oblivious Transfer protocol with given coin samplers and
projections: a variant of [BS23], Section 23.5.7, Figure 23.17, with the check
w₀ + w₁ = u from Remark 23.6. Party 0 samples raw₀ ← sample₀ (retained unreduced in
PartyView.coins) and derives proj₀ raw₀ : DDHOTSenderCoins q; party 1 samples
raw₁ ← sample₁ (retained unreduced in PartyView.coins) and derives b := proj₁ raw₁. Unlike in
Figure 23.17, the sender knows the discrete logarithm a of its first message u = a • g and
encrypts each branch with its own coins (rᵢ, sᵢ); the module docstring lists the differences.
Three-message DDH 1-out-of-2 Oblivious Transfer protocol with exact uniform coins:
ddhOTProtocolWith specialized to sampleDDHOTSenderCoins q, ProbComp.uniform (ZMod q), and
identity projections.
Party views and execution characterization #
The sender's PartyView from its input x₀, coin object raw₀, and received Round 2 message
w.
The sender's PartyView for ZMod q coins.
The pair of party views produced by ddhOTProtocolWith on inputs x, sender coins raw₀, and
receiver coin raw₁. Because ddhOTReceiverMsg always satisfies the sender's check w₀ + w₁ = u,
the sender's reply equals ddhOTSenderReplyUnchecked.
The pair of party views for ZMod q coins.
Execution law and correctness #
Execution law of ddhOTProtocolWith: for any party coin samplers sample₀, sample₁ and
projections proj₀, proj₁, evalWith draws raw₀ ← sample₀ and raw₁ ← sample₁ and returns
(ddhOTViewsWith g proj₀ proj₁ x raw₀ raw₁, otOutputs x).
Correctness: for any party coin samplers and exponent projections, in every execution of
ddhOTProtocolWith, the sender outputs () and the receiver outputs
if x 1 then (x 0).2 else (x 0).1.
Perfect privacy against a corrupted sender #
The simulated view of a corrupted sender ({0}) on sender coin object raw₀ (projected via
proj₀) and receiver exponent b : ZMod q: the sender's input and unreduced coin raw₀, and the
Round 2 message (b • g, (proj₀ raw₀).exponent • g - b • g).
The simulated view of a corrupted sender ({0}) for ZMod q coins.
Simulator for a corrupted sender ({0}): samples fresh sender coins c₀ and a uniform
b : ZMod q, and returns ddhOTSenderSimWithCoins, whose Round 2 message is
(b • g, c₀.exponent • g - b • g).
Perfect sender simulation under any sender coin sampler when the honest receiver's
exponent is uniform on ZMod q: for every sample₀ and proj₀, drawing raw₀ ← sample₀ and
b ← uniform (ZMod q) gives ddhOTSenderSimWithCoinsOf the exact same distribution as the
corrupted sender's real view paired with otOutputs x.
Real joint distribution for a corrupted sender ({0}).
Perfect privacy against a corrupted sender: the ideal joint distribution with
ddhOTSenderSim equals the real joint distribution.
A corrupted sender has advantage zero against every distinguisher.
Computational privacy against a corrupted receiver under DDH #
The DDH reduction for receiver privacy on a fixed receiver coin object raw₁ (projected via
proj₁) and chosen-branch coins (r, s): embeds (u, u', w_ddh) into the unchosen branch,
encrypts the chosen branch with b := proj₁ raw₁, records raw₁ unreduced in the receiver's
PartyView.coins, and runs D.
The DDH reduction for receiver privacy on fixed ZMod q coins.
DDH reduction for receiver privacy under receiver coin sampler sample₁ and projection
proj₁: draws raw₁ ← sample₁ and uniform r, s : ZMod q, then runs
ddhOTReductionWithCoinsOf.
DDH reduction for receiver privacy with uniform ZMod q coins.
For any receiver coin sampler sample₁ and projection proj₁, when the honest sender's five
exponents are drawn uniformly via sampleDDHOTSenderCoins q, the corrupted receiver's real view
distribution equals ddhRealExperiment q g run on ddhOTReductionOf.
The real execution for a corrupted receiver is the real DDH world
Cslib.Crypto.ddhRealExperiment q g run on ddhOTReduction.
The simulated view of a corrupted receiver ({1}) on receiver coin object raw₁ (projected
via proj₁) and exponents a, r, s, k, c: given choice bit σ and ideal output m_σ, records
raw₁ unreduced in PartyView.coins, sets u = a • g, encrypts the chosen branch as
(e_σ, (proj₁ raw₁) • e_σ + m_σ) with e_σ = r • g + s • u, and sets the unchosen branch to
(k • g, c • g).
The simulated view of a corrupted receiver ({1}) for ZMod q coins.
Simulator for a corrupted receiver ({1}) under receiver coin sampler sample₁ and
projection proj₁: draws raw₁ ← sample₁ and uniform a, r, s, k, c : ZMod q, and returns
ddhOTReceiverSimWithCoinsOf.
Simulator for a corrupted receiver ({1}) with uniform ZMod q coins.
For any receiver coin sampler sample₁ and projection proj₁, when g generates G, the
ideal execution for a corrupted receiver with ddhOTReceiverSimOf equals ddhRandomExperiment q g
run on ddhOTReductionOf.
When g generates G, the ideal execution for a corrupted receiver is the random DDH world
Cslib.Crypto.ddhRandomExperiment q g run on ddhOTReduction.
Privacy against a corrupted receiver, as a per-instance equality: for a fixed group, input
and distinguisher, the distinguisher's advantage between the ideal joint distribution with
ddhOTReceiverSim and the real one equals the fixed-group DDH advantage of ddhOTReduction, when
g generates G. This is not a computational privacy theorem: there is no security parameter,
and ddhOTReduction has no efficiency certificate.
Cslib.Crypto.PrimeOrderGroupFamily.advantage_ddhOTReceiverGame_le in
CslibFrontier/Crypto/Protocols/MPC/DDHOT/Family.lean is the family form, with a certified
reduction.
Malicious-receiver attack on the unchecked variant #
Real game for a malicious receiver against ddhOTUncheckedProtocol. The sender holds uniform
messages (m₀, m₁) ← G × G and coins drawn by the protocol's own sampler. The receiver sends
ddhOTAttackMsg g b₀ b₁ in Round 2, gets the sender's Round 3 reply
ddhOTSenderReplyOf (ddhOTUncheckedProtocol g q), and wins if it recovers both messages.
Ideal game for a malicious receiver against oblivious transfer. The simulator S first outputs
a query bit τ together with a guessing function, which may share the simulator's randomness. For
uniform messages (m₀, m₁) ← G × G the ideal functionality gives it if τ then m₁ else m₀, and
the simulator wins if its guess equals (m₀, m₁).
In ddhOTUncheckedRealGame, the malicious receiver recovers both messages with
probability 1.
In ddhOTUncheckedIdealGame, every simulator S outputs both messages with probability at
most (Fintype.card G : ℝ)⁻¹: the message it does not query is uniform and independent of its
view.
Malicious-receiver separation for ddhOTUncheckedProtocol: for every simulator S, the
distinguishing advantage between ddhOTUncheckedRealGame and ddhOTUncheckedIdealGame S is at
least 1 - (Fintype.card G : ℝ)⁻¹.