Documentation

Complexity.Crypto.Computational.Homomorphic.Leveled.PolyTime

Uniform native certificates for the depth-budgeted scheme #

These certificates compose the actual sampler, serializers, total decoders, circuit compiler, identity padding, encrypted evaluator and tags. Both the security parameter and depth budget use unary encodings. The same polynomial bound therefore applies as the budget varies; the proofs do not fix a different hidden clock for each budget. Efficient unary budget families can then be substituted for the second parameter.

The bounds charge the complete key artifacts, circuit code and input ciphertext lists. They also cover malformed keys, wrong-width ciphertexts, and circuits exceeding the budget. No correctness or valid-input premise supplies a runtime bound. Total decryption executes the generated circuit, so no separate runtime assumption on the base decryption function is needed.

Main results #

References #

theorem Cslib.Crypto.Homomorphic.Leveled.computableInPolyTime_decrypt {α : Type} {input : α ↪ List Bool} {E : Scheme} {n : α → ℕ} {sk ciphertext : α → List Bool} {secretWidth ciphertextWidth : ℕ → ℕ} (D : DecryptionCircuits E secretWidth ciphertextWidth) (hD : Turing.MultiTapeTM.ComputableInPolyTime (fun (n : ℕ) => ⟨secretWidth n + ciphertextWidth n, D.circuit n⟩) Turing.MultiTapeTM.encUnary (Circuits.Boolean.encCircuit 1)) (hn : Turing.MultiTapeTM.ComputableInPolyTime n input Turing.MultiTapeTM.encUnary) (hsk : Turing.MultiTapeTM.ComputableInPolyTime sk input Turing.MultiTapeTM.encBits) (hc : Turing.MultiTapeTM.ComputableInPolyTime ciphertext input Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (a : α) => decrypt D (n a) (sk a) (ciphertext a)) input Turing.MultiTapeTM.encBool

Decryption is polynomial time on every encoded input and contains no budget parameter.

theorem Cslib.Crypto.Homomorphic.Leveled.isPPTOn_evaluateCircuit {α : Type} {input : α ↪ List Bool} {E : Scheme} (hencrypt : Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBool)) Turing.MultiTapeTM.encBits fun (p : ℕ × List Bool × Bool) => E.encrypt p.1 p.2.1 p.2.2) {n budget : α → ℕ} {secretWidth ciphertextWidth : ℕ → ℕ} (D : DecryptionCircuits E secretWidth ciphertextWidth) (hD : Turing.MultiTapeTM.ComputableInPolyTime (fun (n : ℕ) => ⟨secretWidth n + ciphertextWidth n, D.circuit n⟩) Turing.MultiTapeTM.encUnary (Circuits.Boolean.encCircuit 1)) (hevaluate : Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encPair (Circuits.Boolean.encCircuit 1) (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits)))) Turing.MultiTapeTM.encBits fun (p : ℕ × List Bool × ((n : ℕ) × Circuits.Circuit Circuits.Boolean.signature n 1) × List (List Bool)) => E.evaluate p.1 p.2.1 p.2.2.1 p.2.2.2) {inputCount : α → ℕ} {publicKeys inputs : α → List (List Bool)} {links : α → List (List (List Bool))} {code : α → List (Circuits.Boolean.Op × List ℕ) × List ℕ} (hn : Turing.MultiTapeTM.ComputableInPolyTime n input Turing.MultiTapeTM.encUnary) (hbudget : Turing.MultiTapeTM.ComputableInPolyTime budget input Turing.MultiTapeTM.encUnary) (hpks : Turing.MultiTapeTM.ComputableInPolyTime publicKeys input (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits)) (hlinks : Turing.MultiTapeTM.ComputableInPolyTime links input (Turing.MultiTapeTM.encList (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits))) (hinputs : Turing.MultiTapeTM.ComputableInPolyTime inputs input (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits)) (hcount : Turing.MultiTapeTM.ComputableInPolyTime inputCount input Turing.MultiTapeTM.encUnary) (hcode : Turing.MultiTapeTM.ComputableInPolyTime code input Circuits.Boolean.encCode) :
Probability.IsPPTOn input (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) fun (a : α) => evaluateCircuit D (n a) (budget a) (publicKeys a) (links a) (inputs a) (inputCount a) (code a)

Compile, pad, evaluate and select outputs uniformly in the full raw code and unary budget.

theorem Cslib.Crypto.Homomorphic.Leveled.isPPTOn_evaluateHop {α : Type} {input : α ↪ List Bool} {E : Scheme} (hencrypt : Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBool)) Turing.MultiTapeTM.encBits fun (p : ℕ × List Bool × Bool) => E.encrypt p.1 p.2.1 p.2.2) {n : α → ℕ} {pk : α → List Bool} {secretWidth ciphertextWidth : ℕ → ℕ} (D : DecryptionCircuits E secretWidth ciphertextWidth) (hevaluate : Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encPair (Circuits.Boolean.encCircuit 1) (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits)))) Turing.MultiTapeTM.encBits fun (p : ℕ × List Bool × ((n : ℕ) × Circuits.Circuit Circuits.Boolean.signature n 1) × List (List Bool)) => E.evaluate p.1 p.2.1 p.2.2.1 p.2.2.2) (hcircuits : Turing.MultiTapeTM.ComputableInPolyTime (fun (n : ℕ) => ⟨secretWidth n + ciphertextWidth n, D.circuit n⟩) Turing.MultiTapeTM.encUnary (Circuits.Boolean.encCircuit 1)) {offset step : α → ℕ} {c : α → (m : ℕ) × Circuits.Circuit Circuits.Boolean.signature m 1} {inputs : α → List (List Bool)} (hn : Turing.MultiTapeTM.ComputableInPolyTime n input Turing.MultiTapeTM.encUnary) (hoffset : Turing.MultiTapeTM.ComputableInPolyTime offset input Turing.MultiTapeTM.encUnary) (hstep : Turing.MultiTapeTM.ComputableInPolyTime step input Turing.MultiTapeTM.encUnary) (hpk : Turing.MultiTapeTM.ComputableInPolyTime pk input Turing.MultiTapeTM.encBits) (hc : Turing.MultiTapeTM.ComputableInPolyTime c input (Circuits.Boolean.encCircuit 1)) (hinputs : Turing.MultiTapeTM.ComputableInPolyTime inputs input (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits)) :
Probability.IsPPTOn input Turing.MultiTapeTM.encBits fun (a : α) => evaluateHop D (n a) (offset a) (step a) (pk a) (c a) (inputs a)

Hop evaluation is strict PPT uniformly in the security parameter, depth offset, step budget, public key, circuit, and input ciphertexts.

theorem Cslib.Crypto.Homomorphic.Leveled.isPPTOn_evaluate {α : Type} {input : α ↪ List Bool} {E : Scheme} (hencrypt : Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBool)) Turing.MultiTapeTM.encBits fun (p : ℕ × List Bool × Bool) => E.encrypt p.1 p.2.1 p.2.2) {n budget : α → ℕ} {pk : α → List Bool} {secretWidth ciphertextWidth : ℕ → ℕ} (D : DecryptionCircuits E secretWidth ciphertextWidth) (hD : Turing.MultiTapeTM.ComputableInPolyTime (fun (n : ℕ) => ⟨secretWidth n + ciphertextWidth n, D.circuit n⟩) Turing.MultiTapeTM.encUnary (Circuits.Boolean.encCircuit 1)) (hevaluate : Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encPair (Circuits.Boolean.encCircuit 1) (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits)))) Turing.MultiTapeTM.encBits fun (p : ℕ × List Bool × ((n : ℕ) × Circuits.Circuit Circuits.Boolean.signature n 1) × List (List Bool)) => E.evaluate p.1 p.2.1 p.2.2.1 p.2.2.2) {c : α → (m : ℕ) × Circuits.Circuit Circuits.Boolean.signature m 1} {inputs : α → List (List Bool)} (hn : Turing.MultiTapeTM.ComputableInPolyTime n input Turing.MultiTapeTM.encUnary) (hbudget : Turing.MultiTapeTM.ComputableInPolyTime budget input Turing.MultiTapeTM.encUnary) (hpk : Turing.MultiTapeTM.ComputableInPolyTime pk input Turing.MultiTapeTM.encBits) (hc : Turing.MultiTapeTM.ComputableInPolyTime c input (Circuits.Boolean.encCircuit 1)) (hinputs : Turing.MultiTapeTM.ComputableInPolyTime inputs input (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits)) :
Probability.IsPPTOn input Turing.MultiTapeTM.encBits fun (a : α) => evaluate D (n a) (budget a) (pk a) (c a) (inputs a)

The actual scheme evaluator is strict PPT, including on malformed artifacts and on circuits outside the chosen depth budget. The native certificate charges the complete circuit input.

theorem Cslib.Crypto.Homomorphic.Leveled.polynomiallyBounded_widths {E : Scheme} {secretWidth ciphertextWidth : ℕ → ℕ} (D : DecryptionCircuits E secretWidth ciphertextWidth) (hD : Turing.MultiTapeTM.ComputableInPolyTime (fun (n : ℕ) => ⟨secretWidth n + ciphertextWidth n, D.circuit n⟩) Turing.MultiTapeTM.encUnary (Circuits.Boolean.encCircuit 1)) :
(PolynomiallyBounded fun (n : ℕ) => 3 * secretWidth n + 1) ∧ PolynomiallyBounded fun (n : ℕ) => ciphertextWidth n + 1

The circuit generator emits its input arity in unary. Its native runtime certificate therefore bounds both base widths and the two derived widths polynomially in n, independently of the depth budget. No separate polynomial-width assumption is needed.

The constructed decryption algorithm and its polynomial clock are independent of the budget.

theorem Cslib.Crypto.Homomorphic.Leveled.isPPTOn_scheme_evaluate {E : Scheme} (hencrypt : Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBool)) Turing.MultiTapeTM.encBits fun (p : ℕ × List Bool × Bool) => E.encrypt p.1 p.2.1 p.2.2) {secretWidth ciphertextWidth : ℕ → ℕ} (D : DecryptionCircuits E secretWidth ciphertextWidth) (hD : Turing.MultiTapeTM.ComputableInPolyTime (fun (n : ℕ) => ⟨secretWidth n + ciphertextWidth n, D.circuit n⟩) Turing.MultiTapeTM.encUnary (Circuits.Boolean.encCircuit 1)) (hevaluate : Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encPair (Circuits.Boolean.encCircuit 1) (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits)))) Turing.MultiTapeTM.encBits fun (p : ℕ × List Bool × ((n : ℕ) × Circuits.Circuit Circuits.Boolean.signature n 1) × List (List Bool)) => E.evaluate p.1 p.2.1 p.2.2.1 p.2.2.2) (budget : ℕ → ℕ) (hbudget : Turing.MultiTapeTM.ComputableInPolyTime budget Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) :

An efficient unary budget yields one uniform certificate for the constructed evaluator.