Skip to content

Commit 40daf0c

Browse files
proof(SafePassword): TENTATIVE DISCHARGE 3 default-params validators via Refl (proven#90, #107) (#118)
MEDIUM-confidence experiment per [proven#107](#107) — concrete-literal if-chain reduction. \`\`\`idris public export defaultArgon2Valid : isRight (validateArgon2Params Hash.defaultArgon2Params) = True defaultArgon2Valid = Refl public export defaultBcryptValid : isRight (validateBcryptParams Hash.defaultBcryptParams) = True defaultBcryptValid = Refl public export defaultScryptValid : isRight (validateScryptParams Hash.defaultScryptParams) = True defaultScryptValid = Refl \`\`\` All three OWEDs cite "Nat-literal normalisation gap". If Idris2 0.8.0 reduces literal-vs-literal comparisons (`3 < 1 = False`, `65536 < 8192 = False`, etc.) structurally, Refl closes. This is one of the higher-uncertainty experiments — Nat `<` on literals MAY or MAY NOT reduce without an explicit case-split. If CI rejects, close and revert. Refs #90 #107 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8cc9706 commit 40daf0c

1 file changed

Lines changed: 12 additions & 16 deletions

File tree

src/Proven/SafePassword/Proofs.idr

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -172,25 +172,21 @@ public export
172172
||| available, or refactor `defaultArgon2Params` to `Bits32`-typed
173173
||| fields that reduce eagerly.
174174
public export
175-
0 defaultArgon2Valid : isRight (validateArgon2Params Hash.defaultArgon2Params) = True
176-
177-
||| OWED: `defaultBcryptParams` (`cost = 12`) clears
178-
||| `validateBcryptParams`. Same Nat-literal-normalisation blocker as
179-
||| `defaultArgon2Valid` (Family 4) — the `if 12 < 10 thenelse if
180-
||| 12 > 31 thenelse Right p` chain does not reduce by `Refl`
181-
||| despite both leaves being constant-folded. Discharge once a
182-
||| `Data.Nat` reflective tactic for `<` / `>` on literal `Nat`s is
183-
||| available.
175+
defaultArgon2Valid : isRight (validateArgon2Params Hash.defaultArgon2Params) = True
176+
defaultArgon2Valid = Refl
177+
178+
||| TENTATIVE DISCHARGE: `defaultBcryptParams` (`cost = 12`) clears
179+
||| `validateBcryptParams`. Concrete-literal if-chain.
184180
public export
185-
0 defaultBcryptValid : isRight (validateBcryptParams Hash.defaultBcryptParams) = True
181+
defaultBcryptValid : isRight (validateBcryptParams Hash.defaultBcryptParams) = True
182+
defaultBcryptValid = Refl
186183

187-
||| OWED: `defaultScryptParams` (`n=16384, r=8, p=1, keyLength=32`)
188-
||| clears `validateScryptParams`. Same Nat-literal-normalisation
189-
||| blocker as `defaultArgon2Valid` / `defaultBcryptValid` (Family 4).
190-
||| Discharge once a `Data.Nat` reflective tactic for `<` on literal
191-
||| `Nat`s is available.
184+
||| TENTATIVE DISCHARGE: `defaultScryptParams` (`n=16384, r=8, p=1,
185+
||| keyLength=32`) clears `validateScryptParams`. Concrete-literal
186+
||| if-chain over 4 fields.
192187
public export
193-
0 defaultScryptValid : isRight (validateScryptParams Hash.defaultScryptParams) = True
188+
defaultScryptValid : isRight (validateScryptParams Hash.defaultScryptParams) = True
189+
defaultScryptValid = Refl
194190

195191
--------------------------------------------------------------------------------
196192
-- Constant-Time Comparison Proofs

0 commit comments

Comments
 (0)