risc0-ed25519-verified/verification/Proofs
mrwulf 6fe31be80d Add scalar-layer foundation (Scalar52 arithmetic mod ℓ)
Transpile the Scalar52 limb backend (backend::serial::u64::scalar
add/sub/mul/square/montgomery_*) from Rust to Lean via Charon/Aeneas,
scoped at the function level to the iterator-free arithmetic core.

  - verification/extract-scalar.sh: function-level Charon/Aeneas extraction.
    This fork (v4.1.3) inlines a local `black_box` (a volatile read used as an
    optimization barrier) inside Scalar52::sub; charon cannot translate the
    `&raw const` it lowers to, so it is marked --opaque and modeled below.
  - verification/gen/CurveScalar/{Types,Funs}.lean: transpiled model (27 defs)
  - verification/gen/CurveScalar/FunsExternal.lean: hand-written model of
    Scalar52::sub::black_box as the identity on u64 (a volatile read returns
    the value written; the qualifier is only an optimization barrier).
    TypesExternal.lean is decl-free — this fork pulls in no external types
    (unlike v5 dalek, which routes sub through subtle::Choice).
  - verification/Proofs/ScalarDenote.lean: semantic foundation — Scalar52
    denotation into ℤ/ℓℤ, limb-bound invariant, and L_val (the transpiled
    constants::L denotes exactly the group order ℓ, kernel-checked).
  - verification/check-scalar.sh: guarded compile of the gen modules plus the
    denotation foundation.

check-scalar.sh passes: gen compiles; denotation + L = ℓ proven.
add/sub/mul remain in progress.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 21:24:39 +02:00
..
AddSpec.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00
ConstSpecs.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00
Denote.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00
EdAddAffNiels.lean lean-guard: disable core dumps (no more apport popups on capped aborts) 2026-07-02 16:23:30 +02:00
EdAddProjNiels.lean lean-guard: disable core dumps (no more apport popups on capped aborts) 2026-07-02 16:23:30 +02:00
EdConvert.lean lean-guard: disable core dumps (no more apport popups on capped aborts) 2026-07-02 16:23:30 +02:00
EdCurve.lean lean-guard: disable core dumps (no more apport popups on capped aborts) 2026-07-02 16:23:30 +02:00
EdDenote.lean lean-guard: disable core dumps (no more apport popups on capped aborts) 2026-07-02 16:23:30 +02:00
EdDouble.lean lean-guard: disable core dumps (no more apport popups on capped aborts) 2026-07-02 16:23:30 +02:00
EdMain.lean lean-guard: disable core dumps (no more apport popups on capped aborts) 2026-07-02 16:23:30 +02:00
FeQ.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00
Field.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00
FieldMain.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00
InvertSpec.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00
MulSpec.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00
P25519.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00
ReduceSpec.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00
ScalarDenote.lean Add scalar-layer foundation (Scalar52 arithmetic mod ℓ) 2026-07-02 21:24:39 +02:00
Square2Spec.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00
SquareSpec.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00
SubNegSpec.lean field layer: proofs pass, fieldImplementation axiom-clean 2026-07-02 14:38:52 +02:00