Documentation

CatCryptCore.Examples.ChaumPedersen

Chaum-Pedersen Protocol: Equality of Discrete Logarithms #

The Chaum-Pedersen protocol is a Sigma protocol for proving equality of discrete logarithms. Given generators g and h of a cyclic group of prime order, the prover demonstrates knowledge of x such that u = g^x AND v = h^x, thereby proving that u and v share the same discrete logarithm with respect to g and h respectively, without revealing the exponent.

Protocol #

Security properties #

References #

Chaum-Pedersen Protocol Types #

@[reducible, inline]

Chaum-Pedersen statement: (g, h, u, v).

Equations
Instances For
    @[reducible, inline]

    Chaum-Pedersen witness: the common exponent x.

    Equations
    Instances For
      @[reducible, inline]

      Chaum-Pedersen commitment message: (r, groupExp g r, groupExp h r).

      Equations
      Instances For
        @[reducible, inline]

        Chaum-Pedersen challenge: a random scalar.

        Equations
        Instances For
          @[reducible, inline]

          Chaum-Pedersen response: z = r + e*x.

          Equations
          Instances For

            Chaum-Pedersen Relation #

            The equality-of-discrete-logs relation: R((g, h, u, v), x) <=> u = groupExp g x /\ v = groupExp h x.

            Equations
            Instances For

              Chaum-Pedersen Protocol Algorithms #

              Chaum-Pedersen commitment: sample random r, return (r, groupExp g r, groupExp h r).

              Equations
              Instances For

                Chaum-Pedersen response: compute z = r + e*x.

                Equations
                Instances For

                  Chaum-Pedersen verification.

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

                    Chaum-Pedersen simulator.

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

                      Chaum-Pedersen extractor.

                      Equations
                      Instances For

                        Sigma Protocol Instance #

                        @[implicit_reducible]

                        Chaum-Pedersen identification as a Sigma protocol.

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

                          Visible Transcript Equality #

                          Visible transcript equality for Chaum-Pedersen: compares only the externally visible parts (a1, a2, e, z), excluding the internal randomness r.

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

                            Helper lemmas #

                            groupExp distributes: groupExp g (scalarAdd a b) = groupMul (groupExp g a) (groupExp g b).

                            groupInv of groupExp: groupInv (groupExp g e) = groupExp g (scalarNeg e).

                            groupExp composed: groupExp (groupExp g w) e = groupExp g (scalarMul w e). Proved via exp_surj + groupExp_exp + scalarMul_assoc.

                            Completeness #

                            theorem CatCryptCore.Examples.ChaumPedersen.chaumPedersen_complete (gp : CatCrypt.Examples.GroupParam) (stmt : CPStatement gp) (w : CPWitness gp) (hrel : cpRelation gp stmt w) (r : gp.Scalar) (e : CPChallenge gp) :
                            have msg := (r, gp.groupExp stmt.1 r, gp.groupExp stmt.2.1 r); have z := gp.scalarAdd r (gp.scalarMul e w); cpVerify gp stmt msg e z = true

                            Completeness for Chaum-Pedersen: honest execution always verifies.

                            Commitment recovery lemma #

                            theorem CatCryptCore.Examples.ChaumPedersen.commitment_recovery (gp : CatCrypt.Examples.GroupParam) (g u : gp.G) (w r z e : gp.Scalar) (hu : u = gp.groupExp g w) (hz : z = gp.scalarAdd r (gp.scalarMul e w)) :
                            gp.groupExp g r = gp.groupMul (gp.groupExp g z) (gp.groupInv (gp.groupExp u e))

                            The key algebraic identity: groupExp g r = groupMul (groupExp g z) (groupInv (groupExp u e)) when u = groupExp g w and z = r + e*w.

                            Cancellation helper for special soundness #

                            Cancellation: (ka + t1) + (-ka + -t2) = t1 + (-t2).

                            Division distributes: scalarDiv (scalarMul k x) y = scalarMul k (scalarDiv x y).

                            SHVZK #

                            Special Soundness #

                            Visible Transcript and UC Security #

                            The internal CPMessage includes the randomness r for threading between commit and respond. The visible transcript (what the adversary sees) projects out r, keeping only the group elements (a1, a2), the challenge e, and the response z. UC security is stated over these visible transcripts.

                            @[reducible, inline]

                            Visible Chaum-Pedersen transcript: (a1, a2, challenge, response).

                            Equations
                            Instances For

                              Real visible transcript computation.

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

                                Simulated visible transcript computation.

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

                                  UC specification for visible Chaum-Pedersen transcripts.

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

                                    The real and simulated visible transcript computations are equal.

                                    After projecting out the internal randomness r, the bijection r ↦ z = r + e*w shows that the visible parts (g^r, h^r, e, z) of the real transcript and (g^z * u^{-e}, h^z * v^{-e}, e, z) of the simulated transcript have the same distribution, since both visible commitments equal g^r (resp. h^r) when u = g^w, v = h^w.

                                    theorem CatCryptCore.Examples.ChaumPedersen.chaumPedersen_uc_secure (gp : CatCrypt.Examples.GroupParam) (V : Type) (stmt : CPStatement gp) (w : CPWitness gp) (hrel : cpRelation gp stmt w) :
                                    CatCrypt.Crypto.UCEmulates 0 (cpSpec gp V) (fun (x : (cpSpec gp V).hon) => cpReal gp stmt w) fun (x : (cpSpec gp V).hon) => cpIdeal gp stmt

                                    The Chaum-Pedersen protocol is perfectly UC-secure: UCEmulates 0.