Documentation

Complexity.Crypto.Computational.Homomorphic.KeyChain.Hybrid

Hybrids for an acyclic encrypted-key chain #

The link hybrid retains real secret-key encryptions before a boundary and encrypts zero words after it. Moving the boundary towards the initial key erases links from the end of the chain. This order is essential: when a reduction embeds a challenge public key, the outgoing link that would contain its unknown secret has already been replaced by an encryption of zeros.

These are actual sampling programs and exact distributional identities. They do not assume or establish computational indistinguishability on their own.

Main definitions #

Main results #

References #

theorem Cslib.Crypto.Homomorphic.Scheme.eval_generateKeys_splice (E : Scheme) (n beforeCount afterCount : ℕ) :
(do let next ← E.keyGen n let before ← OracleComp.replicate beforeCount (E.keyGen n) let predecessor ← E.keyGen n let after ← OracleComp.replicate afterCount (E.keyGen n) pure (before ++ predecessor :: next :: after)).eval = (E.generateKeys n (beforeCount + afterCount + 1)).eval

Draw the target key first, then independently draw the keys before and after its predecessor. Splicing them restores the complete original key-generation distribution.

Encrypt real secrets in the first cut links, and zero words in the remaining links. The two key segments overlap at their boundary key; each link is sampled exactly once.

Instances For
    @[simp]

    A boundary at zero erases every secret-key plaintext.

    A boundary after the last link also retains every original link.

    Sample the independent keys and a link hybrid, returning only public data.

    Instances For

      The final boundary is the exact public marginal of the original key-chain sampler.

      theorem Cslib.Crypto.Homomorphic.Scheme.publicKeyChainHybrid_zero (E : Scheme) (n depth : ℕ) :
      E.publicKeyChainHybrid n depth 0 = do let keys ← E.generateKeys n depth let links ← E.encryptZeroKeyLinks n keys pure (List.map Prod.fst keys, links)

      The initial boundary samples the same public keys with zero plaintexts in every link.

      def Cslib.Crypto.Homomorphic.Scheme.encryptKeyLinkHybrid (E : Scheme) (n : ℕ) (before : List (List Bool × List Bool)) (predecessor next : List Bool × List Bool) (after : List (List Bool × List Bool)) (cut : ℕ) :

      Refine the boundary link bit by bit, leaving earlier links real and later links zeroed. predecessor is the key whose secret is encrypted under next.1.

      Instances For
        theorem Cslib.Crypto.Homomorphic.Scheme.encryptKeyLinkHybrid_zero (E : Scheme) (n : ℕ) (before : List (List Bool × List Bool)) (predecessor next : List Bool × List Bool) (after : List (List Bool × List Bool)) :
        E.encryptKeyLinkHybrid n before predecessor next after 0 = E.encryptKeyLinksHybrid n (before.length + 1) (before ++ predecessor :: next :: after)

        Before erasing any bit, the boundary link is still real.

        theorem Cslib.Crypto.Homomorphic.Scheme.encryptKeyLinkHybrid_length (E : Scheme) (n : ℕ) (before : List (List Bool × List Bool)) (predecessor next : List Bool × List Bool) (after : List (List Bool × List Bool)) :
        E.encryptKeyLinkHybrid n before predecessor next after predecessor.2.length = E.encryptKeyLinksHybrid n before.length (before ++ predecessor :: next :: after)

        After erasing every bit, the boundary link is part of the zeroed suffix.

        theorem Cslib.Crypto.Homomorphic.Scheme.encryptKeyLinkHybrid_secret_congr (E : Scheme) (n : ℕ) (before : List (List Bool × List Bool)) (predecessor : List Bool × List Bool) (pk secret replacement : List Bool) (after : List (List Bool × List Bool)) (cut : ℕ) (hlength : secret.length = replacement.length) :
        E.encryptKeyLinkHybrid n before predecessor (pk, secret) after cut = E.encryptKeyLinkHybrid n before predecessor (pk, replacement) after cut

        Once its outgoing link is zeroed, replacing the target key's secret by an equal-length word does not change the intermediate sampler. Its public key is retained.

        Sample an intermediate bit hybrid with the target key drawn first. Only public keys and encrypted links are returned. This sampling order matches the single-challenge reduction.

        Instances For
          theorem Cslib.Crypto.Homomorphic.Scheme.eval_publicKeyLinkHybrid_zero (E : Scheme) (n beforeCount afterCount : ℕ) :
          (E.publicKeyLinkHybrid n beforeCount afterCount 0).eval = (E.publicKeyChainHybrid n (beforeCount + afterCount + 1) (beforeCount + 1)).eval

          The initial bit boundary is the corresponding real-link boundary in the original key sampling order. This is an equality of complete public distributions.

          theorem Cslib.Crypto.Homomorphic.Scheme.eval_publicKeyLinkHybrid_length (E : Scheme) (n beforeCount afterCount width : ℕ) (hwidth : ∀ keys ∈ (E.keyGen n).eval.support, keys.2.length = width) :
          (E.publicKeyLinkHybrid n beforeCount afterCount width).eval = (E.publicKeyChainHybrid n (beforeCount + afterCount + 1) beforeCount).eval

          With a fixed supported secret length, the final bit boundary is the preceding link boundary. No efficiency or ciphertext-width assumption is needed for this exact law.