Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C extraction for ML-DSA #710

Merged
merged 29 commits into from
Dec 16, 2024
Merged

C extraction for ML-DSA #710

merged 29 commits into from
Dec 16, 2024

Conversation

franziskuskiefer
Copy link
Member

@franziskuskiefer franziskuskiefer commented Dec 9, 2024

This PR makes all necessary to extract C code from ML-DSA.

  • It updates the F* code that still laxes.
  • It includes a minimal self test.

To generate the C code, run

./c.sh --config cg.yaml --out cg --no-glue --no-unrolling --no-karamel_include --no-karamel_include --mldsa65

Follow ups

  • The generated code right now needs to be edited to remove the empty structs (see Drop (empty) unused structs AeneasVerif/eurydice#107).
  • The C boilerplate, tests, benchmarks need to be cleaned up in a follow up.
  • The avx2 variant may still have issues.
  • The stack size used by the C code is too large.

Note that this PR is on top of #707.
This works towards #706 but doesn't close it yet (see follow ups).

@franziskuskiefer franziskuskiefer requested a review from a team as a code owner December 9, 2024 10:27
@franziskuskiefer franziskuskiefer self-assigned this Dec 9, 2024
keks
keks previously requested changes Dec 10, 2024
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.

Some of my comments are nits, some a questions, but I think by and large this isn't controversial :)

libcrux-sha3/src/lib.rs Outdated Show resolved Hide resolved
libcrux-sha3/src/lib.rs Show resolved Hide resolved
libcrux-ml-dsa/src/hash_functions.rs Outdated Show resolved Hide resolved
libcrux-ml-dsa/src/hash_functions.rs Show resolved Hide resolved
libcrux-ml-dsa/src/ml_dsa_generic/instantiations/avx2.rs Outdated Show resolved Hide resolved
libcrux-ml-dsa/src/encoding/t1.rs Outdated Show resolved Hide resolved
libcrux-ml-dsa/src/matrix.rs Show resolved Hide resolved
Base automatically changed from franziskus/mldsa-c1 to main December 10, 2024 16:34
@github-actions github-actions bot dismissed keks’s stale review December 11, 2024 10:09

Review re-requested

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 looks good and is ready to merge now, thanks! 👍

@franziskuskiefer franziskuskiefer added this pull request to the merge queue Dec 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 16, 2024
@franziskuskiefer franziskuskiefer added this pull request to the merge queue Dec 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Dec 16, 2024
@franziskuskiefer franziskuskiefer added this pull request to the merge queue Dec 16, 2024
Merged via the queue into main with commit 5d76f68 Dec 16, 2024
52 checks passed
@franziskuskiefer franziskuskiefer deleted the franziskus/mldsa-c2 branch December 16, 2024 18:48
@franziskuskiefer franziskuskiefer mentioned this pull request Dec 20, 2024
9 tasks
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