Skip to content

Conversation

@jschneider-bensch
Copy link
Contributor

@jschneider-bensch jschneider-bensch commented Oct 29, 2025

This PR provides a C extraction for ML-DSA and updates the C extractions for SHA3 and ML-KEM to work with Eurydice revision cdf02f9d8ed0d73f88c0a495c5b79359a51398fc.

CI will fail at the moment, because the latest published libcrux-c docker image runs an older version of Eurydice. Should work once cryspen/libcrux#1237 is merged.

@jschneider-bensch
Copy link
Contributor Author

At this point the extraction and build succeed, but the test fails.

@jschneider-bensch
Copy link
Contributor Author

The failing test was due to an apparently incorrect translation of a .step_by(4) range loop in a cloop! macro. I've replaced that with manual indexing, and now the results are correct.

@jschneider-bensch jschneider-bensch changed the title [ML-DSA] C extraction [SHA3 / ML-KEM/ ML-DSA] C extraction Nov 19, 2025
Copy link
Member

@keks keks left a comment

Choose a reason for hiding this comment

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

The changes to the Rust code look good to me. There is a bunch of commented old code in the shell script, let's remove that. I like the new logic for handling dependencies, it's a lot cleaner. I expect it works just as well for distinguishing kebab-case and snake-case?

Otherwise I was not able to extract the ML-DSA code, but it looks like it worked for you. Maybe let's talk to see what I am doing wrong.

Copy link
Member

@keks keks left a comment

Choose a reason for hiding this comment

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

I think this mostly looks pretty good! I just had the pleasure of doing a proper deep update of the glue in another project, so I had that on my mind when I reviewed this, and it looks like this is pretty out of date.

Here is the glue for our Eurydice version, but maybe it has too much stuff in it: https://github.com/AeneasVerif/eurydice/blob/cdf02f/include/eurydice_glue.h

I mostly commented on the one that was added to ML-DSA, but I suppose we might also have in ML-KEM and SHA3.

Otherwise I think this looks good!

@jschneider-bensch
Copy link
Contributor Author

I removed a bunch of stuff from the glue that you pointed out 👍

Most of the glue will hopefully soon be upstream glue anyway. I tried the split header version of Eurydice and that seemed to work fine, for the most part.

Copy link
Member

@keks keks left a comment

Choose a reason for hiding this comment

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

Thanks, this looks good to go now!

@jschneider-bensch jschneider-bensch merged commit 9a00a41 into main Dec 4, 2025
35 checks passed
@jschneider-bensch jschneider-bensch deleted the jonas/mldsa-c-extraction-ci branch December 4, 2025 14:57
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