Skip to content

Commit 2554d80

Browse files
committed
Updates due to example renaming
1 parent 1d01ae8 commit 2554d80

14 files changed

Lines changed: 172 additions & 161 deletions

File tree

examples.md

Lines changed: 29 additions & 29 deletions
Large diffs are not rendered by default.

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Checking your first proof is as easy as:
2727
```bash
2828
pip install proof_frog
2929
git clone https://github.com/ProofFrog/examples
30-
proof_frog prove examples/Proofs/PubEnc/KEMDEMCPA.proof
30+
proof_frog prove examples/Proofs/PubKeyEnc/HybridKEMDEM_INDCPA_MultiChal.proof
3131
```
3232

3333
See the [installation instructions]({% link manual/installation.md %}) for details.

manual/canonicalization.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ E.Ciphertext Eavesdrop(E.Message mL, E.Message mR) {
7373
```
7474

7575
Real-proof pointer: every proof in the distribution relies on inlining.
76-
[`examples/Proofs/PRG/TriplingPRGSecure.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/PRG/TriplingPRGSecure.proof) is a clean illustration -- the
76+
[`examples/Proofs/PRG/TriplingPRG_PRGSecurity.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/PRG/TriplingPRG_PRGSecurity.proof) is a clean illustration -- the
7777
`TriplingPRG` scheme composes calls to an underlying `PRG`, and those calls are inlined
7878
before the PRG reduction hops.
7979

@@ -114,7 +114,7 @@ return u;
114114
slice boundaries align with the component widths, saving a round-trip through
115115
concatenation and slicing.
116116

117-
Real-proof pointer: [`examples/Proofs/SymEnc/SymEncPRFCPA$.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/SymEncPRFCPA%24.proof) -- the final
117+
Real-proof pointer: [`examples/Proofs/SymEnc/SymEncPRF_INDCPA$_MultiChal.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/SymEncPRF_INDCPA%24_MultiChal.proof) -- the final
118118
merge of two independent uniform samples into the CPA$ random game relies on XOR
119119
absorption after the PRF is replaced by a random function.
120120

@@ -146,7 +146,7 @@ ModInt<q> u <- ModInt<q>;
146146
return u;
147147
```
148148

149-
Real-proof pointer: [`examples/Proofs/SymEnc/ModOTPSecure.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/ModOTPSecure.proof) uses the ModInt
149+
Real-proof pointer: [`examples/Proofs/SymEnc/ModOTP_INDOT.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/ModOTP_INDOT.proof) uses the ModInt
150150
one-time-pad argument directly.
151151

152152
{: .note }
@@ -183,7 +183,7 @@ return (h ^ b) * (h ^ c);
183183
return G.generator ^ (a * b + a * c);
184184
```
185185

186-
Real-proof pointer: [`examples/Proofs/PubEnc/ElGamalCPA.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/PubEnc/ElGamalCPA.proof) uses the
186+
Real-proof pointer: [`examples/Proofs/PubKeyEnc/ElGamal_INDCPA_MultiChal.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/PubKeyEnc/ElGamal_INDCPA_MultiChal.proof) uses the
187187
group masking move (the DDH `Right` game replaces `pk ^ r` with a random group element `c`,
188188
and the uniform-absorbs rule fires to simplify `mL * c` to `c`, making the ciphertext
189189
independent of the message).
@@ -230,7 +230,7 @@ BitString<m> z_1 <- BitString<m>;
230230
return [z_0, z_1];
231231
```
232232

233-
Real-proof pointer: [`examples/Proofs/PRG/TriplingPRGSecure.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/PRG/TriplingPRGSecure.proof) uses sample split
233+
Real-proof pointer: [`examples/Proofs/PRG/TriplingPRG_PRGSecurity.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/PRG/TriplingPRG_PRGSecurity.proof) uses sample split
234234
to decompose a single PRG output into its two halves (each half is then used
235235
independently as a new seed or output value, and the split enables the per-component
236236
uniform reasoning).
@@ -272,7 +272,7 @@ BitString<n> r <-uniq[RF.domain] BitString<n>;
272272
BitString<m> z <- BitString<m>;
273273
```
274274

275-
Real-proof pointer: [`examples/Proofs/PubEnc/HashedElGamalCPAROM.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/PubEnc/HashedElGamalCPAROM.proof) -- the proof
275+
Real-proof pointer: [`examples/Proofs/PubKeyEnc/HashedElGamal_INDCPA_ROM_MultiChal.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/PubKeyEnc/HashedElGamal_INDCPA_ROM_MultiChal.proof) -- the proof
276276
uses `FreshInputRFToUniform` (after the DDH hop places a uniform group element `c` in
277277
the exclusion set) to collapse `H(c)` into a fresh uniform bitstring, which then masks
278278
the message via XOR.
@@ -370,7 +370,7 @@ return k + m;
370370
Real-proof pointer: dead code elimination is exercised in almost every proof. The
371371
elimination of the random-function field after `UniqueRFSimplification` replaces all
372372
its calls with uniform samples is a good representative case; see
373-
[`examples/Proofs/SymEnc/SymEncPRFCPA$.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/SymEncPRFCPA%24.proof).
373+
[`examples/Proofs/SymEnc/SymEncPRF_INDCPA$_MultiChal.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/SymEncPRF_INDCPA%24_MultiChal.proof).
374374

375375
{: .note }
376376
**If a branch is not being eliminated:** The engine folds `if (true)` and `if (false)`
@@ -396,7 +396,7 @@ The `RemoveUnreachable` pass also uses Z3 to determine whether a statement after
396396
guarded return is reachable, allowing dead branches under non-trivially-false conditions
397397
to be removed.
398398

399-
Real-proof pointer: [`examples/Proofs/SymEnc/EncryptThenMACCCA.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/EncryptThenMACCCA.proof) uses phased
399+
Real-proof pointer: [`examples/Proofs/SymEnc/EncryptThenMAC_INDCCA_MultiChal.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/EncryptThenMAC_INDCCA_MultiChal.proof) uses phased
400400
games with guard conditions that require Z3 to confirm equivalence after inlining.
401401

402402
{: .note }
@@ -413,7 +413,7 @@ already in the simplified form.
413413
Some probabilistic facts cannot be derived purely from program structure: they require
414414
an external statistical argument (typically a birthday bound or a random oracle
415415
property). ProofFrog handles these via *helper games* -- ordinary `.game` files in
416-
`examples/Games/Misc/` that state a statistical equivalence as a security assumption.
416+
`examples/Games/Helpers/` that state a statistical equivalence as a security assumption.
417417
The user invokes a helper game as an assumption hop in the same way as any other
418418
assumption; the difference is that the helper game is not a hardness assumption but a
419419
statistical argument that the proof author vouches for.
@@ -422,7 +422,7 @@ Four helper games currently in the distribution are:
422422

423423
### UniqueSampling
424424

425-
**File:** [`examples/Games/Misc/UniqueSampling.game`](https://github.com/ProofFrog/examples/blob/main/Games/Misc/UniqueSampling.game)
425+
**File:** [`examples/Games/Helpers/Probability/UniqueSampling.game`](https://github.com/ProofFrog/examples/blob/main/Games/Helpers/Probability/UniqueSampling.game)
426426

427427
**What it states:** Sampling uniformly with replacement from a set `S` is
428428
indistinguishable from sampling without replacement (exclusion sampling, `<-uniq`).
@@ -447,12 +447,12 @@ UniqueSampling.NoReplacement compose R_Uniq against Adversary; // by UniqueSampl
447447
G_after against Adversary; // interchangeability
448448
```
449449

450-
Real-proof pointer: used in [`examples/Proofs/SymEnc/SymEncPRFCPA$.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/SymEncPRFCPA%24.proof),
451-
[`examples/Proofs/PubEnc/HashedElGamalCPAROM.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/PubEnc/HashedElGamalCPAROM.proof), [`examples/Proofs/Group/DDHMultiChalImpliesHashedDDHMultiChal.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/Group/DDHMultiChalImpliesHashedDDHMultiChal.proof).
450+
Real-proof pointer: used in [`examples/Proofs/SymEnc/SymEncPRF_INDCPA$_MultiChal.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/SymEncPRF_INDCPA%24_MultiChal.proof),
451+
[`examples/Proofs/PubKeyEnc/HashedElGamal_INDCPA_ROM_MultiChal.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/PubKeyEnc/HashedElGamal_INDCPA_ROM_MultiChal.proof), [`examples/Proofs/Group/DDHMultiChal_implies_HashedDDHMultiChal.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/Group/DDHMultiChal_implies_HashedDDHMultiChal.proof).
452452

453-
### HashOnUniform
453+
### Regularity
454454

455-
**File:** [`examples/Games/Misc/HashOnUniform.game`](https://github.com/ProofFrog/examples/blob/main/Games/Misc/HashOnUniform.game)
455+
**File:** [`examples/Games/Hash/Regularity.game`](https://github.com/ProofFrog/examples/blob/main/Games/Hash/Regularity.game)
456456

457457
**What it states:** Applying a hash function `H : D -> BitString<n>` to a uniformly
458458
sampled input from `D` is indistinguishable from sampling `BitString<n>` uniformly.
@@ -465,11 +465,11 @@ block without sampling, so not a random oracle), and the proof requires treating
465465
output of `H` on a uniform input as uniformly random. This is the standard-model
466466
counterpart to what `FreshInputRFToUniform` does automatically in the ROM.
467467

468-
Real-proof pointer: used in [`examples/Proofs/Group/DDHImpliesHashedDDH.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/Group/DDHImpliesHashedDDH.proof).
468+
Real-proof pointer: used in [`examples/Proofs/Group/DDH_implies_HashedDDH.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/Group/DDH_implies_HashedDDH.proof).
469469

470470
### ROMProgramming
471471

472-
**File:** [`examples/Games/Misc/ROMProgramming.game`](https://github.com/ProofFrog/examples/blob/main/Games/Misc/ROMProgramming.game)
472+
**File:** [`examples/Games/Helpers/Probability/ROMProgramming.game`](https://github.com/ProofFrog/examples/blob/main/Games/Helpers/Probability/ROMProgramming.game)
473473

474474
**What it states:** Programming a random function at a single target point with a fresh
475475
uniform value is statistically equivalent to evaluating it naturally. The `Natural` game
@@ -482,11 +482,11 @@ challenge point -- replacing `H(target)` with an independently sampled value so
482482
challenge ciphertext becomes statistically independent of the adversary's hash queries.
483483
This is a standard technique in ROM proofs.
484484

485-
Real-proof pointer: used in [`examples/Proofs/Group/CDHImpliesHashedDDH.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/Group/CDHImpliesHashedDDH.proof).
485+
Real-proof pointer: used in [`examples/Proofs/Group/CDH_implies_HashedDDH.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/Group/CDH_implies_HashedDDH.proof).
486486

487487
### RandomTargetGuessing
488488

489-
**File:** [`examples/Games/Misc/RandomTargetGuessing.game`](https://github.com/ProofFrog/examples/blob/main/Games/Misc/RandomTargetGuessing.game)
489+
**File:** [`examples/Games/Helpers/Probability/RandomTargetGuessing.game`](https://github.com/ProofFrog/examples/blob/main/Games/Helpers/Probability/RandomTargetGuessing.game)
490490

491491
**What it states:** Comparing an adversary-supplied value against a hidden, uniformly
492492
sampled target is indistinguishable from always returning false. The `Real` game samples
@@ -498,7 +498,7 @@ game always returns `false`. Any adversary distinguishes the two with advantage
498498
uniform value, and the proof argues that such a guess succeeds only with negligible
499499
probability.
500500

501-
Real-proof pointer: used in [`examples/Proofs/Group/DDHImpliesCDH.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/Group/DDHImpliesCDH.proof).
501+
Real-proof pointer: used in [`examples/Proofs/Group/DDH_implies_CDH.proof`](https://github.com/ProofFrog/examples/blob/main/Proofs/Group/DDH_implies_CDH.proof).
502502

503503
{: .important }
504504
Using a helper game adds to the trust base -- see the [Soundness]({% link researchers/soundness.md %}) page in the For Researchers area.
@@ -565,7 +565,7 @@ fired asymmetrically).
565565

566566
- *Add a helper assumption.* If the gap corresponds to a statistical fact (birthday
567567
bound, hash-on-uniform, ROM programming), introduce the appropriate helper game from
568-
`examples/Games/Misc/` and use the four-step reduction pattern to cross the gap.
568+
`examples/Games/Helpers/` and use the four-step reduction pattern to cross the gap.
569569

570570
- *Restructure existing code.* If the canonical forms differ only in ordering --
571571
operand order in a concatenation, field declaration order, branch order in an

manual/cli-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ python -m proof_frog prove -v examples/joy/Proofs/Ch2/OTPSecure.proof
177177
python -m proof_frog prove -vv examples/joy/Proofs/Ch2/OTPSecure.proof
178178

179179
# Verify a PRG security proof, skipping lemma re-verification
180-
python -m proof_frog prove --skip-lemmas examples/Proofs/PRG/CounterPRGSecure.proof
180+
python -m proof_frog prove --skip-lemmas examples/Proofs/PRG/CounterPRG_PRGSecurity.proof
181181
```
182182

183183
### Common Errors

manual/language-reference/basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,12 @@ import 'relative/path/to/File.primitive';
334334

335335
**Paths are file-relative**: the path is resolved relative to the directory containing the importing file, not relative to the directory where the CLI is invoked.
336336

337-
**Example.** The proof `examples/Proofs/SymEnc/OTUCimpliesOTS.proof` imports:
337+
**Example.** The proof `examples/Proofs/SymEnc/INDOT$_implies_INDOT.proof` imports:
338338

339339
```prooffrog
340340
import '../../Primitives/SymEnc.primitive';
341-
import '../../Games/SymEnc/OneTimeSecrecy.game';
342-
import '../../Games/SymEnc/OneTimeUniformCiphertexts.game';
341+
import '../../Games/SymEnc/INDOT.game';
342+
import '../../Games/SymEnc/INDOT$.game';
343343
```
344344

345345
From `examples/Proofs/SymEnc/`, `../..` navigates up to `examples/`, and the paths then descend into `Primitives/` and `Games/SymEnc/`.

manual/language-reference/games.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ There is no enforced naming convention for the two sides. Common choices from th
2929
|---|---|
3030
| `Left` / `Right` | General indistinguishability |
3131
| `Real` / `Random` | PRG, PRF security |
32-
| `Real` / `Fake` | Various simulation-based definitions |
33-
| `Real` / `Ideal` | Composable security |
32+
| `Real` / `Ideal` | Simulation-based security, correctness |
3433

3534
Pick names that make sense for the property in question, and consider how the security property is stated in the relevant literature. Neither side is "preferred": your game hopping proof can go from left to right or right to left; all that matters is that in a proof's `games:` list, the sequence must start on one side and end on the other.
3635

@@ -127,29 +126,29 @@ ProofFrog's convention, following Joy of Cryptography, allows all game oracles (
127126
The last line of every `.game` file is an `export as` statement that assigns a name to the security property:
128127

129128
```prooffrog
130-
export as OneTimeSecrecy;
129+
export as INDOT;
131130
```
132131

133132
This name is how the rest of the tool chain refers to the security property. In a proof file, after importing the game file, you write:
134133

135-
- `OneTimeSecrecy(E).Left` — the left game instantiated with scheme `E`
136-
- `OneTimeSecrecy(E).Right` — the right game instantiated with `E`
137-
- `OneTimeSecrecy(E).Adversary` — the type of adversary for this property
134+
- `INDOT(E).Left` — the left game instantiated with scheme `E`
135+
- `INDOT(E).Right` — the right game instantiated with `E`
136+
- `INDOT(E).Adversary` — the type of adversary for this property
138137

139-
The `export as` name is also what appears in the proof's `theorem:` and `assume:` sections. The name must be a valid identifier; by convention it matches the file name (e.g., `OneTimeSecrecy.game` exports `OneTimeSecrecy`).
138+
The `export as` name is also what appears in the proof's `theorem:` and `assume:` sections. The name must be a valid identifier; by convention it matches the file name (e.g., `INDOT.game` exports `INDOT`).
140139

141140
---
142141

143142
## Helper games as a special case
144143

145-
Not every `.game` file has to define a *cryptographic security property*. Game files can be used to capture facts that ProofFrog's engine is not able to reason about, such as mathematical properties, statistical claims, or additional program equivalence properties. The [`Games/Misc/`](https://github.com/ProofFrog/examples/tree/main/Games/Misc) directory contains several *helper games*.
144+
Not every `.game` file has to define a *cryptographic security property*. Game files can be used to capture facts that ProofFrog's engine is not able to reason about, such as mathematical properties, statistical claims, or additional program equivalence properties. The [`Games/Helpers/`](https://github.com/ProofFrog/examples/tree/main/Games/Helpers) directory contains several *helper games*.
146145

147146
Here are some helper games that capture mathematical facts:
148147

149-
- **`UniqueSampling`** ([`UniqueSampling.game`](https://github.com/ProofFrog/examples/blob/main/Games/Misc/UniqueSampling.game)): sampling uniformly from a set `S` is indistinguishable from sampling from `S` with exclusion of a bookkeeping set (rejection sampling).
150-
- **`HashOnUniform`** ([`HashOnUniform.game`](https://github.com/ProofFrog/examples/blob/main/Games/Misc/HashOnUniform.game)): applying a hash to a uniformly random input yields a uniform output.
151-
- **`RandomTargetGuessing`** ([`RandomTargetGuessing.game`](https://github.com/ProofFrog/examples/blob/main/Games/Misc/RandomTargetGuessing.game)): guessing a random target is no easier than guessing any fixed value.
152-
- **`ROMProgramming`** ([`ROMProgramming.game`](https://github.com/ProofFrog/examples/blob/main/Games/Misc/ROMProgramming.game)): facts about programming random oracles.
148+
- **`UniqueSampling`** ([`UniqueSampling.game`](https://github.com/ProofFrog/examples/blob/main/Games/Helpers/Probability/UniqueSampling.game)): sampling uniformly from a set `S` is indistinguishable from sampling from `S` with exclusion of a bookkeeping set (rejection sampling).
149+
- **`Regularity`** ([`Regularity.game`](https://github.com/ProofFrog/examples/blob/main/Games/Hash/Regularity.game)): applying a hash to a uniformly random input yields a uniform output.
150+
- **`RandomTargetGuessing`** ([`RandomTargetGuessing.game`](https://github.com/ProofFrog/examples/blob/main/Games/Helpers/Probability/RandomTargetGuessing.game)): guessing a random target is no easier than guessing any fixed value.
151+
- **`ROMProgramming`** ([`ROMProgramming.game`](https://github.com/ProofFrog/examples/blob/main/Games/Helpers/Probability/ROMProgramming.game)): facts about programming random oracles.
153152

154153
Helper games are structurally identical to security-property games — they are pairs of games with `export as` — but they appear in a proof's `assume:` block rather than the `theorem:` block. They can be assumed freely because they hold unconditionally or statistically, not by reduction to a computational hardness assumption. For the full catalog of available helper games and when to use each, see the [Canonicalization]({% link manual/canonicalization.md %}) page.
155154

@@ -161,7 +160,7 @@ When a mathematical fact is encoded via a helper game and used to bridge a step
161160

162161
### One-time secrecy
163162

164-
[`Games/SymEnc/OneTimeSecrecy.game`](https://github.com/ProofFrog/examples/blob/main/Games/SymEnc/OneTimeSecrecy.game)
163+
[`Games/SymEnc/INDOT.game`](https://github.com/ProofFrog/examples/blob/main/Games/SymEnc/INDOT.game)
165164

166165
```prooffrog
167166
import '../../Primitives/SymEnc.primitive';
@@ -182,14 +181,14 @@ Game Right(SymEnc E) {
182181
}
183182
}
184183
185-
export as OneTimeSecrecy;
184+
export as INDOT;
186185
```
187186

188187
The adversary submits two equal-length messages and receives an encryption of either the left or the right one. A fresh key is sampled per query, so no key reuse is implied. One-time secrecy holds if the adversary cannot tell which message was encrypted.
189188

190189
### CPA security (stateful game)
191190

192-
[`Games/SymEnc/CPA.game`](https://github.com/ProofFrog/examples/blob/main/Games/SymEnc/CPA.game)
191+
[`Games/SymEnc/INDCPA_MultiChal.game`](https://github.com/ProofFrog/examples/blob/main/Games/SymEnc/INDCPA_MultiChal.game)
193192

194193
```prooffrog
195194
import '../../Primitives/SymEnc.primitive';
@@ -214,14 +213,14 @@ Game Right(SymEnc E) {
214213
}
215214
}
216215
217-
export as CPA;
216+
export as INDCPA_MultiChal;
218217
```
219218

220219
Like one-time secrecy, but the key is sampled once in `Initialize` and reused across all oracle calls. The state field `k` persists from one `Eavesdrop` call to the next, modelling the chosen-plaintext attack setting where the adversary may request many encryptions under the same key.
221220

222221
### A helper game
223222

224-
[`Games/Misc/UniqueSampling.game`](https://github.com/ProofFrog/examples/blob/main/Games/Misc/UniqueSampling.game)
223+
[`Games/Helpers/Probability/UniqueSampling.game`](https://github.com/ProofFrog/examples/blob/main/Games/Helpers/Probability/UniqueSampling.game)
225224

226225
```prooffrog
227226
// Assumption: sampling uniformly from a set S is indistinguishable from

0 commit comments

Comments
 (0)