Skip to content

Fix hax extraction of crates depending on some libcrux crates.#1263

Closed
maximebuyse wants to merge 3 commits intomainfrom
aesgcm-core-models-hax
Closed

Fix hax extraction of crates depending on some libcrux crates.#1263
maximebuyse wants to merge 3 commits intomainfrom
aesgcm-core-models-hax

Conversation

@maximebuyse
Copy link
Contributor

@maximebuyse maximebuyse commented Dec 8, 2025

When extracting a crate with hax that depends on some libcrux crates, we need these libcrux crates to compile under the hax cfg. This can be prevented by:

  • Some items being marked cfg(not(hax)) (using hax_lib::exclude is better to remove the problematic items for verification of libcrux using hax).
  • The use of libcrux-intrinsics instead of driect use of intrinsics from core_arch needs to be consistent across different libcrux crates.

@maximebuyse maximebuyse force-pushed the aesgcm-core-models-hax branch 2 times, most recently from bda9b4c to b2d4a36 Compare December 8, 2025 12:50
@maximebuyse maximebuyse force-pushed the aesgcm-core-models-hax branch from b2d4a36 to 9b18681 Compare December 8, 2025 13:31
@maximebuyse
Copy link
Contributor Author

There is still a problem with the use of transmute between u128 and __m128i under the hax feature, but this doesn't block extraction.

@maximebuyse maximebuyse changed the title Use core models instead of core-arch with hax for intrinsics to fix extraction. Fix hax extraction of crates depending on some libcrux crates. Dec 9, 2025
@maximebuyse
Copy link
Contributor Author

This breaks the hax extraction of ml-kem because of this macro. We need the impl produced by the macro to be excluded from the extraction, but adding hax_lib::exclude inside the macro means other crates using this macro need to have hax-lib as a dependency, which is not the case now. Maybe we could add this attribute conditionnally.

cfm added a commit to cfm/hpke-rs that referenced this pull request Dec 9, 2025
cfm added a commit to freedomofpress/securedrop-protocol that referenced this pull request Dec 9, 2025
@jschneider-bensch jschneider-bensch added the waiting-on-author Status: This is awaiting some action from the author. label Jan 20, 2026
@franziskuskiefer
Copy link
Member

@maximebuyse what's the state here? We should try to get this resolved to allow extraction of dependent crates.

@maximebuyse
Copy link
Contributor Author

@maximebuyse what's the state here? We should try to get this resolved to allow extraction of dependent crates.

I think I found a way to make it work! I opened a new PR (#1312), I don't want to break things for freedomofpress/securedrop-protocol#131 by messing up this branch.

@maximebuyse maximebuyse closed this Feb 5, 2026
cfm added a commit to cfm/securedrop-protocol that referenced this pull request Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on-author Status: This is awaiting some action from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants