Documentation

CatCryptCore.Crypto.Assumptions.AEAD

AEAD (Authenticated Encryption with Associated Data) Security #

This file defines the IND-CCA2 security notion for AEAD schemes at the abstract Word := Bool level.

AEAD Games #

The AEAD security game captures the difficulty of distinguishing:

Main definitions #

Usage in EDHOC #

EDHOC uses AES-CCM-16-64-128 for:

  1. Encrypting message 3 (containing initiator's credential + MAC_3)
  2. Encrypting message 4 (optional, containing EAD_4)
  3. Message 2 uses XOR encryption (KEYSTREAM_2), not AEAD

Each AEAD operation contributes one ε_aead to the security bound.

Cross-Validation #

PropertyThis fileTextbook
Game structureAEAD_Game_Real/IdealBoneh-Shoup Def. 9.1 (IND-CPA for SKE)
AdvantageAdvantage(Real, Ideal)|Pr[W₀] - Pr[W₁]|
FormulationIndistinguishability (real vs random)Equiv. to IND-CCA2 for nonce-based AEAD

Equivalent formalizations:

Note: AEAD_Advantage uses an IND-CPA formulation (real ciphertext vs random, no decryption oracle). AEAD_CCA_Advantage adds a decryption oracle for full IND-CCA2 security. The standard AEAD security combines IND-CPA + INT-CTXT; the IND-CCA2 formulation captures both. Use AEAD_CCA_Advantage for protocols where the adversary can submit chosen ciphertexts (multi-message, interactive). AEAD_CPA_le_CCA shows that IND-CCA2 implies IND-CPA.

References #

AEAD Definition #

Abstract AEAD scheme definition, parametric over SampleableType W.

  • encrypt key plaintext ad → ciphertext
  • decrypt key ciphertext ad → plaintext (or ⊥)
  • encrypt : WWWW

    AEAD encryption: (key, plaintext, associated_data) → ciphertext. Models aes_ccm_encrypt_tag_8 in lakers' Crypto trait.

  • decrypt : WWWW

    AEAD decryption: (key, ciphertext, associated_data) → plaintext. Models aes_ccm_decrypt_tag_8 in lakers' Crypto trait. Returns the plaintext (abstract level doesn't model decryption failure).

Instances For

    AEAD Games #

    @[reducible, inline]

    Type of AEAD adversary: receives a ciphertext and must distinguish real encryption from random.

    Equations
    Instances For

      AEAD real game: sample random key, encrypt the adversary's chosen plaintext.

      Equations
      Instances For

        AEAD ideal game: adversary receives a random ciphertext.

        Equations
        Instances For
          noncomputable def CatCrypt.Crypto.Assumptions.AEAD_Advantage {W : Type} [SampleableType W] (D : AEADDef W) (pt ad : W) (A : AEAD_Adversary W) :

          AEAD advantage: ability to distinguish real encryption from random.

          Equations
          Instances For

            IsPure Proofs #

            theorem CatCrypt.Crypto.Assumptions.AEAD_Game_Real_isPure {W : Type} [SampleableType W] (D : AEADDef W) (pt ad : W) (A : AEAD_Adversary W) (hA : ∀ (x : W), (A x).IsPure) :

            IND-CCA2 AEAD Games (with decryption oracle) #

            Standard AEAD security requires both confidentiality (IND-CPA) and integrity (INT-CTXT). The IND-CCA2 formulation gives the adversary access to both encryption and decryption oracles, combining both properties into a single game.

            References #

            IND-CCA2 AEAD adversary: receives encryption and decryption oracles.

            • run : (WWCore.SPComp W)(WWCore.SPComp (Option W))Core.SPComp Bool

              The adversary's computation, given:

              • An encryption oracle: (plaintext, ad) → ciphertext
              • A decryption oracle: (ciphertext, ad) → plaintext option Returns a distinguishing bit.
            Instances For

              IND-CCA2 real game: adversary gets real encryption and real decryption.

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

                IND-CCA2 ideal game: encryption returns random, decryption always rejects.

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

                  IND-CCA2 AEAD advantage: ability to distinguish real enc+dec from random enc + reject-all dec.

                  Equations
                  Instances For

                    IND-CCA2 implies IND-CPA: any IND-CPA adversary can be lifted to an IND-CCA2 adversary that ignores the decryption oracle.

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

                      IsPure Proofs (CCA) #

                      theorem CatCrypt.Crypto.Assumptions.AEAD_CCA_Game_Real_isPure {W : Type} [SampleableType W] (D : AEADDef W) (A : AEAD_CCA_Adversary W) (hA : ∀ (enc : WWCore.SPComp W) (dec : WWCore.SPComp (Option W)), (∀ (x y : W), (enc x y).IsPure)(∀ (x y : W), (dec x y).IsPure)(A.run enc dec).IsPure) :
                      theorem CatCrypt.Crypto.Assumptions.AEAD_CCA_Game_Ideal_isPure {W : Type} [SampleableType W] (A : AEAD_CCA_Adversary W) (hA : ∀ (enc : WWCore.SPComp W) (dec : WWCore.SPComp (Option W)), (∀ (x y : W), (enc x y).IsPure)(∀ (x y : W), (dec x y).IsPure)(A.run enc dec).IsPure) :

                      Keyed AEAD Games (KDM + Key Leakage) #

                      Non-Standard Assumption #

                      AEAD_Keyed_Advantage combines two non-standard properties:

                      1. Key-dependent messages (KDM): plaintext and associated data depend on the key via pt ad : W → W, rather than being fixed constants.
                      2. Key leakage: the real game outputs (ciphertext, key) as a pair, leaking the secret key alongside the ciphertext.

                      Standard AEAD_Advantage does NOT imply AEAD_Keyed_Advantage. In general, KDM security requires additional assumptions (e.g., random oracle / ideal cipher).

                      Literature #

                      Usage #

                      Used by EDHOC (genuinely needed: th_3 depends on prk_3e2m, creating a circular key dependency). Also used by SSH, Kerberos, and HPKE multi-message (Phase B). Not needed by HPKE single-shot modes (standard AEAD_Advantage suffices).

                      noncomputable def CatCrypt.Crypto.Assumptions.aead_keyed_real {W : Type} [SampleableType W] (D : AEADDef W) (pt ad : WW) :

                      AEAD keyed real game: sample key, output (ciphertext, key) pair. The plaintext and associated data may depend on the key (key-dependent messages).

                      Equations
                      Instances For

                        AEAD keyed ideal game: sample independent random pair.

                        Equations
                        Instances For
                          noncomputable def CatCrypt.Crypto.Assumptions.AEAD_Keyed_Advantage {W : Type} [SampleableType W] (D : AEADDef W) (pt ad : WW) (A : W × WCore.SPComp Bool) :

                          AEAD keyed advantage: distinguishing real encryption+key from random pair.

                          Equations
                          Instances For