Documentation

Cslib.Crypto.Protocols.Commitment.Scheme

Commitment Schemes: Syntax and Correctness #

The syntax of a commitment scheme ([BS23], Section 8.12): committing to a message samples a commitment-opening pair (c, o), verification of a claimed opening is deterministic, and honestly generated pairs always verify.

The algorithms are plain functions, with no efficiency or finiteness assumptions. Security notions live in separate definitions, so the same syntax can carry perfect, statistical, or computational security.

Main definitions #

References #

structure Cslib.Crypto.Protocols.Commitment.Scheme (Message : Type u_1) (Commitment : Type u_2) (Opening : Type u_3) :
Type (max (max u_1 u_2) u_3)

A noninteractive, unkeyed commitment scheme over message, commitment, and opening types ([BS23], Section 8.12).

Committing is randomized and produces the commitment and opening together, since the two may be correlated. Correctness requires that every commitment-opening pair the honest committer can output is accepted by the verifier; for a PMF, this says honest openings verify with probability one.

  • commit (message : Message) : PMF (Commitment × Opening)

    Randomized commitment and opening generation.

  • verify (message : Message) (commitment : Commitment) (opening : Opening) : Bool

    Deterministic verification of a claimed opening.

  • correct (message : Message) (commitment : Commitment) (opening : Opening) : (commitment, opening) (self.commit message).supportself.verify message commitment opening = true

    Every honestly generated commitment-opening pair verifies.

Instances For
    noncomputable def Cslib.Crypto.Protocols.Commitment.Scheme.commitmentDist {Message : Type u_1} {Commitment : Type u_2} {Opening : Type u_3} (scheme : Scheme Message Commitment Opening) (message : Message) :
    PMF Commitment

    The public commitment distribution obtained by forgetting the opening.

    Equations
    Instances For
      theorem Cslib.Crypto.Protocols.Commitment.Scheme.mem_support_commitmentDist_iff {Message : Type u_1} {Commitment : Type u_2} {Opening : Type u_3} (scheme : Scheme Message Commitment Opening) {message : Message} {commitment : Commitment} :
      commitment (scheme.commitmentDist message).support ∃ (opening : Opening), (commitment, opening) (scheme.commit message).support

      A commitment lies in the public distribution's support exactly when some opening makes the corresponding pair an honest possible output.

      def Cslib.Crypto.Protocols.Commitment.Scheme.Accepts {Message : Type u_1} {Commitment : Type u_2} {Opening : Type u_3} (scheme : Scheme Message Commitment Opening) (message : Message) (commitment : Commitment) (opening : Opening) :

      The proposition that an opening is accepted for a commitment and message.

      Equations
      Instances For
        theorem Cslib.Crypto.Protocols.Commitment.Scheme.accepts_of_mem_support {Message : Type u_1} {Commitment : Type u_2} {Opening : Type u_3} (scheme : Scheme Message Commitment Opening) {message : Message} {commitment : Commitment} {opening : Opening} (h : (commitment, opening) (scheme.commit message).support) :
        scheme.Accepts message commitment opening

        Every pair in the support of an honest commitment is accepted.

        noncomputable def Cslib.Crypto.Protocols.Commitment.Scheme.ofPure {Message : Type u_1} {Commitment : Type u_2} {Opening : Type u_3} (commit : MessageCommitment × Opening) (verify : MessageCommitmentOpeningBool) (correct : ∀ (message : Message), verify message (commit message).1 (commit message).2 = true) :
        Scheme Message Commitment Opening

        Build a commitment scheme from a deterministic commitment generation.

        Equations
        Instances For