Documentation

CatCryptCore.Crypto.Assumptions.CDH

Computational Diffie-Hellman (CDH) Assumption #

The CDH assumption: given (g^a, g^b), compute the shared secret g^{ab}. This is the computational analogue of DDH; DDH ⟹ CDH but not vice versa.

Main definitions #

Cross-Validation #

PropertyThis fileTextbook
Challenge(g^a, g^b)Boneh-Shoup Def. 11.1
TargetCompute ecdh(a, g^b) = g^{ab}Compute g^{ab}
GroupDDHDef WCyclic group of prime order
CDH ⟹ DLcdh_of_dl_ddhBS Prop. 11.4

Equivalent formalizations:

Relationship to other assumptions:

See also CDH_DL.lean for the CDH ⟹ DL reduction over PairingGroup.

References #

CDH Game #

@[reducible, inline]

CDH adversary: given (g^a, g^b), attempts to compute the shared secret ecdh(a, g^b) = g^{ab}.

Equations
Instances For

    CDH game: sample key pairs (a, g^a) and (b, g^b), give (g^a, g^b) to adversary, check if output equals ecdh(a, g^b).

    Returns true if the adversary computes the correct shared secret.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      CDH advantage: probability that the adversary computes g^{ab}.

      Equations
      Instances For

        CDH hardness: all adversaries have bounded advantage.

        Equations
        Instances For

          Reduction: DDH ⟹ CDH #

          If an adversary can compute g^{ab} (break CDH), it can also distinguish (g^a, g^b, g^{ab}) from (g^a, g^b, random) (break DDH), by computing the answer and comparing.

          Construct a DDH adversary from a CDH adversary: compute the alleged shared secret and check if it matches the challenge.

          Equations
          Instances For

            IsPure Proofs #

            theorem CatCrypt.Crypto.Assumptions.CDH_Game_isPure {W : Type} [SampleableType W] [DecidableEq W] (D : DDHDef W) (A : CDH_Adversary W) (hA : ∀ (x y : W), (A x y).IsPure) :

            Reduction: CDH ⟹ DL (abstract DDHDef setting) #

            The standard direction: CDH hard implies DL hard (BS Prop. 11.4). Equivalently, by contrapositive: if you can solve DL (find private keys from public keys), you can solve CDH.

            In the abstract DDHDef setting, a "discrete log adversary" receives a public key g^a and returns a private key a' such that the corresponding public key matches. We define this via keygen's structure: the adversary must recover the private component from the public component.

            Reduction. Given a DL adversary that finds a from g^a:

            1. Receive CDH challenge (g^a, g^b)
            2. Run the DL adversary on g^a to recover a
            3. Compute ecdh(a, g^b) = g^{ab}

            This gives a CDH adversary whose advantage equals the DL advantage.

            @[reducible, inline]

            DL adversary over abstract DDHDef: given a public key g^a, attempts to find the corresponding private key a.

            Equations
            Instances For

              DL game over abstract DDHDef: sample a key pair (a, g^a), give g^a to the adversary, check if the adversary's output a' yields the same public key (i.e., ecdh(a', G) = g^a conceptually, but since we only have ecdh : W → W → W, we check that the adversary can reproduce the DH shared secret).

              Concretely: sample (a, g^a) and (b, g^b), give g^a to the adversary to get a', then check ecdh(a', g^b) = ecdh(a, g^b).

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Construct a CDH adversary from a DL adversary.

                Given a DL adversary that finds private keys from public keys:

                1. Receive (g^a, g^b)
                2. Run the DL adversary on g^a to get candidate private key a'
                3. Compute ecdh(a', g^b) as the alleged shared secret
                Equations
                Instances For

                  CDH ⟹ DL bound: any DL adversary yields a CDH adversary with at least as much advantage.

                  CDH_Advantage D (cdh_of_dl_ddh D A_dl) ≥ DL_Advantage_DDH D A_dl

                  Equivalently (for the standard "hardness implies hardness" direction): DL_Advantage_DDH D A_dl ≤ CDH_Advantage D (cdh_of_dl_ddh D A_dl)

                  Corollary: CDH security implies DL security.

                  If D is ε-CDH-secure, then for any DL adversary, the DL advantage is at most ε.