Skip to content

Conversation

Parrot7483
Copy link
Collaborator

This PR adds lax checking for SHA3. It also includes some changes towards full type checking. The theta, pi and chi functions are admitted.

It is based on my develop branch which changes are requested in PR 1076

Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I only looked at the Rust changes and not inside the hax/F* blobs.

@Parrot7483
Copy link
Collaborator Author

One problem is this issue. I always get the wrong explicit_panic in F*.

@Parrot7483 Parrot7483 mentioned this pull request Aug 19, 2025
@Parrot7483
Copy link
Collaborator Author

One problem is this issue. I always get the wrong explicit_panic in F*.

Fixed in HAX cryspen/hax@ad0e608

Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you force pushed. That breaks the entire review process. Please don't force push during the review.

Also, please enable laxing to the CI so that we don't break it again.
Then I think this is good to go.

@Parrot7483
Copy link
Collaborator Author

It looks like you force pushed. That breaks the entire review process. Please don't force push during the review.

Yes, sorry. I rebased because I wanted the Makefile changes to be merged separately.

@Parrot7483
Copy link
Collaborator Author

The new CI does not work with the Makefile. Will investigate. My first time working with Github workflows.

@Parrot7483
Copy link
Collaborator Author

CI still fails because hax-lib is pulled from

--include /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hax-lib-0.3.2/proof-libs/fstar/core 
--include /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hax-lib-0.3.2/proof-libs/fstar/rust_primitives 
--include /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hax-lib-0.3.2/proofs/fstar/extraction

@W95Psp
Copy link
Member

W95Psp commented Sep 2, 2025

As we discussed on Google Chat, the problem here probably has nothing to do with the hax installation action.
The Makefile of F* will ask cargo for the path in which it has to find hax-lib.
So here, I believe you should just pin hax-lib in Cargo.toml to the git commit you want to use.

Does that make sense?

@Parrot7483
Copy link
Collaborator Author

The Makefile.base automatically finds hax-lib/proofs-lib/fstar/code twice. That's why I use the HAX_HOME variable in the SHA3 Makefile

--include /home/runner/.cargo/git/checkouts/hax-580ebeee043cdea1/6b34a68/hax-lib/proof-libs/fstar/core
--include /home/runner/.cargo/git/checkouts/hax-580ebeee043cdea1/6b34a68/hax-lib/proof-libs/fstar/rust_primitives
--include /home/runner/.cargo/git/checkouts/hax-580ebeee043cdea1/6b34a68/hax-lib/proofs/fstar/extraction
--include /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hax-lib-0.3.2/proof-libs/fstar/core
cargo tree --invert registry+https://github.com/rust-lang/crates.io-index#[email protected]
+ command cargo tree --invert registry+https://github.com/rust-lang/crates.io-index#[email protected]
hax-lib v0.3.2
├── libcrux-intrinsics v0.0.3 (/home/tristan/Repositories/libcrux/libcrux-intrinsics)
│   └── libcrux-sha3 v0.0.3 (/home/tristan/Repositories/libcrux/libcrux-sha3)
└── libcrux-secrets v0.0.3 (/home/tristan/Repositories/libcrux/secrets)
    └── libcrux-traits v0.0.3 (/home/tristan/Repositories/libcrux/traits)
        └── libcrux-sha3 v0.0.3 (/home/tristan/Repositories/libcrux/libcrux-sha3)
cargo tree --invert git+https://github.com/cryspen/hax.git?rev=6b34a68a0b38cd2aff09a4ad05569d712620af27#[email protected]
+ command cargo tree --invert 'git+https://github.com/cryspen/hax.git?rev=6b34a68a0b38cd2aff09a4ad05569d712620af27#[email protected]'
hax-lib v0.3.2 (https://github.com/cryspen/hax.git?rev=6b34a68a0b38cd2aff09a4ad05569d712620af27#6b34a68a)
└── libcrux-sha3 v0.0.3 (/home/tristan/Repositories/libcrux/libcrux-sha3)

@W95Psp
Copy link
Member

W95Psp commented Sep 2, 2025

Oh, I see, I recall your PR introducing HAX_HOME in the README.
I think this is not so great: now, you can have a Rust hax-lib inconsistant with the F* hax-lib.

Looking at the commit change, I don't see where HAX_HOME is supposed to be defined, in CI.
The libcrux jobs CI are not using the flake.nix from this repo.

@Parrot7483
Copy link
Collaborator Author

Parrot7483 commented Sep 2, 2025

I changed the version of hax-lib in root Cargo.toml to use the latest commit. Only using latest version of hax-lib in libcrux-sha3/Cargo.toml causes the Makefile.generic to find different versions of hax-lib and then verification fails.

What do you think @franziskuskiefer

@franziskuskiefer
Copy link
Member

I changed the version of hax-lib in root Cargo.toml to use the latest commit. Only using latest version of hax-lib in libcrux-sha3/Cargo.toml causes the Makefile.generic to find different versions of hax-lib and then verification fails.

What do you think @franziskuskiefer

That's ok to get this in. But please file a follow-up issue to get this fixed.

Also, we need to get the hax action fixed to avoid this hack. I filed hacspec/hax-actions#5 for that.

@W95Psp
Copy link
Member

W95Psp commented Sep 3, 2025

Thanks for filing the issue, Franziskus, I replied there. I believe this isn’t something the action can address, as it works as intended in this case.
What F* library picked is decided by the Makefile that lives in this repo, the action has no power over it.

IMO, the way to improve things here is to allocate time on the workbench to kill makefiles altogether.

@franziskuskiefer
Copy link
Member

Ok, then we'll have to get this fixed in here properly before we can merge it.

@W95Psp
Copy link
Member

W95Psp commented Sep 3, 2025

You can now update hax-lib to 0.3.4, hax was released.

@Parrot7483
Copy link
Collaborator Author

I created a separate bump #1127.

I will clean up the last couple commits and rebase.

- add a `--portable` flag for extract in the python build script
- add a `clean` option to the python build script
- remove F* interface generation
- add a Makefile for verification
- remove non default interative prove config
- change .gitignore
Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, almost there. Just a few nits, then we can get this in.

- typo
- yml formatting
- add workflow path
- remove libcrux-traits feature
- remove sha3-extract-portable-hax-status
@Parrot7483 Parrot7483 requested review from franziskuskiefer and removed request for karthikbhargavan September 8, 2025 09:14
Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last thing (that would fail ci)

Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Let's get this in.

@Parrot7483 Parrot7483 added this pull request to the merge queue Sep 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 10, 2025
@Parrot7483
Copy link
Collaborator Author

I don't see an error in the log that failed. What is the problem here?

@franziskuskiefer
Copy link
Member

franziskuskiefer commented Sep 11, 2025

Looks like the branch is pretty out of date. Updating may fix it. If not, C extraction must be updated.

@franziskuskiefer franziskuskiefer added this pull request to the merge queue Sep 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 11, 2025
@franziskuskiefer franziskuskiefer added this pull request to the merge queue Sep 11, 2025
Merged via the queue into cryspen:main with commit 4f028e0 Sep 11, 2025
102 checks passed
@Parrot7483 Parrot7483 deleted the sha3-lax-check branch September 11, 2025 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants