Skip to content

refactor(Crypto/PRG): allow explicit seed and ideal distributions - #1071

Open
SamuelSchlesinger wants to merge 2 commits into
samschles/crypto-pr-08-hybrid-argumentsfrom
samschles/crypto-pr-09-prg-distributions
Open

SamuelSchlesinger wants to merge 2 commits into
samschles/crypto-pr-08-hybrid-argumentsfrom
samschles/crypto-pr-09-prg-distributions

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Generalizes the PRG experiments to accept explicit seed and ideal distributions. Omitted distributions default to uniform sampling on finite types, preserving the experiments of Boneh and Shoup, Attack Game 3.1. Explicit distributions support nonuniform sampling and infinite ambient types.

Reuses Game.advantage and defines family security through Game.Secure and Game.SecureWithError. Finite and nonempty instances are needed for uniform defaults and finite counting results; calls passing the old instance arguments explicitly need adjustment.

Zero-error security against all tests is characterized by equality with the supplied ideal distribution. Renames secure_zero_iff_outputDist_eq_uniform to secure_zero_iff_outputDist_eq, retaining the old name as a deprecated alias.

Depends on #1070.

Composed with Claude Code; reviewed and restacked with Codex.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to stack #1064 October 4, 2026 22:31
@SamuelSchlesinger
SamuelSchlesinger force-pushed the samschles/crypto-pr-09-prg-distributions branch from 0ef0536 to f05d7d8 Compare October 4, 2026 23:03
@SamuelSchlesinger
SamuelSchlesinger force-pushed the samschles/crypto-pr-09-prg-distributions branch from f05d7d8 to 56d36e3 Compare October 4, 2026 23:33
@SamuelSchlesinger
SamuelSchlesinger removed this pull request from stack #1064 October 5, 2026 20:06
@SamuelSchlesinger
SamuelSchlesinger added this pull request to stack #1077 October 5, 2026 20:07
@SamuelSchlesinger
SamuelSchlesinger force-pushed the samschles/crypto-pr-09-prg-distributions branch from 56d36e3 to 4872c75 Compare October 5, 2026 20:19
@SamuelSchlesinger
SamuelSchlesinger removed this pull request from stack #1077 October 5, 2026 20:20
@SamuelSchlesinger
SamuelSchlesinger added this pull request to stack #1080 October 5, 2026 20:20
@SamuelSchlesinger
SamuelSchlesinger removed this pull request from stack #1080 October 5, 2026 20:43
@SamuelSchlesinger
SamuelSchlesinger added this pull request to stack #1082 October 5, 2026 20:43
Generalizes the PRG experiments from #876 so that the seed and ideal distributions are explicit arguments. They are auto-params defaulting to `PMF.uniformOfFintype _`, so on finite types `G.Secure Admissible ε`, `Family.Secure`, and the existing results keep their meaning without changes at call sites. Computational definitions over infinite sample spaces, such as words, can now reuse these experiments.

Advantage and asymptotic security are now expressed through `Game` and `Negligible`. The `[Fintype]` and `[Nonempty]` instances move from the definitions to the results that need them, so callers that pass them explicitly need to drop them. `secure_zero_iff_outputDist_eq_uniform` becomes `secure_zero_iff_outputDist_eq`, which compares with the ideal distribution; a deprecated alias keeps the old name.
@SamuelSchlesinger
SamuelSchlesinger force-pushed the samschles/crypto-pr-09-prg-distributions branch from 4872c75 to 058e07b Compare October 5, 2026 20:56
@SamuelSchlesinger
SamuelSchlesinger removed this pull request from stack #1082 October 5, 2026 20:57
@SamuelSchlesinger
SamuelSchlesinger added this pull request to stack #1084 October 5, 2026 20:57
@SamuelSchlesinger
SamuelSchlesinger removed this pull request from stack #1084 October 5, 2026 21:02
@SamuelSchlesinger
SamuelSchlesinger changed the base branch from samschles/crypto-pr-08-hybrid-arguments to main October 5, 2026 21:02
@SamuelSchlesinger
SamuelSchlesinger changed the base branch from main to samschles/crypto-pr-08-hybrid-arguments October 5, 2026 21:03
@SamuelSchlesinger
SamuelSchlesinger added this pull request to stack #1085 October 5, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant