Demo: the reflective SSP tactic on the real one-time-pad games #
Examples/OneTimePad.lean closes its perfect-security stack with a ~40-line
hand-written "Reflection into the Package / UC Stack" section: otpGameRaw, the
IsValid instance, otpGameRaw_eval, otpGameRaw_eval_eq, otpGameTrue,
otpGameFalse, otp_eval_eq, and then the four package theorems
(otp_deepnom_zero, otp_nompkg_secure, otp_sdist_zero, otp_uc).
This file reproduces the two headline package results — otp_nompkg_secure and
otp_uc — on the same one-time-pad games, each in a single
reflect_ofOracle_* invocation, given only the shallow game family and the one
shallow coupling reused from OneTimePad.
The shallow one-time-pad oracle body (the SPComp game the package reflects):
sample a uniform key and return the ciphertext k ⊕ m.
Equations
- CatCrypt.Examples.ReflectTacticDemo.otpBody m = (CatCrypt.Core.SPComp.sample Bool).bind fun (k : Bool) => CatCrypt.Core.SPComp.pure (k ^^ m)
Instances For
The single shallow coupling the tactic consumes, reused from OneTimePad:
the two one-time-pad game bodies coincide as SPComp computations (each is
the uniform sample). Obtained from OneTimePad's reflected coupling
otp_eval_eq via the round-trip otpGameRaw_eval.
otp_nompkg_secure reproduced in one invocation. Package-level perfect
security of the reflected OTP games, from the shallow body + shallow coupling.
otp_uc reproduced in one invocation. Perfect UC emulation of the linked
OTP game families over the trivial-leak interface, from the shallow body +
shallow coupling.