SHA-3 Verification#147
Closed
abentkamp wants to merge 2 commits into
Closed
Conversation
171ed6e to
1caa575
Compare
1caa575 to
d259907
Compare
This was referenced Jun 1, 2026
Contributor
Author
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 PR provides a hacspec-style implementation of SHA-3, closely following the FIPS202 standard, and a Lean equivalence proof connecting it to the libcrux-iot implementation. The implementations are proved equivalent up to the top-level SHA-3 and SHAKE functions (
sha256_ema, etc.). In addition, the PR provides some Rust tests to quickly check that the two implementations are equivalent, plus some additional sanity checks.Most of the code has been generated by Claude.
We had to make some changes to the libcrux-iot implementation to be able to extract it:
pi_rho_chifunctions inkeccak.rshave been split up into smaller pieces.state.rs, some variables had to be renamed (lanetolandstatetos) because they lead to name clashes in Lean.The Readme at libcrux-iot/sha3/proofs/aeneas-lean/LibcruxIotSha3/README.md contains more information about the Lean verification.
One issue that I don't have a good solution for yet: The extraction works only with a branch of
hax-evit, which must be reviewed by Evit before we are allowed to publish it.