Documentation

Cryptlib.Primitives.WideBlockCipher.AEZ

AEZ v5 as a strong pseudorandom permutation #

AEZ with tau = 0, no associated data, a 48-byte extracted key and a 16-byte nonce: a length-preserving SPRP with no authentication tag. Key extraction, associated-data hashing and aezPRF are omitted.

Doubling in GF(2¹²⁸) modulo x¹²⁸+x⁷+x²+x+1, big-endian.

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

    The round function #

    AES4/AES10 whiten the input with the call-site j,i,l blocks, then apply 4 or 10 full AES rounds under a fixed schedule derived from the key.

    Instances For

      AES4(j, i, l; src): whiten with the call-site j,i,l, then 4 fixed-schedule rounds.

      Equations
      Instances For

        AES10(l; src): whiten with the call-site l alone, then 10 fixed-schedule rounds.

        Equations
        Instances For
          @[simp]
          theorem Cryptlib.Primitives.WideBlockCipher.AEZ.aes4_size' (e : EState) (j i l src : Block) :
          Array.size (aes4 e j i l src) = 16

          aes4 always produces a 16-byte block.

          The key schedule, from a 48-byte extracted key.

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

            aezHash with tau = 0 and no associated data #

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

              aezTiny: inputs shorter than 32 bytes #

              aezTiny's (i0, rounds) parameters. Separate so size proofs need not case-split on them.

              Equations
              Instances For
                def Cryptlib.Primitives.WideBlockCipher.AEZ.mkBuf (half ih2 : Nat) (mask pad : UInt8) (delta X : Block) (ctr : UInt8) :

                The round buffer of aezTinyLR: X's first half bytes, mask/pad at ih2, XOR delta, then the counter byte XORed into the last position.

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

                  aezTiny's Feistel rounds, producing (L, R). Kept separate to keep proof terms small.

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

                    d = 0: encipher; d = 1: decipher.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem Cryptlib.Primitives.WideBlockCipher.AEZ.aezTiny_size (e : EState) (delta : Block) (inArr : ByteArray) (d : Nat) :
                      (aezTiny e delta inArr d).size = inArr.size

                      The aezTiny Feistel ladder inverts #

                      n forward double-rounds followed by n backward double-rounds on the swapped pair is the identity, for any round function.

                      XORing the same block twice is the identity.

                      One forward double-round at iteration k, under counters 2k and 2k+1.

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

                        One backward double-round under counters s and s-1.

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

                          n forward double-rounds, a swap, then n backward double-rounds return the swapped input, for any F.

                          aezCore: inputs of 32 bytes or more #

                          The two passes process all 32-byte chunks except the final chunk and any shorter fragment, which are finished separately.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            theorem Cryptlib.Primitives.WideBlockCipher.AEZ.aezCore_size (e : EState) (delta : Block) (inArr : ByteArray) (d : Nat) (h : 32 ≤ inArr.size) :
                            (aezCore e delta inArr d).size = inArr.size

                            Top-level dispatch #

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

                                SPRP encryption: 48-byte key, 16-byte IV.

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

                                  SPRP decryption. With tau = 0 there is no tag to check.

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

                                    Length preservation #

                                    theorem Cryptlib.Primitives.WideBlockCipher.AEZ.encipher_size (e : EState) (delta : Block) (inArr : ByteArray) :
                                    (encipher e delta inArr).size = inArr.size
                                    theorem Cryptlib.Primitives.WideBlockCipher.AEZ.decipher_size (e : EState) (delta : Block) (inArr : ByteArray) :
                                    (decipher e delta inArr).size = inArr.size

                                    AEZ, as a WideBlockCipher #

                                    axiom Cryptlib.Primitives.WideBlockCipher.AEZ.aez_roundTrip (key : Array UInt8) (iv msg : ByteArray) (h16 : 16 ≤ msg.size) :
                                    sprpDecrypt key iv (sprpEncrypt key iv msg) = msg

                                    AEZ round trip. An unproven axiom: only the aezTiny ladder is proved above; checked against sprp_aez.json.

                                    AEZ as a WideBlockCipher.

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