Skip to content

Conversation

maximebuyse
Copy link
Collaborator

This PR replaces #1, with the changes described in https://github.com/cryspen/home/issues/399#issuecomment-3160178752.
It implements the necessary workarounds (and adds some infrastructure) to have working hax extraction + F* lax-checking. Extraction can be done with cargo hax into fstar, and lax-checking with OTHERFLAGS="--admit_smt_queries true" make -C proofs/fstar/extraction/.

We have workarounds for:

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.

Looks pretty good already. A few comments.


/// Add an element to this.
#[inline]
pub fn push(&mut self, value: u8) {
Copy link
Member

Choose a reason for hiding this comment

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

These are public functions. We should keep them. Deleting them would be a breaking change. Let's just ignore them for hax extraction for now.

@@ -16,6 +16,7 @@ zeroize = { version = "1.8", default-features = false, features = [
"alloc",
"zeroize_derive",
] }
hax-lib = {git = "https://github.com/cryspen/hax", branch = "tls-codec-lib"}
Copy link
Member

Choose a reason for hiding this comment

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

We should track somewhere to move to a released version here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The lib changes are merged into evit, and part of the next approval batch. So once we get the approval we can upstream and make a release. I can open an issue to track.

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 the CI fails for msrv and no_std. Can you double check what's going on there? If you don't understand why it's broken and think something in the check is bad, let me know and I can have a look. but from the error, it looks there's a breaking change that makes the CI fail.

@maximebuyse
Copy link
Collaborator Author

It looks like the CI fails for msrv and no_std. Can you double check what's going on there? If you don't understand why it's broken and think something in the check is bad, let me know and I can have a look. but from the error, it looks there's a breaking change that makes the CI fail.

I fixed that. I also added a CI job for hax extraction + lax-checking.

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 think this looks pretty good now.

I'd be happy to merge this here, or upstream. Depending on whether you want to add more for a first round.

@maximebuyse
Copy link
Collaborator Author

maximebuyse commented Sep 1, 2025

Thanks! I think this looks pretty good now.

I'd be happy to merge this here, or upstream. Depending on whether you want to add more for a first round.

Thanks! I think this is a good first step, let's merge. To merge upstream, maybe it is better to wait for the hax-lib changes to be released.

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.

Sounds good. Let's get it in then

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.

2 participants