Repository navigation
refactor(sphincs)!: remove leanSPHINCS and the hash-based signature modules it leaves orphaned - #5460
Merged
Merged
Conversation
…odules it leaves orphaned The leanVM formalization, which consumed these modules, now lives in leanEthereum/leanVM, so nothing in EthLib needs them. Remove the leanSPHINCS specification, proofs, C export, Python bindings, test vectors and their pins, and the SPHINCS parts of the documents, baselines, allowlists, labels and scripts. With leanXMSS already removed, also remove the modules that only the two schemes used: HashSig and Wots with their proofs, the SufCma game, AllPathsSatisfy, QueryAvoidance, RandomOracleDisjoint, SupportSim and HashSig/CachedReads, and in Base the ByteOrder/Bits and Bytes/Equiv proofs. Drop the crypto-pq proof shard, which is left empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tcoratger
force-pushed
the
chore/remove-sphincs
branch
from
December 4, 2026 15:36
3b14f9c to
2ab1907
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes leanSPHINCS from EthLib, with its specification, proofs, C export, Python bindings and test vectors.
leanXMSS went in #5461, so it also removes the hash-based signature modules that only the two schemes used.
The leanVM formalization, which consumed these modules, now lives in leanEthereum/leanVM.
The problem
leanSPHINCS was the largest tree in
EthLib/Cryptography, about 80,000 lines, and every proof build paid for it.Its only consumer was the leanVM formalization, which has moved to its own repository.
Once both schemes are gone, their shared frame and the generic game they were stated in have no user left.
The idea
A module goes when nothing outside the deleted trees, except the aggregators
Cryptography.lean,Proofs.leanandBase/Proofs.lean, imports it.I computed that set to a fixpoint from the import graph, so a module whose only importers are themselves removed goes too.
Everything that leanVM work holds or imports stays:
EthLib/Cryptography/LeanVm/**andAggregation/**, with their proofs, are untouched.What is removed
331 files and 88,837 lines are deleted; the whole diff is 369 files, +43 and -89,575.
Sphincs/and its root, 16 files;Proofs/Sphincs/and its root, 240 files;Exports/Sphincs.lean;sphincs.c, theethlib.cryptography.sphincspackage, thesphincs_*functions, theSPHINCS_*constants andSphincsError;bindings/python/tests/sphincs/and the vectorstests/cryptography/sphincs/(39 files), with theirtests/sources.tomlandtests/generators.tomlentries and the leanVM pin that only they read.Cryptography/HashSig.leanandCryptography/Wots.lean;Proofs/HashSig.leanandProofs/HashSig/(12 files),Proofs/Wots.leanandProofs/Wots/(2 files);Proofs/SufCma.leanandProofs/SufCma/(3 files);Proofs/AllPathsSatisfy.lean,Proofs/QueryAvoidance.lean,Proofs/RandomOracleDisjoint.leanandProofs/SupportSim.lean;Proofs/ByteOrder/Bits.leanandProofs/Bytes/Equiv.lean.crypto-pqproof shard ofci.ymlandproof_shards.py, which is left with no module.SOUNDNESS.md(the budget section, the leanSPHINCS section, its A3, A4 and D1 entries),README.md,ARCHITECTURE.md,CONTRIBUTING.md,WRITING.md, the Merkle README, the labeler and labels,vectors-slow.yml, the comment-code allowlist and the accessor baseline.tests/downstream/Consumer.leanloses its leanSPHINCS examples and the one aboutHashSig/Interchange.lean.What stays
EthLib/Cryptography/LeanVm/README.mdandAggregation/withProofs/Aggregation/: leanVM work, kept as they are, even where they name leanSPHINCS.RandomOracleWithCoins,EvalDistEq, the Keccak, sponge and permutation proofs: the VRF, the sponge proofs or other modules still import them.Proofs/Merkle/RandomOracle/SecondPreimage.lean, which explains the tweaks of a Merkle tree.For reviewers
git grep -i sphincsreturns the CHANGELOG, the two leanVM files above, and that citation.docstrings.h,contract.jsonand_native.pyiare written bylake exe gen-bindings;--checkpasses.proofs (crypto-pq), so dropping the shard blocks nothing.Checks
lake build EthLib Exports gen-bindings EthLib.Base.Proofs EthLib.Cryptography.Proofs check-decls check-accessors --wfail: passed (11,301 jobs).lake build --wfailintests/downstream: passed.lake exe gen-bindings --check: passed.check-decls EthLib EthLib.Cryptography.Proofs EthLib.Base.Proofs EthLib.Exports: 72,851 declarations, 0 findings, baseline unchanged.check-accessors: passed, 84 baseline entries.soundness_facts.py --check,check_layers.py,check_lean_layout.py,check_comment_code.py,check_fixture_pins.py,release_manifest.py --check,check_vectors.pyand its tests: passed.test_proof_shardsandtest_check_layers: 132 tests passed.ruff check,ruff format --check,ty check(also on Python 3.10),check_docstrings.py,check_python_comments.py,check_raises.py,codespell: passed.pyteston contract, errors, engine errors, VRF and Keccak: 2,784 passed, 2 skipped;pytest --collect-onlycollects 79,127 tests without an error.🤖 Generated with Claude Code