Documentation

CslibFrontier.Crypto.Computational.AuthenticatedKeyExchange.Protocol

Authenticated key exchange: protocol syntax #

An authenticated key exchange (AKE) protocol ([BS23], §21.9, p. 885) specifies a key space—modeled here at security parameter n as all bit strings of length keyLength n—together with algorithms for trusted third party (TTP) initialization, honest and corrupt user registration, online TTP queries, and session key establishment steps.

All runtime values are bit strings (List Bool), and every algorithm carries a uniform strict polynomial-time or IsPPTOn efficiency certificate over explicit structure encodings. Honest registration is modeled as one joint step (registerHonest), whereas corrupt registration and key establishment proceed step by step through explicit TTP and instance states.

A certificate for each call alone is not enough. It admits a TTP that doubles its state on every call, and a TTP that echoes an arbitrarily long request; in both, the work and the replies are not bounded by any polynomial in the security parameter and the number of calls. The book excludes both:

A Protocol therefore carries a size bound sizeBound, computable in polynomial time in unary and so polynomial in n. The bound limits three things:

Every input of a TTP call then has length polynomial in n and the number of earlier calls, and every input of a session step has length polynomial in n. So the TTP runs in time polynomial in n and the number of interactions, as Definition 2.12 requires, and each session step runs in time polynomial in n, as §18.1.1 requires. A certificate that running the whole experiment is PPT is not proved here.

The resulting model differs from the book's, so Protocol.StaticallySecure is a milestone toward Definition 21.1, not that definition:

Main definitions #

References #

Role assigned to an honest user instance to break symmetry ([BS23], §21.9, p. 885).

  • left : Role

    Initiator / left role.

  • right : Role

    Responder / right role.

Instances For
    @[instance_reducible]
    @[instance_reducible]

    Status of a session key establishment instance ([BS23], §21.9, pp. 885–886).

    • running : Phase

      The instance has not yet terminated and still accepts incoming messages.

    • aborted : Phase

      The instance aborted without deriving a session key.

    • finished : Phase

      The instance terminated successfully with a partner identity and session key.

    Instances For
      @[instance_reducible]

      Input to one session key establishment step of an honest user instance.

      • parameter : ℕ

        Unary security parameter n.

      • user : List Bool

        Identity of the honest user owning the instance.

      • longTermKey : List Bool

        Long-term secret key established for user at registration.

      • role : Role

        Symmetry-breaking role of the instance.

      • state : List Bool

        Current local state word of the instance.

      • message : List Bool

        Incoming protocol message word (ignored on a role's initial outgoing flow).

      Instances For
        theorem Cslib.Crypto.AKE.encStepInput_role_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → StepInput} :

        Encoding of StepInput as its fields in declaration order.

        theorem Cslib.Crypto.AKE.encStepInput_state_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → StepInput} :
        theorem Cslib.Crypto.AKE.encStepInput_message_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → StepInput} :
        theorem Cslib.Crypto.AKE.encStepInput_mk_deg :
        Turing.MultiTapeTM.ComputableInDegree (fun (p : ℕ × List Bool × List Bool × Role × List Bool × List Bool) => { parameter := p.1, user := p.2.1, longTermKey := p.2.2.1, role := p.2.2.2.1, state := p.2.2.2.2.1, message := p.2.2.2.2.2 }) encStepInputFields encStepInput 1 1
        theorem Cslib.Crypto.AKE.encStepInput_longTermKey_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → StepInput} :
        theorem Cslib.Crypto.AKE.encStepInput_parameter_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → StepInput} :
        theorem Cslib.Crypto.AKE.encStepInput_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} {x3 : γ → Role} {T3 S3 : γ → ℕ} {x4 : γ → List Bool} {T4 S4 : γ → ℕ} {x5 : γ → List Bool} {T5 S5 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encBits T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn (Turing.MultiTapeTM.encFinEnum Role) T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO x4 encIn Turing.MultiTapeTM.encBits T4 S4) (h5 : Turing.MultiTapeTM.ComputableInO x5 encIn Turing.MultiTapeTM.encBits T5 S5) :
        Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { parameter := x0 x, user := x1 x, longTermKey := x2 x, role := x3 x, state := x4 x, message := x5 x }) encIn encStepInput (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + (T4 x + T5 x))))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + (S4 x + S5 x))))
        theorem Cslib.Crypto.AKE.encStepInput_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 : γ → ℕ} {x1 x2 : γ → List Bool} {x3 : γ → Role} {x4 x5 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encBits budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn (Turing.MultiTapeTM.encFinEnum Role) budget) (h4 : Turing.MultiTapeTM.ComputableInSpace x4 encIn Turing.MultiTapeTM.encBits budget) (h5 : Turing.MultiTapeTM.ComputableInSpace x5 encIn Turing.MultiTapeTM.encBits budget) :
        Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { parameter := x0 x, user := x1 x, longTermKey := x2 x, role := x3 x, state := x4 x, message := x5 x }) encIn encStepInput budget
        theorem Cslib.Crypto.AKE.encStepInput_user_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → StepInput} :

        Output of one session key establishment step of an honest user instance.

        Instances For
          theorem Cslib.Crypto.AKE.encStepOutput_partner_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → StepOutput} :
          theorem Cslib.Crypto.AKE.encStepOutput_state_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → StepOutput} :
          theorem Cslib.Crypto.AKE.encStepOutput_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 : γ → List Bool} {x2 : γ → Phase} {x3 x4 : γ → 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.encFinEnum Phase) budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encBits budget) (h4 : Turing.MultiTapeTM.ComputableInSpace x4 encIn Turing.MultiTapeTM.encBits budget) :
          Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { state := x0 x, message := x1 x, phase := x2 x, partner := x3 x, key := x4 x }) encIn encStepOutput budget

          Encoding of StepOutput as its fields in declaration order.

          theorem Cslib.Crypto.AKE.encStepOutput_mk_deg :
          Turing.MultiTapeTM.ComputableInDegree (fun (p : List Bool × List Bool × Phase × List Bool × List Bool) => { state := p.1, message := p.2.1, phase := p.2.2.1, partner := p.2.2.2.1, key := p.2.2.2.2 }) encStepOutputFields encStepOutput 1 1
          theorem Cslib.Crypto.AKE.encStepOutput_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} {x2 : γ → Phase} {T2 S2 : γ → ℕ} {x3 : γ → List Bool} {T3 S3 : γ → ℕ} {x4 : γ → List Bool} {T4 S4 : γ → ℕ} (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.encFinEnum Phase) T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encBits T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO x4 encIn Turing.MultiTapeTM.encBits T4 S4) :
          Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { state := x0 x, message := x1 x, phase := x2 x, partner := x3 x, key := x4 x }) encIn encStepOutput (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + T4 x)))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + S4 x)))
          theorem Cslib.Crypto.AKE.encStepOutput_message_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → StepOutput} :
          theorem Cslib.Crypto.AKE.encStepOutput_phase_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → StepOutput} :
          theorem Cslib.Crypto.AKE.encStepOutput_key_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → StepOutput} :

          Input to a TTP algorithm (honest registration, corrupt registration, or online TTP step).

          • parameter : ℕ

            Unary security parameter n.

          • ttp : List Bool

            Current internal state word of the TTP.

          • user : List Bool

            User identity relevant to the query (unused for online TTP steps).

          • message : List Bool

            Incoming message word to the TTP (unused for honest registration).

          Instances For
            theorem Cslib.Crypto.AKE.encTTPInput_mk_deg :
            Turing.MultiTapeTM.ComputableInDegree (fun (p : ℕ × List Bool × List Bool × List Bool) => { parameter := p.1, ttp := p.2.1, user := p.2.2.1, message := p.2.2.2 }) encTTPInputFields encTTPInput 1 1
            theorem Cslib.Crypto.AKE.encTTPInput_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} {x3 : γ → List Bool} {T3 S3 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encBits T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encBits T3 S3) :
            Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { parameter := x0 x, ttp := x1 x, user := x2 x, message := x3 x }) encIn encTTPInput (fun (x : γ) => T0 x + (T1 x + (T2 x + T3 x))) fun (x : γ) => S0 x + (S1 x + (S2 x + S3 x))
            theorem Cslib.Crypto.AKE.encTTPInput_parameter_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TTPInput} :
            @[reducible, inline]

            The tuple of the fields of encTTPInput.

            Encoding of TTPInput as its fields in declaration order.

            theorem Cslib.Crypto.AKE.encTTPInput_ttp_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TTPInput} :
            theorem Cslib.Crypto.AKE.encTTPInput_user_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TTPInput} :
            theorem Cslib.Crypto.AKE.encTTPInput_message_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TTPInput} :
            theorem Cslib.Crypto.AKE.encTTPInput_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 : γ → ℕ} {x1 x2 x3 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encBits budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encBits budget) :
            Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { parameter := x0 x, ttp := x1 x, user := x2 x, message := x3 x }) encIn encTTPInput budget

            Output of a TTP algorithm.

            • ttp : List Bool

              Updated internal state word of the TTP.

            • output : List Bool

              Returned word: the long-term secret key for honest registration, or outgoing message.

            Instances For
              theorem Cslib.Crypto.AKE.encTTPOutput_ttp_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TTPOutput} :
              theorem Cslib.Crypto.AKE.encTTPOutput_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) :
              Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { ttp := x0 x, output := x1 x }) encIn encTTPOutput budget

              Encoding of TTPOutput as its fields in declaration order.

              theorem Cslib.Crypto.AKE.encTTPOutput_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBits T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) :
              Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { ttp := x0 x, output := x1 x }) encIn encTTPOutput (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
              theorem Cslib.Crypto.AKE.encTTPOutput_output_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → TTPOutput} :
              @[reducible, inline]

              The tuple of the fields of encTTPOutput.

              Syntactic specification of an authenticated key exchange protocol ([BS23], §21.9, pp. 885–886), packaged with uniform strict polynomial-time / IsPPTOn certificates, the session-key length condition k ∈ 𝒦 where 𝒦 = {0, 1}^{keyLength n}, and the size bound that makes the TTP an efficient interface (Definition 2.12, p. 33) and keeps instance configurations polynomial in n (§18.1.1, p. 718). The module documentation compares this bound with the book's conditions.

              A word is too long for P at security parameter n when it has more than P.sizeBound n bits. The challenger refuses any query that would hand such a user identity or message to a protocol algorithm.

              Instances For
                @[instance_reducible]