Conventional circuits as circuits #
A conventional circuit f = (n, m, q, A, B, G) of Bellare, Hoang and Rogaway
[BHR12b] (ConventionalCircuit), numbers its wires from 1, reads
its gates' arguments from the 1-indexed wires A g and B g, and outputs its last m wires. A
valid one is a circuit ConventionalCircuit.toCircuit f : Circuit (fullSignature 2 Bool) n m over
the full binary basis: gate g applies the truth table G g to the 0-indexed wires A g - 1 and
B g - 1, and output o is wire n + q - m + o. It is decoded with Circuit.ofCode from this
gate list (ConventionalCircuit.code_toCircuit), so the garbling and privacy results stated for
Circuit apply to conventional circuits. Both semantics agree
(ConventionalCircuit.eval_toCircuit): on an n-bit input the circuit's outputs are
ConventionalCircuit.evalCirc.
Main definitions #
Cslib.Crypto.Garbling.ConventionalCircuit.gateCode,Cslib.Crypto.Garbling.ConventionalCircuit.outputCode: a conventional circuit as circuit code.Cslib.Crypto.Garbling.ConventionalCircuit.toCircuit: a valid conventional circuit as a circuit.
Main results #
Cslib.Crypto.Garbling.ConventionalCircuit.eval_toCircuit: it computesevalCirc.
Since toCircuit is not exposed, its gates, their binary operations and argument wires, and its
output wires are read through interface lemmas (ConventionalCircuit.size_toCircuit,
ConventionalCircuit.lines_toCircuit, ConventionalCircuit.arity_topology_toCircuit,
ConventionalCircuit.ofFn_toNat_wires_toCircuit, ConventionalCircuit.wires_toCircuit_zero,
ConventionalCircuit.wires_toCircuit_one, ConventionalCircuit.toNat_outputs_toCircuit).
References #
The gates of a conventional circuit as circuit code over the full binary basis: gate i
applies its truth table to the 0-indexed wires A i - 1 and B i - 1.
The output wires of a conventional circuit as circuit code: output o is the 0-indexed wire
n + q - m + o, one of the last m wires.
A valid conventional circuit as a circuit over the full binary basis, decoded from its gate list.
The code of toCircuit f is the gate list of f with its last m wires as outputs.
toCircuit f has the q gates of f.
The argument wires of gate g of toCircuit f are the 0-indexed wires A g - 1 and
B g - 1.
The lines of toCircuit f: gate g applies the truth table G g to the 0-indexed wires
A g - 1 and B g - 1.
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.