XOR–AND conventional circuits as half-gates circuits #
Half-gates garbling [ZRE15] garbles circuits whose gates all compute XOR or AND
(Figure 2, p. 9, which assumes "all gates are either AND or XOR"). XorAndCircuit is the type of
valid conventional circuits of Bellare, Hoang and Rogaway [BHR12b] whose truth
tables are all XOR or AND (ConventionalCircuit.IsXorAnd). It is a decidable subtype of
ValidCircuit, encoded by encValidCircuit (encXorAndCircuit).
HalfGates.toCircuit f : Circuit HalfGates.signature n m is such a circuit over the XOR–AND basis:
gate g applies AND when G g is the AND table and XOR otherwise, to the 0-indexed wires
A g - 1 and B g - 1, and output o is wire n + q - m + o. Translating it back to the full
binary basis along the meaning-preserving map HalfGates.toFull gives
ConventionalCircuit.toCircuit f (HalfGates.mapOp_toCircuit), so its gates, wires and outputs
are those of the conventional circuit, and it computes ConventionalCircuit.evalCirc
(HalfGates.eval_toCircuit).
Main definitions #
Cslib.Crypto.Garbling.ConventionalCircuit.IsXorAnd,Cslib.Crypto.Garbling.XorAndCircuit,Cslib.Crypto.Garbling.encXorAndCircuit: XOR–AND conventional circuits and their words.Cslib.Crypto.Garbling.HalfGates.toFull: the XOR–AND basis inside the full binary basis.Cslib.Crypto.Garbling.HalfGates.toCircuit: an XOR–AND conventional circuit as a half-gates circuit.
Main results #
Cslib.Crypto.Garbling.HalfGates.mapOp_toCircuit: translated to the full binary basis it isConventionalCircuit.toCircuit.Cslib.Crypto.Garbling.HalfGates.eval_toCircuit: it computesevalCirc.
References #
Every gate of f computes XOR or AND.
Instances For
Valid conventional circuits whose gates all compute XOR or AND: the circuits that half-gates garbling garbles.
The conventional circuit of an XOR–AND circuit.
The conventional circuit of an XOR–AND circuit is valid.
Every gate of an XOR–AND circuit computes XOR or AND.
XOR–AND circuits as words, by encValidCircuit.
An XOR–AND circuit is written as its valid circuit.
An XOR–AND circuit is written as its valid circuit, so reading the valid circuit costs nothing.
The XOR–AND basis inside the full binary basis: XOR and AND as their truth tables.
Instances For
The gates of a conventional circuit as circuit code over the XOR–AND basis: gate i applies
opOf (G i) to the 0-indexed wires A i - 1 and B i - 1.
An XOR–AND conventional circuit as a circuit over the XOR–AND basis, decoded from its gate list.
The code of toCircuit f is the half-gates gate list of f with its last m wires as
outputs.
Back in the full binary basis. Translating toCircuit f along toFull gives the
conventional circuit's own translation ConventionalCircuit.toCircuit f.
toCircuit f has the q gates of f.
The value of wire w of toCircuit f on an n-bit input is wire w of the conventional
evaluation, numbered from 0.
The translation computes the conventional semantics. On every n-bit input, the outputs
of toCircuit f are evalCirc f.