Documentation

CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.WordReduction

The certified IND-CPA reductions of the word-level Fujisaki–Okamoto families #

The IND-CCA bounds of CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.NotBot and …Bot reduce to the two-stage IND-CPA advantage of one explicit adversary, Scheme.romFilterCpaReduction. This module gives that reduction for the word-level family WordPKE of CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.Word as a chosen-message adversary of Encryption.gameOn, and proves that it is uniform strict PPT whenever the adversary it wraps is uniform strict oracle PPT.

Adversaries. A word-level ROM IND-CCA adversary is a program A : ℕ → List Bool → WordOracleComp CCAOp Bool. At parameter n it receives the challenge word Encryption.encKEMChallenge (pk, k*, c*), the layout of the word-level KEM distinguishers of Encryption.KEMINDCPA, and calls the oracles G, H and decapsulation (CCAOp). Its efficiency is IsOraclePPT encBool A.

The simulator. WordPKE.simFilterWordHandler d answers the adversary without the secret key. A request in the domain is answered by the typed keyless simulator Scheme.simFilterHandler of the bundle WordPKE.scheme P keyLen n, on the same state SimState; a decapsulation answer is encoded with encOption encBits. The domain is: messages of length msgLen n for G; for H, the canonical encodings encHQuery (false, m, c) of a message m of length msgLen n and a ciphertext c of length at most ctLen n (WordPKE.isHQuery); and ciphertexts of length at most ctLen n for decapsulation. Any other request gets the empty reply and leaves the state unchanged. The filter d n pk gCache c decides which decapsulation queries are answered. Every query is answered for FO-notbot (WordPKE.romCpaReductionWord). For FO^⊥ (WordPKE.romBotCpaReductionWord) the filter is Scheme.simBotCheck, which answers a query only when a cached G query re-encrypts to it under encDet n pk.

The reduction. WordPKE.romFilterCpaReductionWord d A mirrors Scheme.romFilterCpaReduction. Its first stage draws m₀, m₁ uniformly of length msgLen n and saves the public key with m₁. Its second stage draws the challenge key k* of length keyLen n, runs A against the simulator from empty caches (WordPKE.simFilterWordHit) and reports whether m₁ was queried to G.

The certificate. WordPKE.IsEfficient.isPPT_romFilterCpaReductionWord derives Encryption.AdversaryOf.IsPPT of the reduction from IsOraclePPT encBool A, the efficiency of the PKE family (WordPKE.IsEfficient), a polynomial-time key length and a polynomial-time filter; the FO^⊥ filter is polynomial-time whenever encryption is. The simulator is substituted into A with IsOraclePPT.run_interpret_preprocess. Each call is strict PPT in the full state (WordPKE.IsEfficient.isPPTOn_simFilterWordHandler), keeps every cached value at most coinLen n + keyLen n bits long, and adds at most a polynomial in the request length and n to the encoded state.

The advantages of the two instances are the typed cpaAdvantage of Scheme.romCpaReduction and Scheme.romBotCpaReduction on a typed view of A (WordPKE.IsEfficient.exists_typedAdversary in CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.WordBridge), and the asymptotic IND-CCA theorems WordPKE.INDCPA.romINDCCA and WordPKE.INDCPA.romINDCCABot in CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.WordSecurity apply the IND-CPA assumption to them.

Main definitions #

Main results #

References #

Oracle operations of a word-level ROM IND-CCA adversary against an FO key encapsulation mechanism: the random oracles G and H, and decapsulation.

  • G : CCAOp

    Query the coin-derivation oracle G.

  • H : CCAOp

    Query the key-derivation oracle H.

  • decaps : CCAOp

    Query the decapsulation oracle.

Instances For
    theorem Cslib.Crypto.Protocols.FujisakiOkamoto.encSimState_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List (List Bool × List Bool)} {T0 S0 : γ → ℕ} {x1 : γ → List ((Bool × List Bool × List Bool) × List Bool)} {T1 S1 : γ → ℕ} {x2 : γ → List (List Bool × List Bool)} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn (Probability.encMemoCache Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Probability.encMemoCache encHQuery Turing.MultiTapeTM.encBits) T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn (Probability.encMemoCache Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) T2 S2) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { gCache := x0 x, hCache := x1 x, hqCache := x2 x }) encIn encSimState (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)

    The state of the native keyless simulator: the caches of SimState over words, each an association list.

    @[reducible, inline]

    The input ((1ⁿ, pk, cStar), (op, w), st) of one call of the native simulator: the parameter, the public key and the challenge ciphertext, then the request and the simulator state.

    @[reducible, inline]

    The input (1ⁿ, pk, gCache, c) of a decapsulation filter of the native simulator: the parameter in unary, then the public key, the cached G queries and the ciphertext.

    Whether the H request w is in the domain at parameter n: it is the canonical encoding of (false, m, c) with m of length msgLen n and c of length at most ctLen n.

    noncomputable def Cslib.Crypto.Protocols.FujisakiOkamoto.WordPKE.simFilterWordHandler (P : WordPKE) (keyLen : ℕ → ℕ) (d : ℕ → List Bool → List (List Bool × List Bool) → List Bool → Bool) (n : ℕ) (pk cStar : List Bool) (request : CCAOp × List Bool) :

    The native keyless simulator with decapsulation filter d at parameter n, for public key pk and challenge ciphertext cStar. A request in the domain is answered by the typed simulator Scheme.simFilterHandler of the bundle scheme P keyLen n, on the same state; a decapsulation answer is encoded with encOption encBits. A request outside the domain gets the empty reply and leaves the state unchanged: a G request that is not a message of length msgLen n, an H request that fails isHQuery, and a decapsulation request longer than ctLen n.

    noncomputable def Cslib.Crypto.Protocols.FujisakiOkamoto.WordPKE.simFilterWordHit (P : WordPKE) (keyLen : ℕ → ℕ) (d : ℕ → List Bool → List (List Bool × List Bool) → List Bool → Bool) (A : ℕ → List Bool → Probability.WordOracleComp CCAOp Bool) (n : ℕ) (pk m cStar kStar : List Bool) :

    The native keyless simulator run inside the reduction: draw nothing, run the word adversary A at parameter n on the challenge (pk, kStar, cStar) against simFilterWordHandler d from empty caches, and report whether the target m was queried to G.

    The native IND-CPA reduction of the FO proofs with decapsulation filter d, for a word adversary A, as a chosen-message adversary of Encryption.gameOn. The first stage draws both challenge messages of length msgLen n and saves the public key with m₁. The second stage draws the challenge key kStar of length keyLen n and runs simFilterWordHit, which reports whether m₁ was queried to G. It is the word-level counterpart of Scheme.romFilterCpaReduction.

    The native IND-CPA reduction for FO-notbot: romFilterCpaReductionWord with every decapsulation query answered, the word-level counterpart of Scheme.romCpaReduction.

    The native IND-CPA reduction for FO^⊥: romFilterCpaReductionWord with the FO^⊥ filter simBotCheck, which answers a decapsulation query only when some cached G query (m, r) re-encrypts to it under encDet n pk. It is the word-level counterpart of Scheme.romBotCpaReduction.

    Certificates #

    The native simulator is uniform strict PPT on one call ((1ⁿ, pk, cStar), (op, w), st), charging the complete state, whenever the PKE family and the decapsulation filter are efficient.

    Resource bounds of one simulator call #

    The reduction is uniform strict PPT. For an efficient PKE family, a polynomial-time key length and an efficient decapsulation filter, the word-level IND-CPA reduction of every uniform strict oracle PPT ROM IND-CCA adversary is a uniform strict PPT chosen-message adversary. The certificate covers the lazy G/H simulation and the simulated decapsulation oracle.

    The FO^⊥ reduction is uniform strict PPT. For an efficient PKE family and a polynomial-time key length, the word-level IND-CPA reduction romBotCpaReductionWord A of every uniform strict oracle PPT ROM IND-CCA adversary A is a uniform strict PPT chosen-message adversary.

    The FO-notbot reduction is uniform strict PPT. For an efficient PKE family and a polynomial-time key length, the word-level IND-CPA reduction romCpaReductionWord A of every uniform strict oracle PPT ROM IND-CCA adversary A is a uniform strict PPT chosen-message adversary.