extract.sh: reproducible end-to-end (CurveField merged gen + CurveSig glue)

The verify-glue extraction (charon on the vendored ed25519-dalek with the
SHA-512/wire-format opaque boundary) is now stanza [3/4]-[4/4] of the one
extraction script, not an ad-hoc step. Regenerated artifacts identical.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
mrwulf 2026-07-04 19:50:37 +02:00
parent c177d417ab
commit d6a60b2135
2 changed files with 25 additions and 2 deletions

File diff suppressed because one or more lines are too long

View file

@ -23,7 +23,7 @@ source ~/aeneas-toolchain/env.sh
HERE="$(cd "$(dirname "$0")" && pwd)" HERE="$(cd "$(dirname "$0")" && pwd)"
CRATE=~/GitClone/FormalVerification/sources/curve25519-dalek-source/curve25519-dalek CRATE=~/GitClone/FormalVerification/sources/curve25519-dalek-source/curve25519-dalek
echo "[1/2] charon: Rust -> LLBC (field + curve_models + edwards + scalar [MERGED GEN])" echo "[1/4] charon: Rust -> LLBC (field + curve_models + edwards + scalar [MERGED GEN])"
cd "$CRATE" cd "$CRATE"
# Force the portable SERIAL backend (the one we verify): the SIMD dispatch # Force the portable SERIAL backend (the one we verify): the SIMD dispatch
# arm is `#[cfg(curve25519_dalek_backend = "simd")]`, so pinning the cfg to # arm is `#[cfg(curve25519_dalek_backend = "simd")]`, so pinning the cfg to
@ -60,8 +60,30 @@ charon cargo --preset=aeneas \
--dest-file "$HERE/CurveField.llbc" \ --dest-file "$HERE/CurveField.llbc" \
-- --no-default-features -- --no-default-features
echo "[2/2] aeneas: LLBC -> Lean (split files, CurveField.* modules)" echo "[2/4] aeneas: LLBC -> Lean (split files, CurveField.* modules)"
cd "$HERE" cd "$HERE"
aeneas -backend lean -split-files -subdir CurveField -dest gen CurveField.llbc aeneas -backend lean -split-files -subdir CurveField -dest gen CurveField.llbc
echo "[3/4] charon: ed25519-dalek verify glue -> LLBC (SHA-512 opaque)"
SIGCRATE="$(dirname "$CRATE")/ed25519-dalek"
cd "$SIGCRATE"
charon cargo --preset=aeneas \
--start-from 'crate::verifying::verify_sha512' \
--start-from 'crate::verifying::recompute_r_sha512' \
--opaque 'crate::verifying::sha512_new' \
--opaque 'crate::verifying::sha512_update' \
--opaque 'crate::verifying::sha512_finalize_bytes' \
--opaque 'crate::signature::compressed_from_bytes' \
--opaque 'curve25519_dalek' \
--opaque 'sha2' --opaque 'digest' --opaque 'ed25519' \
--opaque 'signature' --opaque 'subtle' --opaque 'zeroize' \
--exclude 'hybrid_array' --exclude 'typenum' \
--hide-marker-traits \
--dest-file "$HERE/CurveSig.llbc"
echo "[4/4] aeneas: LLBC -> Lean (CurveSig.* modules; hand-maintained"
echo " TypesExternal.lean / FunsExternal.lean are NOT overwritten)"
cd "$HERE"
aeneas -backend lean -split-files -subdir CurveSig -dest gen CurveSig.llbc
echo "Done. Now run ./check.sh to type-check the regenerated model." echo "Done. Now run ./check.sh to type-check the regenerated model."