Construction.lean
FS-AEAD from AEAD and PRG: the symmetric ratchet (ACD19 Fig. 6, corrected)
Trusted in part. The theorems of Computational/ use only the state types RatchetSenderState and RatchetReceiverState from this file: read them. fromAEADPRG, skipKeys and the theorems here are checked by Lean. See Computational/.
Corrected symmetric ratchet of ACD19 Fig. 6 built from an AEADScheme, a position-indexed PRG family G p (DEV-FS10), and skip window maxSkip (DEV-FS7, DEV-FS8, DEV-FS9).
@[expose] public sectionopen OracleComp OracleSpec ENNRealnamespace CryptoGames.FSAEADvariable {ChainKey MessageKey AssocData Message Ciphertext : Type}structure RatchetSenderState
Sender state of the symmetric ratchet (ACD19 Fig. 6 v_A = (w, iA)).
structure RatchetSenderState (ChainKey : Type) where
/-- Current chain key (`w`). -/
chainKey : ChainKey
/-- Index of the last message sent (`iA`); `0` before the first message. -/
lastIndex : ℕstructure RatchetReceiverState
Receiver state of the symmetric ratchet (ACD19 Fig. 6 v_B = (w, iB, D)).
structure RatchetReceiverState (ChainKey MessageKey : Type) where
/-- Current chain key (`w`), deriving the message key for `lastIndex + 1`. -/
chainKey : ChainKey
/-- Largest index received so far (`iB`); `0` before the first message. -/
lastIndex : ℕ
/-- Stored `(index, key)` pairs for skipped indices below `lastIndex` (`D`). -/
skippedKeys : List (ℕ × MessageKey)2 declarations not shown (lines 50–93): theorems, which Lean checks, or definitions that no headline statement uses
CryptoGames., CryptoGames.
end CryptoGames.FSAEAD