AFTD Auto-Formalizing Theoretical Domains

Cslib.Crypto.Protocols.PerfectSecrecy.EncScheme

structureimported Lean

A private-key encryption scheme over message space M, key space K, and ciphertext space C ([KatzLindell2020], Definition 2.1).

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
structure Cslib.Crypto.Protocols.PerfectSecrecy.EncScheme (Message Key Ciphertext : Type*)
Defined in
CSLib, `Cslib.Crypto.Protocols.PerfectSecrecy.EncScheme`
Lean proof
By Samuel Schlesinger, from github.com/leanprover/cslib at 3951377e5a3f (Copyright (c) 2026 Samuel Schlesinger. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.
Verified
08 Oct 2026
Axioms
none listed
Used by 20

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
/-- A private-key encryption scheme over message space `M`, key space `K`, and ciphertext space `C` ([KatzLindell2020], Definition 2.1). -/
structure Cslib.Crypto.Protocols.PerfectSecrecy.EncScheme (Message Key Ciphertext : Type*) where
  /-- Probabilistic key generation. -/
  gen : PMF Key
  /-- (Possibly randomized) encryption. -/
  enc (key : Key) (message : Message) : PMF Ciphertext
  /-- Deterministic decryption. -/
  dec (key : Key) (ciphertext : Ciphertext) : Message
  /-- Decryption inverts encryption for all keys in the support of `gen`. -/
  correct : ∀ key, key ∈ gen.support → ∀ message ciphertext,
    ciphertext ∈ (enc key message).support → dec key ciphertext = message
See it in the graphDiscuss this resultChallenge it