Documentation

CslibFrontier.Crypto.Computational.Encryption.PolyTime

Native runtime of the chosen-message experiment #

The actual experiment composes key generation, message selection, encryption and guessing. Native certificates charge the complete sampled public key, saved adversary state and challenge ciphertext; no independent bound on those intermediate values is assumed.

Main results #

References #

theorem Cslib.Crypto.Encryption.isPPTOn_gameOn {Msg : Type} {encMsg : Msg ↪ List Bool} {valid : ℕ → List Bool → Msg → Msg → Bool} (hvalid : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × List Bool × Msg × Msg) => match x with | (n, pk, m₀, m₁) => valid n pk m₀ m₁) (encChallengePairInput encMsg) Turing.MultiTapeTM.encBool) {keyGen : ℕ → ProbComp (List Bool × List Bool)} {encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)} (hkeyGen : Probability.IsPPTOn Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) keyGen) (hencrypt : Probability.IsPPTOn (encKeyedInput encMsg) Turing.MultiTapeTM.encBits fun (x : ℕ × List Bool × Msg) => match x with | (n, pk, msg) => encrypt n pk msg) {adversary : AdversaryOf Msg} (hadversary : AdversaryOf.IsPPT encMsg adversary) {α : Type} {input : α ↪ List Bool} {n : α → ℕ} {bit : α → Bool} (hn : Turing.MultiTapeTM.ComputableInPolyTime n input Turing.MultiTapeTM.encUnary) (hbit : Turing.MultiTapeTM.ComputableInPolyTime bit input Turing.MultiTapeTM.encBool) :
Probability.IsPPTOn input Turing.MultiTapeTM.encBool fun (a : α) => gameOn valid keyGen encrypt adversary (bit a) (n a)

The chosen-message experiment gameOn valid has a strict clock in the full encoded caller input when valid is computable in polynomial time.

theorem Cslib.Crypto.Encryption.isPPTOn_game {Msg : Type} {encMsg : Msg ↪ List Bool} {keyGen : ℕ → ProbComp (List Bool × List Bool)} {encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)} (hkeyGen : Probability.IsPPTOn Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) keyGen) (hencrypt : Probability.IsPPTOn (encKeyedInput encMsg) Turing.MultiTapeTM.encBits fun (x : ℕ × List Bool × Msg) => match x with | (n, pk, msg) => encrypt n pk msg) {adversary : AdversaryOf Msg} (hadversary : AdversaryOf.IsPPT encMsg adversary) {α : Type} {input : α ↪ List Bool} {n : α → ℕ} {bit : α → Bool} (hn : Turing.MultiTapeTM.ComputableInPolyTime n input Turing.MultiTapeTM.encUnary) (hbit : Turing.MultiTapeTM.ComputableInPolyTime bit input Turing.MultiTapeTM.encBool) :
Probability.IsPPTOn input Turing.MultiTapeTM.encBool fun (a : α) => game keyGen encrypt adversary (bit a) (n a)

The unrestricted chosen-message experiment has a strict clock in the full encoded caller input.

theorem Cslib.Crypto.Encryption.AdversaryOf.IsPPT.restrict {Msg : Type} {encMsg : Msg ↪ List Bool} {valid : ℕ → List Bool → Msg → Msg → Bool} (hvalid : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × List Bool × Msg × Msg) => match x with | (n, pk, m₀, m₁) => valid n pk m₀ m₁) (encChallengePairInput encMsg) Turing.MultiTapeTM.encBool) {adversary : AdversaryOf Msg} (hadversary : IsPPT encMsg adversary) :
IsPPT encMsg (AdversaryOf.restrict valid adversary)

Restricting a uniform strict PPT adversary by a polynomial-time admissibility predicate keeps it uniform strict PPT: choose additionally evaluates valid and prepends one bit to the saved state, and guess branches on that bit.

theorem Cslib.Crypto.Encryption.INDCPAOf.indcpaOn {Msg : Type} {encMsg : Msg ↪ List Bool} {valid : ℕ → List Bool → Msg → Msg → Bool} {keyGen : ℕ → ProbComp (List Bool × List Bool)} {encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)} (h : INDCPAOf encMsg keyGen encrypt) (hvalid : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × List Bool × Msg × Msg) => match x with | (n, pk, m₀, m₁) => valid n pk m₀ m₁) (encChallengePairInput encMsg) Turing.MultiTapeTM.encBool) :
INDCPAOn valid encMsg keyGen encrypt

Unrestricted IND-CPA implies IND-CPA under every polynomial-time admissibility predicate.

theorem Cslib.Crypto.Encryption.INDCPAOf.wordINDCPA {keyGen : ℕ → ProbComp (List Bool × List Bool)} {encrypt : ℕ → List Bool → List Bool → ProbComp (List Bool)} (h : INDCPAOf Turing.MultiTapeTM.encBits keyGen encrypt) :
WordINDCPA keyGen encrypt

Unrestricted bit-word IND-CPA implies WordINDCPA.

Strict PPT key generation supplies an executable unary polynomial bounding the total public and secret key material on every supported execution. No width function is assumed computable.