Efficient garbling schemes #
The algorithms of a garbling scheme in the sense of Bellare, Hoang and Rogaway
[BHR12b] are meant to be efficient. Scheme.IsEfficient G encFn states this for
a scheme G whose function descriptions are encoded by encFn: the length readers f.n and
f.m, the number of coins, the deterministic core gb of the garbling algorithm, encoding,
evaluation, decoding and the semantics ev are computed in polynomial time, on the security
parameter in unary and the encoded arguments.
For circuit garbling, encConventionalCircuit encodes a conventional circuit by n and m in
unary followed by its gates, each the binary numbers of its two argument wires and its truth table
as four bits; encValidCircuit restricts it to valid circuits. encValidTopo encodes the
topology (n, m, q, A, B) revealed by phiTopo in the same layout without the truth tables, and
encPrvView and encObvView encode the views (F, X, d) of a privacy adversary and (F, X) of an
obliviousness or authenticity adversary.
The plaintext wire values and the semantics evalCirc of a valid circuit are computed in
polynomial time from its word (wires_polyTime, evalCirc_polyTime), by a fold over the gates
whose state grows by one bit per gate. This is the ev field of Scheme.IsEfficient for every
scheme whose semantics is evalCirc.
Main definitions #
Cslib.Crypto.Garbling.Scheme.encGarbled: the encoding of a garbled triple(F, e, d).Cslib.Crypto.Garbling.Scheme.IsEfficient: polynomial-time algorithms.Cslib.Crypto.Garbling.ConventionalCircuit.gateList,Cslib.Crypto.Garbling.encConventionalCircuit,Cslib.Crypto.Garbling.encValidCircuit: conventional circuits as data.Cslib.Crypto.Garbling.Topo.gateList,Cslib.Crypto.Garbling.encTopo,Cslib.Crypto.Garbling.encValidTopo: topologies, the side information ofphiTopo, as data.Cslib.Crypto.Garbling.encPrvView,Cslib.Crypto.Garbling.encObvView,Cslib.Crypto.Garbling.encQuery: the encodings of a privacy view(F, X, d), of an obliviousness or authenticity view(F, X)and of a query(f, x).
Main results #
Cslib.Crypto.Garbling.evalCirc_polyTime: the semantics of valid circuits is computed in polynomial time.Cslib.Crypto.Garbling.phiTopo_polyTime: so is the side informationΦ_topo.
References #
The encoding of a garbled triple (F, e, d): F and e framed, then d
(encGarbled_apply).
A garbling scheme is efficient for the encoding encFn of its function descriptions when
its algorithms run in polynomial time: the length readers f.n and f.m on the encoded function,
the number of coins and the deterministic core gb of Gb on the parameter in unary and the
encoded function (and coins), and En, Ev, De and ev on their encoded arguments.
[BHR12b], §3.1, fixes linear-time algorithms for f.n and f.m; here they are
only required to run in polynomial time.
The input length
f.nis read fromfin polynomial time, in unary.The output length
f.mis read fromfin polynomial time, in unary.- coins : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × Fn) => match x with | (k, f) => G.coins k f) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary encFn) Turing.MultiTapeTM.encUnary
The number of coins is polynomial-time computable in unary.
- gb : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × Fn × List Bool) => match x with | (k, f, coins) => G.gb k f coins) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair encFn Turing.MultiTapeTM.encBits)) encGarbled
The deterministic core of garbling is polynomial-time on
(1^k, f, r). - encode : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : List Bool × List Bool) => match x with | (e, x) => G.encode e x) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits
Encoding is polynomial-time on
(e, x). - evalGarbled : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : List Bool × List Bool) => match x with | (F, X) => G.evalGarbled F X) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits
Evaluation is polynomial-time on
(F, X). - decode : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : List Bool × List Bool) => match x with | (d, Y) => G.decode d Y) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) (Turing.MultiTapeTM.encOption Turing.MultiTapeTM.encBits)
Decoding is polynomial-time on
(d, Y). - ev : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : Fn × List Bool) => match x with | (f, x) => G.ev f x) (Turing.MultiTapeTM.encPair encFn Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits
The semantics is polynomial-time on
(f, x).
The gates of a conventional circuit as data: for each gate its argument wires A g and B g
and its truth table as the four bits G g 0 0, G g 0 1, G g 1 0, G g 1 1.
Conventional circuits as words: n and m in unary, then the gates in order, each the
binary numbers of its argument wires A g and B g and its truth table as four bits
(encCircuitData of (n, m, gateList f)).
Valid conventional circuits as words, by encConventionalCircuit.
Specification of encValidCircuit in terms of encCircuitData.
A valid circuit's word has at least n + q bits: n in unary and at least one bit per
gate.
The data of a valid circuit is read from its word in polynomial time.
Evaluating conventional circuits #
The truth table of a gate read from its four bits, listed as in
ConventionalCircuit.gateList.
The plaintext wire values f.wires x f.q of a valid circuit on an input, the n input
bits followed by the q gate values, are computed in polynomial time.
The semantics evalCirc of a valid circuit on an input, the semantics ev of the
garbling schemes over conventional circuits, is computed in polynomial time.
Topologies as words: n and m in unary, then the gates in order, each the binary numbers
of its argument wires A g and B g (encTopoData of (n, m, gateList t)). This is the layout
of encConventionalCircuit without the truth tables.
Specification of encValidTopo in terms of encTopoData.
The data of a valid topology is read from its word in polynomial time.
The topology Φ_topo(f) of a valid circuit is computed in polynomial time from its word: drop
the truth table of each gate.
Library infrastructure (no cited result): uniform strict PPT combinator for a two-stage
prv.sim reduction that runs B.choose (), branches on a polynomial-time guard guard, delegates
to cont when guard holds, and runs B.guess on ⊥ otherwise.
Library infrastructure (no cited result): uniform strict PPT combinator for a two-stage
prv.sim reduction that checks query.input.length = n query.fn ∧ mult * q query.fn ≤ 2 ^ k,
samples coinLen k query.fn uniform coin bits and delegates to cont, or runs B.guess on ⊥.
Library infrastructure (no cited result): one replyStepWord step is uniform strict oracle
PPT whenever the request and length bound are computed in polynomial time.
Library infrastructure (no cited result): a replyStepWord len step increases the encoded
reply-list length by at most 2 * len + 2.
Library infrastructure (no cited result): iterating replyStepWord len (req ·.length) from
[] for c steps against a pure-answering word oracle collects (List.range c).map of the
replies truncated to len bits.
Library infrastructure (no cited result): iterating replyStepWord from [] for a
polynomial-time unary count count is uniform strict oracle PPT whenever the reply cap len and
request function req are computed in polynomial time.