Documentation

CslibFrontier.Crypto.Computational.Encryption.LoRCPA

Adaptive multi-challenge left-or-right chosen-plaintext security #

In the Q-query left-or-right chosen-plaintext experiment (Boneh and Shoup, Section 11.3.2, Attack Game 11.2 and Definition 11.4, p. 439; cf. Attack Game 11.1, Section 11.2, p. 436), an adversary first initializes its saved state word from the security parameter and public key (start), then Adaptive-CPA interacts with a left-or-right encryption oracle for Q n queries (query), and finally outputs a distinguishing bit (guess). At each query step, query receives the unary security parameter, the current saved state word, and the reverse transcript of challenge ciphertexts seen so far, and returns a fresh challenge pair (msg₀, msg₁) together with an updated state word (ChoiceOut Msg). Because query updates the state word at every step, coins flipped or challenge messages chosen in earlier queries remain available to subsequent queries and to guess.

This module also provides the generic Q-query public-key replacement distinguishers lorDistinguisher (for a fixed challenge bit) and lorKeyDistinguisher (sampling a hidden fair challenge bit and outputting guess ^^ bit), together with their uniform strict PPT composition certificates (isPPTOn_lorDistinguisher, isPPT_lorDistinguisher, isPPT_lorKeyDistinguisher) and the loss-two public-key replacement bound advantage_lorDistinguisher_le.

Main definitions #

Main results #

References #

A stateful adaptive multi-challenge left-or-right adversary over message space Msg.

  • start receives the security parameter and public-key word and returns an initial state word.
  • query receives the security parameter, current state word, and reverse transcript of challenge ciphertext words received so far, and outputs the next challenge pair (msg₀, msg₁) together with the updated state word (ChoiceOut Msg = (Msg × Msg) × List Bool).
  • guess receives the security parameter, final state word, and complete reverse transcript of challenge ciphertext words, and outputs a distinguishing bit.
@[reducible, inline]

Adaptive query-and-guessing stage input (1ⁿ, state, transcript): the security parameter n in unary, then the adversary's saved state word and the reverse list of challenge ciphertext words. Both the parameter and the state word are framed.

@[reducible, inline]

Adaptive loop state (state, transcript): the adversary's saved state word paired with the reverse list of challenge ciphertext words received so far.

structure Cslib.Crypto.Encryption.LoRAdversaryOf.IsPPT {Msg : Type} (encMsg : Msg ↪ List Bool) (adversary : LoRAdversaryOf Msg) :

Uniform strict PPT certificate for a stateful LoRAdversaryOf Msg over message encoding encMsg: all three stages (start, query, guess) are uniform strict PPT on their complete inputs, each adaptive query increases the bit length of the saved state word by at most a polynomially bounded function of the security parameter, and each queried challenge pair has encoded length polynomially bounded in the security parameter and current saved state length (independently of the ciphertext transcript, preventing adaptive exponential message/ciphertext blowup across rounds).

@[reducible, inline]

A stateful adaptive left-or-right adversary for single-bit messages (Bool).

@[reducible, inline]

Native uniform strict PPT admissibility for a bit adaptive left-or-right adversary.

@[reducible, inline]

A stateful adaptive left-or-right adversary for bit-word messages (List Bool).

@[reducible, inline]

Native uniform strict PPT admissibility for a bit-word adaptive left-or-right adversary.

noncomputable def Cslib.Crypto.Encryption.lorStepOn {Msg : Type} (valid : ℕ → List Bool → Msg → Msg → Bool) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (adversary : LoRAdversaryOf Msg) (security : ℕ) (pk : List Bool) (bit : Bool) (loopState : List Bool × List (List Bool)) :

One adaptive left-or-right query step with challenge-pair admissibility predicate valid: ask adversary.query on the current state word and reverse ciphertext transcript; if valid security pk msg₀ msg₁ holds, encrypt the challenge message selected by bit under pk, and otherwise record [] without calling encrypt; return the updated state word paired with the extended ciphertext transcript.

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.Encryption.lorStep {Msg : Type} (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (adversary : LoRAdversaryOf Msg) (security : ℕ) (pk : List Bool) (bit : Bool) (loopState : List Bool × List (List Bool)) :

One unrestricted adaptive left-or-right query step: lorStepOn with every challenge pair admissible.

noncomputable def Cslib.Crypto.Encryption.lorRunOn {Msg : Type} (valid : ℕ → List Bool → Msg → Msg → Bool) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (adversary : LoRAdversaryOf Msg) (security : ℕ) (pk : List Bool) (bit : Bool) (q : ℕ) (loopState : List Bool × List (List Bool)) :

Run q adaptive left-or-right query steps with admissibility predicate valid starting from loopState = (state, transcript).

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.Encryption.lorRun {Msg : Type} (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (adversary : LoRAdversaryOf Msg) (security : ℕ) (pk : List Bool) (bit : Bool) (q : ℕ) (loopState : List Bool × List (List Bool)) :

Run q unrestricted adaptive left-or-right query steps starting from loopState = (state, transcript).

noncomputable def Cslib.Crypto.Encryption.lorDistinguisherOn {Msg : Type} (valid : ℕ → List Bool → Msg → Msg → Bool) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) (bit : Bool) :

The Q-query left-or-right public-key distinguisher with admissibility predicate valid for a fixed challenge bit bit: initialize the adversary state on pk, answer Q security adaptive queries under pk and bit, and return the adversary's final guess.

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.Encryption.lorDistinguisher {Msg : Type} (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) (bit : Bool) :

The unrestricted Q-query left-or-right public-key distinguisher for a fixed challenge bit bit.

noncomputable def Cslib.Crypto.Encryption.lorKeyDistinguisherOn {Msg : Type} (valid : ℕ → List Bool → Msg → Msg → Bool) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) :

The single uniform hidden-bit public-key distinguisher for Q-query left-or-right security with admissibility predicate valid: sample a fair challenge bit bit, run lorDistinguisherOn with bit, and return guess ^^ bit.

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.Encryption.lorKeyDistinguisher {Msg : Type} (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) :

The unrestricted single uniform hidden-bit public-key distinguisher for Q-query left-or-right security.

noncomputable def Cslib.Crypto.Encryption.lorGameOn {Msg : Type} (valid : ℕ → List Bool → Msg → Msg → Bool) (keyGen : ℕ → ProbComp (List Bool × List Bool)) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) (bit : Bool) (security : ℕ) :

The Q-query left-or-right chosen-plaintext experiment with admissibility predicate valid and generated keys.

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.Encryption.lorGame {Msg : Type} (keyGen : ℕ → ProbComp (List Bool × List Bool)) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) (bit : Bool) (security : ℕ) :

The unrestricted Q-query left-or-right chosen-plaintext experiment with generated keys.

def Cslib.Crypto.Encryption.LoRINDCPAOn {Msg : Type} (valid : ℕ → List Bool → Msg → Msg → Bool) (encMsg : Msg ↪ List Bool) (keyGen : ℕ → ProbComp (List Bool × List Bool)) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) :

Adaptive Q-query left-or-right IND-CPA security over message encoding encMsg with challenge-pair admissibility predicate valid, against every uniform strict PPT LoRAdversaryOf Msg.

@[reducible, inline]
abbrev Cslib.Crypto.Encryption.LoRINDCPAOf {Msg : Type} (encMsg : Msg ↪ List Bool) (keyGen : ℕ → ProbComp (List Bool × List Bool)) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) :

Adaptive Q-query left-or-right IND-CPA security with every challenge pair admissible. For fixed-length message types such as Bool, this is the textbook notion; for List Bool it is stronger than the textbook equal-length notion, which WordLoRINDCPA states.

@[reducible, inline]
abbrev Cslib.Crypto.Encryption.LoRINDCPA (keyGen : ℕ → ProbComp (List Bool × List Bool)) (encrypt : ℕ → List Bool → Bool → ProbComp (List Bool)) (Q : ℕ → ℕ) :

Adaptive Q-query left-or-right IND-CPA security for single-bit encryption (Bool).

@[reducible, inline]
abbrev Cslib.Crypto.Encryption.WordLoRINDCPA (keyGen : ℕ → ProbComp (List Bool × List Bool)) (encrypt : ℕ → List Bool → List Bool → ProbComp (List Bool)) (Q : ℕ → ℕ) :

Adaptive Q-query left-or-right IND-CPA security for bit-word encryption (List Bool) under Attack Game 11.2's equal-length rule ([BS23], Section 11.3.2, Attack Game 11.2 and Definition 11.4, p. 439; cf. Attack Game 11.1, Section 11.2, p. 436): challenge pairs with m₀.length ≠ m₁.length are inadmissible.

theorem Cslib.Crypto.Encryption.eval_lorGameOn_eq_distinguishingGame {Msg : Type} (valid : ℕ → List Bool → Msg → Msg → Bool) (keyGen : ℕ → ProbComp (List Bool × List Bool)) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) (bit : Bool) (security : ℕ) :
(lorGameOn valid keyGen encrypt Q adversary bit security).eval = distinguishingGame (PMF.map Prod.fst (keyGen security).eval) (lorDistinguisherOn valid encrypt Q adversary bit security)

An honest key generator contributes precisely its public-key marginal to lorGameOn.

theorem Cslib.Crypto.Encryption.eval_lorGame_eq_distinguishingGame {Msg : Type} (keyGen : ℕ → ProbComp (List Bool × List Bool)) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) (bit : Bool) (security : ℕ) :
(lorGame keyGen encrypt Q adversary bit security).eval = distinguishingGame (PMF.map Prod.fst (keyGen security).eval) (lorDistinguisher encrypt Q adversary bit security)

An honest key generator contributes precisely its public-key marginal to lorGame.

theorem Cslib.Crypto.Encryption.distinguishingGame_lorKeyDistinguisherOn {Msg : Type} (valid : ℕ → List Bool → Msg → Msg → Bool) (keys : PMF (List Bool)) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) (security : ℕ) :
distinguishingGame keys (lorKeyDistinguisherOn valid encrypt Q adversary security) = do let bit ← Probability.PMF.uniformOfFintype Bool PMF.map (fun (guess : Bool) => guess ^^ bit) (distinguishingGame keys (lorDistinguisherOn valid encrypt Q adversary bit security))

The hidden-bit distinguisher lorKeyDistinguisherOn averages the two lorDistinguisherOn games, complementing the true experiment.

theorem Cslib.Crypto.Encryption.distinguishingGame_lorKeyDistinguisher {Msg : Type} (keys : PMF (List Bool)) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) (security : ℕ) :
distinguishingGame keys (lorKeyDistinguisher encrypt Q adversary security) = do let bit ← Probability.PMF.uniformOfFintype Bool PMF.map (fun (guess : Bool) => guess ^^ bit) (distinguishingGame keys (lorDistinguisher encrypt Q adversary bit security))

The hidden-bit distinguisher lorKeyDistinguisher averages the two lorDistinguisher games, complementing the true experiment.

theorem Cslib.Crypto.Encryption.probability_lorKeyDistinguisherOn {Msg : Type} (valid : ℕ → List Bool → Msg → Msg → Bool) (keys : PMF (List Bool)) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) (security : ℕ) :
↑(distinguishingGame keys (lorKeyDistinguisherOn valid encrypt Q adversary security)).succProbability = (1 + ↑(distinguishingGame keys (lorDistinguisherOn valid encrypt Q adversary false security)).succProbability - ↑(distinguishingGame keys (lorDistinguisherOn valid encrypt Q adversary true security)).succProbability) / 2

Acceptance of lorKeyDistinguisherOn is one half plus half the signed Q-query gap.

theorem Cslib.Crypto.Encryption.probability_lorKeyDistinguisher {Msg : Type} (keys : PMF (List Bool)) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) (security : ℕ) :
↑(distinguishingGame keys (lorKeyDistinguisher encrypt Q adversary security)).succProbability = (1 + ↑(distinguishingGame keys (lorDistinguisher encrypt Q adversary false security)).succProbability - ↑(distinguishingGame keys (lorDistinguisher encrypt Q adversary true security)).succProbability) / 2

Acceptance of lorKeyDistinguisher is one half plus half the signed Q-query gap.

theorem Cslib.Crypto.Encryption.advantage_lorDistinguisherOn_le {Msg : Type} (valid : ℕ → List Bool → Msg → Msg → Bool) (real ideal : PMF (List Bool)) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) (security : ℕ) :
(distinguishingGame real (lorDistinguisherOn valid encrypt Q adversary false security)).advantage (distinguishingGame real (lorDistinguisherOn valid encrypt Q adversary true security)) ≤ 2 * (distinguishingGame real (lorKeyDistinguisherOn valid encrypt Q adversary security)).advantage (distinguishingGame ideal (lorKeyDistinguisherOn valid encrypt Q adversary security)) + (distinguishingGame ideal (lorDistinguisherOn valid encrypt Q adversary false security)).advantage (distinguishingGame ideal (lorDistinguisherOn valid encrypt Q adversary true security))

Replacing the public-key law real with ideal in the Q-query left-or-right experiment with admissibility predicate valid costs at most twice the distinguishing advantage of lorKeyDistinguisherOn, plus the Q-query advantage under ideal.

theorem Cslib.Crypto.Encryption.advantage_lorDistinguisher_le {Msg : Type} (real ideal : PMF (List Bool)) (encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)) (Q : ℕ → ℕ) (adversary : LoRAdversaryOf Msg) (security : ℕ) :
(distinguishingGame real (lorDistinguisher encrypt Q adversary false security)).advantage (distinguishingGame real (lorDistinguisher encrypt Q adversary true security)) ≤ 2 * (distinguishingGame real (lorKeyDistinguisher encrypt Q adversary security)).advantage (distinguishingGame ideal (lorKeyDistinguisher encrypt Q adversary security)) + (distinguishingGame ideal (lorDistinguisher encrypt Q adversary false security)).advantage (distinguishingGame ideal (lorDistinguisher encrypt Q adversary true security))

Replacing the public-key law real with ideal in the unrestricted Q-query left-or-right experiment costs at most twice the distinguishing advantage of lorKeyDistinguisher, plus the Q-query advantage under ideal.

theorem Cslib.Crypto.Encryption.isPPTOn_lorRunOn {Msg α : Type} {input : α ↪ List Bool} {encMsg : Msg ↪ List Bool} {valid : ℕ → List Bool → Msg → Msg → Bool} {encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)} {adversary : LoRAdversaryOf Msg} {security : α → ℕ} {pk : α → List Bool} {bit : α → Bool} {count : α → ℕ} {initial : α → List Bool × List (List Bool)} (hvalid : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × List Bool × Msg × Msg) => match x with | (n, k, m₀, m₁) => valid n k m₀ m₁) (encChallengePairInput encMsg) Turing.MultiTapeTM.encBool) (hencrypt : Probability.IsPPTOn (encKeyedInput encMsg) Turing.MultiTapeTM.encBits fun (x : ℕ × List Bool × Msg) => match x with | (n, k, msg) => encrypt n k msg) (hadversary : LoRAdversaryOf.IsPPT encMsg adversary) (hsecurity : Turing.MultiTapeTM.ComputableInPolyTime security input Turing.MultiTapeTM.encUnary) (hpk : Turing.MultiTapeTM.ComputableInPolyTime pk input Turing.MultiTapeTM.encBits) (hbit : Turing.MultiTapeTM.ComputableInPolyTime bit input Turing.MultiTapeTM.encBool) (hcount : Turing.MultiTapeTM.ComputableInPolyTime count input Turing.MultiTapeTM.encUnary) (hinitial : Turing.MultiTapeTM.ComputableInPolyTime initial input encLoRLoopState) :
Probability.IsPPTOn input encLoRLoopState fun (a : α) => lorRunOn valid encrypt adversary (security a) (pk a) (bit a) (count a) (initial a)

Parameterized uniform strict PPT certificate for the adaptive query loop lorRunOn with a polynomial-time iteration count and initial loop state, under the hypotheses of isPPTOn_lorDistinguisherOn.

theorem Cslib.Crypto.Encryption.isPPTOn_lorDistinguisherOn {Msg α : Type} {input : α ↪ List Bool} {encMsg : Msg ↪ List Bool} {valid : ℕ → List Bool → Msg → Msg → Bool} {encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)} {Q : ℕ → ℕ} {adversary : LoRAdversaryOf Msg} {security : α → ℕ} {pk : α → List Bool} {bit : α → Bool} (hvalid : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × List Bool × Msg × Msg) => match x with | (n, k, m₀, m₁) => valid n k m₀ m₁) (encChallengePairInput encMsg) Turing.MultiTapeTM.encBool) (hencrypt : Probability.IsPPTOn (encKeyedInput encMsg) Turing.MultiTapeTM.encBits fun (x : ℕ × List Bool × Msg) => match x with | (n, k, msg) => encrypt n k msg) (hQ : Turing.MultiTapeTM.ComputableInPolyTime Q Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hadversary : LoRAdversaryOf.IsPPT encMsg adversary) (hsecurity : Turing.MultiTapeTM.ComputableInPolyTime security input Turing.MultiTapeTM.encUnary) (hpk : Turing.MultiTapeTM.ComputableInPolyTime pk input Turing.MultiTapeTM.encBits) (hbit : Turing.MultiTapeTM.ComputableInPolyTime bit input Turing.MultiTapeTM.encBool) :
Probability.IsPPTOn input Turing.MultiTapeTM.encBool fun (a : α) => lorDistinguisherOn valid encrypt Q adversary (bit a) (security a) (pk a)

Parameterized uniform strict PPT certificate for lorDistinguisherOn when valid is computable in polynomial time, encryption is strict PPT, Q is computable in polynomial time, and the adversary satisfies LoRAdversaryOf.IsPPT.

theorem Cslib.Crypto.Encryption.isPPTOn_lorDistinguisher {Msg α : Type} {input : α ↪ List Bool} {encMsg : Msg ↪ List Bool} {encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)} {Q : ℕ → ℕ} {adversary : LoRAdversaryOf Msg} {security : α → ℕ} {pk : α → List Bool} {bit : α → Bool} (hencrypt : Probability.IsPPTOn (encKeyedInput encMsg) Turing.MultiTapeTM.encBits fun (x : ℕ × List Bool × Msg) => match x with | (n, k, msg) => encrypt n k msg) (hQ : Turing.MultiTapeTM.ComputableInPolyTime Q Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hadversary : LoRAdversaryOf.IsPPT encMsg adversary) (hsecurity : Turing.MultiTapeTM.ComputableInPolyTime security input Turing.MultiTapeTM.encUnary) (hpk : Turing.MultiTapeTM.ComputableInPolyTime pk input Turing.MultiTapeTM.encBits) (hbit : Turing.MultiTapeTM.ComputableInPolyTime bit input Turing.MultiTapeTM.encBool) :
Probability.IsPPTOn input Turing.MultiTapeTM.encBool fun (a : α) => lorDistinguisher encrypt Q adversary (bit a) (security a) (pk a)

Parameterized uniform strict PPT certificate for the unrestricted lorDistinguisher.

theorem Cslib.Crypto.Encryption.isPPT_lorDistinguisherOn {Msg : Type} {encMsg : Msg ↪ List Bool} {valid : ℕ → List Bool → Msg → Msg → Bool} {encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)} {Q : ℕ → ℕ} {adversary : LoRAdversaryOf Msg} (hvalid : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × List Bool × Msg × Msg) => match x with | (n, k, m₀, m₁) => valid n k m₀ m₁) (encChallengePairInput encMsg) Turing.MultiTapeTM.encBool) (hencrypt : Probability.IsPPTOn (encKeyedInput encMsg) Turing.MultiTapeTM.encBits fun (x : ℕ × List Bool × Msg) => match x with | (n, k, msg) => encrypt n k msg) (hQ : Turing.MultiTapeTM.ComputableInPolyTime Q Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hadversary : LoRAdversaryOf.IsPPT encMsg adversary) (bit : Bool) :

lorDistinguisherOn is one uniform strict PPT distinguisher when valid is computable in polynomial time, encryption is strict PPT, Q is computable in polynomial time, and the adversary satisfies LoRAdversaryOf.IsPPT.

theorem Cslib.Crypto.Encryption.isPPT_lorDistinguisher {Msg : Type} {encMsg : Msg ↪ List Bool} {encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)} {Q : ℕ → ℕ} {adversary : LoRAdversaryOf Msg} (hencrypt : Probability.IsPPTOn (encKeyedInput encMsg) Turing.MultiTapeTM.encBits fun (x : ℕ × List Bool × Msg) => match x with | (n, k, msg) => encrypt n k msg) (hQ : Turing.MultiTapeTM.ComputableInPolyTime Q Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hadversary : LoRAdversaryOf.IsPPT encMsg adversary) (bit : Bool) :

lorDistinguisher is one uniform strict PPT distinguisher when encryption is strict PPT, Q is computable in polynomial time, and the adversary satisfies LoRAdversaryOf.IsPPT.

theorem Cslib.Crypto.Encryption.isPPT_lorKeyDistinguisherOn {Msg : Type} {encMsg : Msg ↪ List Bool} {valid : ℕ → List Bool → Msg → Msg → Bool} {encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)} {Q : ℕ → ℕ} {adversary : LoRAdversaryOf Msg} (hvalid : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × List Bool × Msg × Msg) => match x with | (n, k, m₀, m₁) => valid n k m₀ m₁) (encChallengePairInput encMsg) Turing.MultiTapeTM.encBool) (hencrypt : Probability.IsPPTOn (encKeyedInput encMsg) Turing.MultiTapeTM.encBits fun (x : ℕ × List Bool × Msg) => match x with | (n, k, msg) => encrypt n k msg) (hQ : Turing.MultiTapeTM.ComputableInPolyTime Q Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hadversary : LoRAdversaryOf.IsPPT encMsg adversary) :

The hidden-bit reduction lorKeyDistinguisherOn is one uniform strict PPT distinguisher when valid is computable in polynomial time, encryption is strict PPT, Q is computable in polynomial time, and the adversary satisfies LoRAdversaryOf.IsPPT.

theorem Cslib.Crypto.Encryption.isPPT_lorKeyDistinguisher {Msg : Type} {encMsg : Msg ↪ List Bool} {encrypt : ℕ → List Bool → Msg → ProbComp (List Bool)} {Q : ℕ → ℕ} {adversary : LoRAdversaryOf Msg} (hencrypt : Probability.IsPPTOn (encKeyedInput encMsg) Turing.MultiTapeTM.encBits fun (x : ℕ × List Bool × Msg) => match x with | (n, k, msg) => encrypt n k msg) (hQ : Turing.MultiTapeTM.ComputableInPolyTime Q Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hadversary : LoRAdversaryOf.IsPPT encMsg adversary) :

The unrestricted hidden-bit reduction lorKeyDistinguisher is one uniform strict PPT distinguisher when encryption is strict PPT, Q is computable in polynomial time, and the adversary satisfies LoRAdversaryOf.IsPPT.