Documentation

CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto.Word

Word-level Fujisaki–Okamoto family with native honest algorithms #

The Fujisaki–Okamoto transforms FO^⊥ and FO-notbot of CslibFrontier.Crypto.Protocols.KEM.FujisakiOkamoto act on one fixed explicit-coin scheme. This module states them for a security-parameter family of schemes over words, and proves that the honest algorithms are uniform strict (oracle) PPT whenever the underlying public-key encryption family is.

WordPKE is a public-key encryption family with explicit coins ([HHK17], IACR ePrint 2017/604, full version dated 2 November 2021, §2.1): at parameter n, messages are words of length msgLen n, coins are uniform words of length coinLen n, and the ciphertext space is the words of length at most ctLen n. Key generation is randomized; deterministic encryption and decryption are functions of the parameter and their word arguments. WordPKE.IsEfficient asks for strict PPT key generation and polynomial-time encryption, decryption and lengths. WordPKE.CiphertextFits says that encryption under generated keys stays in the ciphertext space, and WordPKE.INDCPA is IND-CPA security of randomized encryption WordPKE.encrypt with challenge messages in the message space.

At each parameter, WordPKE.scheme P keyLen n is the FO parameter bundle Scheme over words, with uniform messages, coins and keyLen n-bit keys. Its decryption reports only results of message length. The native algorithms query two word oracles G and H (RO), reading at most coinLen n bits of each G reply and keyLen n bits of each H reply:

The wire encoding of the pair (m, c) is encHQuery (false, m, c). On rejection the same encoding carries the secret seed in place of the decrypted message.

Deviations from [HHK17] #

Main definitions #

Main results #

References #

A word-level public-key encryption family with explicit coins ([HHK17], ePrint 2017/604 (2 Nov 2021), §2.1). At parameter n, messages are words of length msgLen n, encryption coins are uniform words of length coinLen n, and the ciphertext space is the words of length at most ctLen n.

@[reducible, inline]

The input (1ⁿ, pk, m, r) of deterministic encryption: the parameter in unary, then the public key, the message and the coins as framed words.

Efficiency of a word-level PKE family: polynomial-time lengths, uniform strict PPT key generation, and polynomial-time deterministic encryption and decryption.

Randomized encryption: draw uniform coins r of length coinLen n and output encDet n pk m r. The IND-CPA security of the family is stated for this algorithm.

The ciphertexts of P lie in its ciphertext space. At every parameter n, encrypting a message of length msgLen n with coins of length coinLen n under a generated public key gives a word of length at most ctLen n. [HHK17] (IACR ePrint 2017/604, full version dated 2 November 2021, §2.1) measures the spreadness of a scheme over its ciphertext space C; WordPKE declares that space as the words of length at most ctLen n, and this predicate says that encryption stays inside it.

The admissible challenge pairs of the IND-CPA game of P at parameter n: two messages of length msgLen n, the message space of P.

IND-CPA security of P ([HHK17], ePrint 2017/604 (2 Nov 2021), §2.1, Def. 2.2 and Figure 4, pp. 9–10): every uniform strict PPT chosen-message adversary has negligible advantage in the single-challenge game of randomized encryption encrypt, with challenge messages in the message space of P. The source defines only the concrete advantage |Pr[b' = b] - 1/2|; here the advantage between the two experiments, which is twice that, is negligible. The source's second stage also receives pk; here the first stage passes on what it needs in its saved state.

The explicit-coin scheme of P at parameter n, over words: coins are uniform words of length coinLen n, and decryption reports only results of length msgLen n.

The FO parameter bundle of P at parameter n, over words: the explicit-coin scheme toExplicitCoin n, uniform messages of length msgLen n and uniform keys of length keyLen n.

The two random oracles of the word-level FO transforms: G derives encryption coins from a message and H derives keys.

  • G : RO

    The coin-derivation oracle G.

  • H : RO

    The key-derivation oracle H.

Instances For
    @[reducible, inline]

    The word of an H query (b, m, c): a Boolean prefix, then the message and the ciphertext as framed words. The word-game domain uses the fixed prefix false.

    Query H on the pair (m, c) and read at most keyLen n bits of the reply.

    theorem Cslib.Crypto.Protocols.FujisakiOkamoto.encImplicitSK_pk_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ImplicitSK (List Bool) (List Bool) (List Bool)} :
    theorem Cslib.Crypto.Protocols.FujisakiOkamoto.encImplicitSK_sk_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ImplicitSK (List Bool) (List Bool) (List Bool)} :

    The encoding of an FO-notbot secret key (sk, pk, s) as three framed words.

    theorem Cslib.Crypto.Protocols.FujisakiOkamoto.encImplicitSK_fallback_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ImplicitSK (List Bool) (List Bool) (List Bool)} :
    theorem Cslib.Crypto.Protocols.FujisakiOkamoto.encImplicitSK_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 x2 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encBits budget) :
    Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { sk := x0 x, pk := x1 x, fallback := x2 x }) encIn encImplicitSK budget
    theorem Cslib.Crypto.Protocols.FujisakiOkamoto.encImplicitSK_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBits T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encBits T2 S2) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { sk := x0 x, pk := x1 x, fallback := x2 x }) encIn encImplicitSK (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
    @[reducible, inline]

    The input (1ⁿ, dk, c) of FO-notbot decapsulation: the parameter in unary, then the secret key and the ciphertext.

    @[reducible, inline]

    The input (1ⁿ, pk, sk, c) of FO^⊥ decapsulation: the parameter in unary, then the public key, the secret key and the ciphertext as framed words.

    Query G on m and read at most coinLen n bits of the reply.

    Native key generation of FO-notbot ([HHK17], ePrint 2017/604 (2 Nov 2021), §3.2.2, Fig. 12): Scheme.keyGenNotBot of the bundle scheme P keyLen n.

    Native encapsulation of FO^⊥ and FO-notbot ([HHK17], ePrint 2017/604 (2 Nov 2021), §3.2.1, Fig. 9 and §3.2.2, Fig. 12): draw a uniform message m of length msgLen n, query r = G(m), encrypt c = encDet n pk m r, query k = H(m, c), and output (c, k).

    Native implicit-rejection decapsulation of FO-notbot ([HHK17], ePrint 2017/604 (2 Nov 2021), §3.2.2, Fig. 12): reject a word longer than ctLen n with none, and otherwise run Scheme.decapsNotBotM of the bundle with the word oracles.

    Native explicit-rejection decapsulation of FO^⊥ ([HHK17], ePrint 2017/604 (2 Nov 2021), §3.2.1, Fig. 9): reject a word longer than ctLen n with none, and otherwise run Scheme.decapsBotM of the bundle with the word oracles.

    Native certificates #

    Randomized encryption is uniform strict PPT on (1ⁿ, pk, m).

    Native FO-notbot decapsulation is uniform strict oracle PPT on (1ⁿ, dk, c), for every pair of external oracles G and H.

    Native FO^⊥ decapsulation is uniform strict oracle PPT on (1ⁿ, pk, sk, c), for every pair of external oracles G and H.