Sign uses Weighted Query Cost At Most
Fischlin.sign_usesWeightedQueryCostAtMost
Plain-language statement
Fischlin signing has weighted query cost at most ρ • (|Ω| • w) whenever every random-oracle query carries cost at most w.
Exact Lean statement
theorem sign_usesWeightedQueryCostAtMost
{κ : Type} [AddCommMonoid κ] [PartialOrder κ] [IsOrderedAddMonoid κ]
[CanonicallyOrderedAdd κ]
(runtime : QueryImpl (fischlinROSpec Stmt Commit Chal Resp ρ b M) m)
(pk : Stmt) (sk : Wit) (msg : M)
(costFn : (fischlinROSpec Stmt Commit Chal Resp ρ b M).Domain → κ) (w : κ)
(hcost : ∀ t, costFn t ≤ w) :
QueryCost[ (Fischlin σ hr ρ b S M).sign pk sk msg in runtime by costFn ] ≤
ρ • (FinEnum.card Chal • w)Formal artifact
Lean source
theorem sign_usesWeightedQueryCostAtMost {κ : Type} [AddCommMonoid κ] [PartialOrder κ] [IsOrderedAddMonoid κ] [CanonicallyOrderedAdd κ] (runtime : QueryImpl (fischlinROSpec Stmt Commit Chal Resp ρ b M) m) (pk : Stmt) (sk : Wit) (msg : M) (costFn : (fischlinROSpec Stmt Commit Chal Resp ρ b M).Domain → κ) (w : κ) (hcost : ∀ t, costFn t ≤ w) : QueryCost[ (Fischlin σ hr ρ b S M).sign pk sk msg in runtime by costFn ] ≤ ρ • (FinEnum.card Chal • w) := by classical let _ : SampleableType Chal := inferInstance have hlen : (FinEnum.toList Chal).length = FinEnum.card Chal := by simp [FinEnum.toList] let repStep : (Fin ρ → Commit × PrvState) → Fin ρ → AddWriterT κ m (Commit × Chal × Resp) := fun commits i => do let comVec : Fin ρ → Commit := fun j => (commits j).1 let comList := List.ofFn comVec let sc_i := (commits i).2 let result ← fischlinSearchAuxWithAddCost σ (runtime := runtime) (pk := pk) (sk := sk) (sc := sc_i) (msg := msg) (comList := comList) (i := i) (FinEnum.toList Chal) (none : Option (Chal × Resp × Fin (2 ^ b))) costFn match result with | some (ω, resp) => pure (comVec i, ω, resp) | none => pure (comVec i, default, default) have hrep : ∀ commits i, AddWriterT.PathwiseCostAtMost (repStep commits i) (FinEnum.card Chal • w) := by intro commits i let comVec : Fin ρ → Commit := fun j => (commits j).1 let comList := List.ofFn comVec have hsearch : AddWriterT.PathwiseCostAtMost (fischlinSearchAuxWithAddCost σ (runtime := runtime) (pk := pk) (sk := sk) (sc := (commits i).2) (msg := msg) (comList := comList) (i := i) (FinEnum.toList Chal) (none : Option (Chal × Resp × Fin (2 ^ b))) costFn) ((FinEnum.toList Chal).length • w) := fischlinSearchAuxWithAddCost_pathwiseCostAtMost σ (κ := κ) (runtime := runtime) (pk := pk) (sk := sk) (sc := (commits i).2) (msg := msg) (comList := comList) (i := i) (challenges := FinEnum.toList Chal) (best := none) (costFn := costFn) (w := w) (hcost := hcost) let finish : Option (Chal × Resp) → AddWriterT κ m (Commit × Chal × Resp) | some (ω, resp) => pure (comVec i, ω, resp) | none => pure (comVec i, default, default) have hcont : ∀ result : Option (Chal × Resp), AddWriterT.PathwiseCostAtMost (finish result) 0 := by intro result cases result with | none => simpa [finish] using AddWriterT.pathwiseCostAtMost_pure (m := m) ((comVec i, default, default) : Commit × Chal × Resp) | some pair => rcases pair with ⟨ω, resp⟩ simpa [finish] using AddWriterT.pathwiseCostAtMost_pure (m := m) ((comVec i, ω, resp) : Commit × Chal × Resp) refine AddWriterT.pathwiseCostAtMost_mono (AddWriterT.pathwiseCostAtMost_bind (w₁ := (FinEnum.toList Chal).length • w) (w₂ := 0) hsearch hcont) ?_ simp [hlen] let commitComp : AddWriterT κ m (Fin ρ → Commit × PrvState) := Fin.mOfFn ρ fun _ => (liftM (σ.commit pk sk) : AddWriterT κ m (Commit × PrvState)) have hcommit : AddWriterT.PathwiseCostAtMost commitComp 0 := by have hstep : AddWriterT.PathwiseCostAtMost (liftM (σ.commit pk sk) : AddWriterT κ m (Commit × PrvState)) 0 := by change AddWriterT.PathwiseCostAtMost (monadLift (monadLift (σ.commit pk sk) : m (Commit × PrvState)) : AddWriterT κ m (Commit × PrvState)) 0 exact AddWriterT.pathwiseCostAtMost_monadLift _ simpa [commitComp] using (AddWriterT.pathwiseCostAtMost_fin_mOfFn (n := ρ) (k := 0) (f := fun _ => (liftM (σ.commit pk sk) : AddWriterT κ m (Commit × PrvState))) (fun _ => hstep)) suffices AddWriterT.PathwiseCostAtMost (commitComp >>= fun commits => Fin.mOfFn ρ (repStep commits)) (ρ • (FinEnum.card Chal • w)) by have hsign : HasQuery.Program.withAddCost (fun [HasQuery (fischlinROSpec Stmt Commit Chal Resp ρ b M) (AddWriterT κ m)] => (Fischlin (m := AddWriterT κ m) σ hr ρ b S M).sign pk sk msg) runtime costFn = (commitComp >>= fun commits => Fin.mOfFn ρ (repStep commits)) := by simp only [Fischlin, HasQuery.Program.withAddCost, repStep, commitComp] refine congrArg (fun k => commitComp >>= k) ?_ funext commits refine congrArg (fun f : Fin ρ → AddWriterT κ m (Commit × Chal × Resp) => Fin.mOfFn ρ f) ?_ funext i let comVec : Fin ρ → Commit := fun j => (commits j).1 let comList := List.ofFn comVec let finish : AddWriterT κ m (Option (Chal × Resp)) → AddWriterT κ m (Commit × Chal × Resp) := fun oa => do let result ← oa match result with | some (ω, resp) => pure (comVec i, ω, resp) | none => pure (comVec i, default, default) convert congrArg finish (fischlinSearchAux_eq_withAddCost σ (runtime := runtime) (pk := pk) (sk := sk) (sc := (commits i).2) (msg := msg) (comList := comList) (i := i) (challenges := FinEnum.toList Chal) (best := none) (costFn := costFn)) using 1; rfl simpa [HasQuery.UsesCostAtMost, hsign] using this simpa [zero_add] using (AddWriterT.pathwiseCostAtMost_bind (w₁ := 0) (w₂ := ρ • (FinEnum.card Chal • w)) hcommit (fun commits => AddWriterT.pathwiseCostAtMost_fin_mOfFn (n := ρ) (k := FinEnum.card Chal • w) (fun i => hrep commits i)))- Project
- VCVio
- License
- Apache-2.0
- Commit
- 2ceb2d825ee3
- Source
- VCVio/CryptoFoundations/Fischlin/CostAccounting.lean:494-606
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Expected Cost Nat eq sum tail probs of pathwise Cost At Most
AddWriterT.expectedCostNat_eq_sum_tail_probs_of_pathwiseCostAtMost
Plain-language statement
Finite tail-sum formula for natural-valued writer cost under a pathwise upper bound. If every execution path of oa incurs cost at most n, then the tail probabilities vanish above n, so the infinite tail sum truncates to Finset.range n.
Source project: VCVio
Person-level attribution pending.
IND CPA advantage to Real le sum step signed Advantage Real abs
AsymmEncAlg.IND_CPA_advantage_toReal_le_sum_step_signedAdvantageReal_abs
Plain-language statement
Planned generic one-time-to-many-time lift: bounded multi-query IND-CPA advantage is at most the sum of the extracted one-time signed advantages over the first q fresh LR queries.
Source project: VCVio
Person-level attribution pending.
IND CPA LR hybrid Game q eval Dist eq left of Makes At Most Queries
AsymmEncAlg.IND_CPA_LR_hybridGame_q_evalDist_eq_left_of_MakesAtMostQueries
Plain-language statement
If an adversary makes at most q fresh LR queries, then the leftUntil = q LR-hybrid is the all-left endpoint game.
Source project: VCVio
Person-level attribution pending.