Homomorphic evaluation of Boolean circuits under GSW #
A circuit is compiled into consecutive NAND layers by Layered.compile, and every layer is
evaluated on serialized GSW ciphertexts. Constants are the noiseless public ciphertexts
Flatten(μ · I_N), copies forward a wire, and NAND is the serialized Flatten(I_N - C₁ C₂).
The evaluator is deterministic and uses only the dimensions, not the public key.
BoundedError is GSW's "B-bounded error" on complete serialized words. A NAND layer multiplies
the bound by at most N + 1, where N = (n + 1) * w, so a circuit of depth d, compiled into
2 * d layers, returns a (N + 1) ^ (2 * d) * B-bounded ciphertext of its output on
B-bounded inputs [GentrySahaiWaters2013, Section 3.3]. Under the strict margin
4 * m * η * (N + 1) ^ (2 * d) < 2 ^ w this decrypts correctly for every supported key and
fresh encryption. The margin constant 4 comes from this library's middle-half decoder; it is
not the paper's q / B > 8 (N + 1) ^ L [GentrySahaiWaters2013, Section 3.4].
Main definitions #
Cslib.Crypto.Homomorphic.GSW.constCiphertext,.constSerialized: noiseless constants.Cslib.Crypto.Homomorphic.GSW.BoundedError: a complete word with a bounded integer error.Cslib.Crypto.Homomorphic.GSW.evaluateNode,.evaluateLayer,.evaluateLayers: layered evaluation on serialized ciphertexts, total on malformed inputs.Cslib.Crypto.Homomorphic.GSW.evaluateCircuit: compile, evaluate and select output0.
Main results #
Cslib.Crypto.Homomorphic.GSW.boundedError_encryptSerialized: supported fresh encryptions have error bounded bym * η.Cslib.Crypto.Homomorphic.GSW.BoundedError.nandSerialized: NAND turns boundsB₁, B₂intoB₁ + N * B₂.Cslib.Crypto.Homomorphic.GSW.boundedError_evaluateCircuit: the error after a circuit of depthdis bounded by(N + 1) ^ (2 * d)times the input bound.Cslib.Crypto.Homomorphic.GSW.evaluateCircuit_correct: correctness and exact width on supported fresh encryptions under the strict margin.
References #
- [C. Gentry, A. Sahai and B. Waters, Homomorphic Encryption from Learning with Errors: Conceptually-Simpler, Asymptotically-Faster, Attribute-Based, Sections 3.3 and 3.4] [GSW13]
The noiseless ciphertext Flatten(μ · I_N) of a public bit.
Instances For
A noiseless constant satisfies the GSW equation with zero error, under every secret.
The constant is the bit decomposition of μ • G.
The computed word is the canonical serialization of the typed constant.
A constant word has the complete square ciphertext width.
ciphertext is a complete square ciphertext word encrypting μ under secret whose
integer error has every coordinate bounded by bound. This is GSW's "B-bounded error"
[GentrySahaiWaters2013, Section 3.4] for serialized words. It makes no freshness claim.
Instances For
A bound may be weakened.
A word with error strictly below a quarter of the modulus decrypts to its plaintext.
NAND of B₁- and B₂-bounded words is B₁ + N * B₂-bounded, with N = (n + 1) * w
[GentrySahaiWaters2013, Section 3.3].
A noiseless constant is 0-bounded under every secret word.
Every supported fresh encryption under a supported key has error bounded by m * η.
Evaluate one layered node on serialized ciphertexts. Copies are cut to the ciphertext width, which leaves every complete ciphertext unchanged and bounds malformed wires.
Instances For
Compile the circuit into NAND layers, evaluate them, and return designated output 0.
Evaluation needs only the dimensions; no public key or evaluation key is read.
Instances For
One valid node multiplies the error bound by at most N + 1.
A valid layer multiplies the error bound by at most N + 1.
A well-formed schedule of L layers multiplies the error bound by at most (N + 1) ^ L
[GentrySahaiWaters2013, Section 3.3]. Copy layers are counted although they add no error.
A circuit of depth d evaluated on B-bounded inputs returns a
(N + 1) ^ (2 * d) * B-bounded ciphertext of its output, with N = (n + 1) * w. The inputs may
themselves be outputs of earlier evaluations.
GSW circuit evaluation is correct on supported fresh encryptions under a supported key,
when 4 * m * η * (N + 1) ^ (2 * d) < 2 ^ w for the circuit's depth d. The output also has
the exact square ciphertext width. This is the bounded-depth correctness of
[GentrySahaiWaters2013, Sections 3.3 and 3.4] for the library's decoder.