WireRatchetDefs.lean
libsignal's symmetric ratchet with the counter inside the wire bytes
Trusted: definitions used by the statement. The theorems of Computational/ use every definition in this file: read them. See Computational/.
Plaintext normalization padOrTruncatePlain used to fit decrypted byte lists into the fixed-length message type Plain ℓ of ACD19 Theorem 5.
@[expose] public sectionopen OracleComp OracleSpec ENNRealnamespace CryptoGamesnamespace Ratchetopen HMAC HKDF CBC LibsignalAead MACScheme AEADScheme WireAEADvariable {H : Type}def padOrTruncatePlain
Truncate or zero-pad a received plaintext to ℓ bytes (identity on ℓ-byte inputs).
def padOrTruncatePlain (ℓ : ℕ) (bs : List (BitVec 8)) : Plain ℓ :=
⟨(bs ++ List.replicate ℓ 0).take ℓ, H:Typeℓ:ℕbs:List (BitVec 8)⊢ (List.take ℓ (bs ++ List.replicate ℓ 0)).length = ℓ All goals completed! 🐙⟩end Ratchetend CryptoGames