Asymptotic computational semi-honest security of protocol families #
semiHonestAdvantage measures one run of one protocol on one input tuple. This module gives the
asymptotic notion: a ProtocolFamily has a protocol for each security parameter n and public
parameters d, and ProtocolFamily.SemiHonestSecure P setup I E says that, with d drawn from
the setup law setup n, some PPT simulator family for the coalition I makes the real and ideal
runs indistinguishable for every PPT environment.
An environment (Environment) has two stages. Given n and d, it chooses all parties' inputs
and keeps a state (InputChoice); after the run, it sees the views of the parties in I and the
outputs of all parties, and returns a bit. In ProtocolFamily.realGame the views come from a run
of the protocol; in ProtocolFamily.idealGame the outputs come from the functionality and a
simulator computes the views from the inputs and outputs of the parties in I.
Efficiency is stated on encodings. A ProtocolFamily.Encoding writes the public parameters as a
word and, for each party, its inputs, outputs and views as values of a fixed type with a fixed
encoding (PartyEncoding), so that a protocol can represent group elements or other
parameter-dependent values as records of words. An environment is PPT (Environment.IsPPT) when
one uniform strict PPT machine computes each stage: the first reads (1ⁿ, d) and writes the
inputs and the state, the second reads encGuessInput. A simulator family is PPT
(SimulatorFamily.IsPPT) when one uniform strict PPT machine reads encSimInput, which holds
1ⁿ, d and the coalition's inputs and outputs, and writes the simulated views.
ProtocolFamily.SemiHonestSecure.of_perfect is the first property: a protocol family that is
perfectly private at every n and d (the ideal and real joint distributions are equal) with a
PPT simulator family is secure. ProtocolFamily.realGame_eq_idealGame is its game form, and
ProtocolFamily.advantage_idealGame_le bounds the effect of replacing one simulator family by a
statistically close one, as a protocol does when its exact simulator samples values that a
bounded-time machine can only approximate.
Comparison with the sources #
[Lin17], Section 4.2, Definition 4.1 (p. 7) defines security of a two-party protocol against
static semi-honest adversaries: there are PPT simulators S₁, S₂ such that S_i(1ⁿ, x_i, f_i(x))
paired with the functionality's output f(x) is computationally indistinguishable from party
i's view paired with both parties' outputs. [Gol04], Definition 7.5.1 (general case,
Eq. 7.40) is the m-party form, with a coalition I in place of one party.
SemiHonestSecure P setup I E is the corresponding requirement for the coalition I; for two
parties, Definition 4.1 corresponds to ∀ i, SemiHonestSecure P setup {i} E, with these
differences:
- Uniform environments that choose the inputs. In the sources the ensembles are indexed by the
inputs and the security parameter, and indistinguishability is against non-uniform
polynomial-time distinguishers with one negligible function for all inputs ([Lin17],
Section 2, p. 3; Lindell's p. 9 notes that auxiliary input enters through this
non-uniformity). Here the environment is a uniform strict PPT machine that chooses the inputs,
after seeing
d, and the negligible function may depend on the environment. A non-uniform distinguisher can hard-wire the worst inputs for eachn; a uniform environment must find them, so the notion here is the uniform variant and is weaker. - Public setup. The public parameters are drawn from an arbitrary setup law and given to the environment and the simulator. The sources have no setup; a deterministic setup law corresponds to them. The setup law need not be efficiently samplable.
- One coalition at a time.
SemiHonestSecure P setup I Eis for one static coalitionI, with its own simulator family. Definition 7.5.1 has one simulator that receivesI; for a fixed number of parties the two forms are equivalent. - Typed inputs and the stand-alone model. Inputs, outputs and views are typed values written
as words by
E, not strings of equal length; review checks that a protocol's encoding is the natural one. The run is stand-alone: one execution, without other protocols running beside it. - Strict PPT in the input length. Environments and simulators are uniform strict PPT machines
(
IsPPTOn): every run halts within a polynomial in the length of the machine's whole encoded input, which includes1ⁿand, for a simulator, the coalition's inputs and outputs, as in [Gol04]. [Lin17] (p. 3) bounds a party's running time in the security parameter alone. The inputs here are chosen by a PPT environment that reads1ⁿand the public parametersd, so their length is polynomial in the length of that whole encoded input,encPair encUnary E.desc. It is polynomial innonly when the wordsE.desc dare, which neitherProtocolFamilynorSemiHonestSecurerequires: a setup law may supply a2 ^ n-bit public word that the environment copies into an input. - The notion constrains only the simulator and the environment. The efficiency and correctness of the honest parties' algorithms, which the sources assume, are separate properties of a protocol family.
Main definitions #
Cslib.Crypto.Protocols.MPC.ProtocolFamily: protocols indexed by a security parameter and public parameters.Cslib.Crypto.Protocols.MPC.InputChoice,Cslib.Crypto.Protocols.MPC.Environment: two-stage environments.Cslib.Crypto.Protocols.MPC.SimulatorFamily: simulator families for a coalition.Cslib.Crypto.Protocols.MPC.ProtocolFamily.realGame,Cslib.Crypto.Protocols.MPC.ProtocolFamily.idealGame: the real and ideal games.Cslib.Crypto.Protocols.MPC.PartyEncoding,Cslib.Crypto.Protocols.MPC.ProtocolFamily.Encoding,Cslib.Crypto.Protocols.MPC.GuessInput,Cslib.Crypto.Protocols.MPC.encGuessInput,Cslib.Crypto.Protocols.MPC.SimInput,Cslib.Crypto.Protocols.MPC.encSimInput: what machines read and write.Cslib.Crypto.Protocols.MPC.Environment.IsPPT,Cslib.Crypto.Protocols.MPC.SimulatorFamily.IsPPT: PPT environments and simulator families.Cslib.Crypto.Protocols.MPC.ProtocolFamily.SemiHonestSecure: asymptotic computational semi-honest security against a static coalition.
Main results #
Cslib.Crypto.Protocols.MPC.ProtocolFamily.SemiHonestSecure.of_perfect: perfect privacy with a PPT simulator family gives security.Cslib.Crypto.Protocols.MPC.ProtocolFamily.advantage_idealGame_le: statistically close simulator families give close ideal games.Cslib.Crypto.Protocols.MPC.PartyEncoding.encCoalition_singleton: the word of a single party's values, as two-party certificates use it.Cslib.Crypto.Protocols.MPC.PartyEncoding.encCoalition_apply_polyTime: reading one member's value from the word of a coalition's values, as simulator certificates use it.
CslibFrontier/Crypto/Protocols/MPC/DDHOT/Simulators.lean proves the notion across all static
coalitions for DDH oblivious transfer with raw fair-coin bit-string party views from the DDH
assumption (Cslib.Crypto.PrimeOrderGroupFamily.DDH.ddhOTProbFamily_semiHonestSecure, a
stand-alone step toward [BS23], Theorem 23.7).
The test module CslibFrontierTests.Crypto.MPCAsymptotic refutes it for a protocol that leaks a
party's input bit, with a PPT environment, and proves it without assumptions for the protocol that
delivers the bit as the functionality's output, through SemiHonestSecure.of_perfect.
References #
- Y. Lindell, How To Simulate It – A Tutorial on the Simulation Proof Technique, ECCC TR17-112, Section 2 (p. 3) and Section 4.2 (Definition 4.1, p. 7; auxiliary information, p. 9).
- O. Goldreich, Foundations of Cryptography, Volume 2: Basic Applications, Section 7.5.1.2 (Definition 7.5.1).
Protocol families, environments and simulators #
A family of m-party protocols: for each security parameter n and public parameters d, a
protocol protocol n d in the oracle world world n d for the functionality functionality n d.
The law of the public parameters is a separate argument of the games, as for F.DDH setup.
- Desc : Type
The type of public parameters.
The oracle specification of the hybrid model;
noOracleSpecin the plain model.The schedule of rounds.
The parties' input types.
The parties' coin types.
The parties' output types.
- protocol (n : ℕ) (d : self.Desc) : Protocol m (self.spec n d) (self.sc n d) (self.In n d) (self.Coins n d) (self.Out n d)
The protocol.
The oracle world in which the protocol runs;
noOracleWorldin the plain model.The functionality that the protocol computes.
The inputs that an environment chooses for one run of P at n and d, and the state it
keeps for its guess.
The inputs of all parties.
The state passed to the guessing stage.
A two-stage environment against P when the parties in I are corrupted. Given the security
parameter n and public parameters d, choose picks all parties' inputs and a state; guess
sees the state, the views of the parties in I and the outputs of all parties, and returns a
bit.
A simulator family for the coalition I of P: for each n and d, a simulator that
produces the views of the parties in I from their inputs and outputs. Nothing here asks it to be
efficient; SimulatorFamily.IsPPT does.
The real game: draw public parameters d from the setup law, let Z choose the inputs, run
the protocol, and give Z the views of the parties in I and all outputs.
The ideal game: draw public parameters d from the setup law, let Z choose the inputs,
compute the outputs with the functionality, let S n d produce the views of the parties in I
from their inputs and outputs, and give Z these views and all outputs.
Encodings and efficiency #
How machines read and write the values X n d i of each party i: as values of a fixed type
Rep i with the fixed encoding enc i, through an injective map rep n d i at each security
parameter and public parameters. A fixed type lets certificates use the polynomial-time calculus
on representations, such as records of words for group elements.
The representation type of party
i's values.The encoding of party
i's representations.The representation of party
i's values atnandd.
The word of the values of all parties at n and d: the table (encDPi) of their
representations.
The word of the values of the parties in I at n and d: the table (encDPi) of their
representations.
The word of the values of a single party i: the one-entry table of its representation.
Reading one member's value. From the word of a coalition's values, computed in polynomial
time, the representation of member i's value is computed in polynomial time. A certificate
applies it to encSimInput_inputs_polyTime or encSimInput_outputs_polyTime to read a
coalition member's input or output from a simulator's input.
How machines read and write the public parameters, inputs, outputs and views of a protocol
family. The encoding is part of what ProtocolFamily.SemiHonestSecure claims: it fixes the input
lengths that bound the running time of environments and simulators.
The input of an environment's guessing stage against P with the parties in I corrupted, as
a record: the security parameter, the public parameters, the saved state, the views of the parties
in I and the outputs of all parties.
- secParam : ℕ
The security parameter, given to machines in unary.
- desc : P.Desc
The public parameters.
The state saved by the choosing stage.
- views (i : ↥I) : PartyView (P.In self.secParam self.desc) (P.Coins self.secParam self.desc) (P.sc self.secParam self.desc) ↑i
The views of the parties in
I. The outputs of all parties.
The input of a simulator for the coalition I of P, as a record: the security parameter,
the public parameters, and the inputs and outputs of the parties in I.
The encoding of a guessing-stage input: the unary security parameter, the public parameters
E.desc d, the state, the word of the views of the parties in I (PartyEncoding.encCoalition)
and the word of all outputs (PartyEncoding.encAll), each framed except the last.
The encoding of a simulator's input: the unary security parameter, the public parameters
E.desc d, and the words of the inputs and of the outputs of the parties in I
(PartyEncoding.encCoalition), each framed except the last.
An environment is PPT for the encoding E when its choosing stage is computed by a uniform
strict PPT machine that reads the unary security parameter and the public parameters and writes
the table of the representations of the chosen inputs and the state, and its guessing stage by
one that reads encGuessInput E and writes the output bit.
- choose : Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary E.desc) (Turing.MultiTapeTM.encPair (Turing.MultiTapeTM.encDPi E.input.enc) Turing.MultiTapeTM.encBits) fun (x : ℕ × P.Desc) => match x with | (n, d) => (fun (c : InputChoice P n d) => (fun (i : Fin m) => (E.input.rep n d i) (c.inputs i), c.state)) <$> Z.choose n d
The choosing stage is uniform strict PPT.
- guess : Probability.IsPPTOn (encGuessInput E) Turing.MultiTapeTM.encBool fun (y : GuessInput P I) => Z.guess y.secParam y.desc y.state (y.views, y.outputs)
The guessing stage is uniform strict PPT.
A simulator family is PPT for the encoding E when one uniform strict PPT machine reads
encSimInput E and writes the table of the representations of the simulated views.
Asymptotic semi-honest security of the protocol family P with public parameters drawn
from setup, against the static coalition I, for the encoding E ([Lin17],
Definition 4.1, for each corrupted party; [Gol04], Definition 7.5.1, for a coalition):
some simulator family S, PPT for E, makes the real game and the ideal game with S
indistinguishable for every PPT environment. The environments are uniform and choose the inputs,
and the public parameters come from a setup law; the module documentation lists these and the
other differences from the sources.
Perfect privacy makes the games equal: if at every n and d the ideal joint distribution
with S n d equals the real one, the real game and the ideal game with S are equal for every
environment.
Replacing a simulator family by a close one. If at the security parameter n the
simulators S n d and S' n d are within ε on every input against every test, the ideal games
with S and with S' are within ε for every environment.
Perfect privacy with PPT simulators gives security. If at every n and d the ideal joint
distribution with S n d equals the real one, and S is PPT for E, then P is semi-honest
secure against I for E.