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

ML-DSA: Work around Eurydice limitations #734

Conversation

franziskuskiefer
Copy link
Member

@franziskuskiefer franziskuskiefer commented Jan 8, 2025

This PR works around limitations and drops the associated type in the operations trait.
See AeneasVerif/eurydice#125.

Eurydice can't handle associated types right now.
So this changes it such that the Operations trait is implemented
on top of a wrapper struct for the coefficients again.
This requires the implementations of the trait to point into the struct
again. But this is more self contained than propagating the generic type
for the trait.

I couldn't measure an impact on performance or stack size with this change

Note that C extraction is using slightly newer versions of the tools here. I'm not sure if that makes a difference.

Eurydice can't handle associated types right now.
So this changes it such that the Operations trait is implemented
on top of a wrapper struct for the coefficients again.
This requires the implementations of the trait to point into the struct
again. But this is more self contained than propagating the generic type
for the trait.

I couldn't measure an impact on performance or stack size with this change
@franziskuskiefer franziskuskiefer self-assigned this Jan 8, 2025
@franziskuskiefer franziskuskiefer requested a review from a team as a code owner January 8, 2025 09:17
Copy link
Collaborator

@jschneider-bensch jschneider-bensch left a comment

Choose a reason for hiding this comment

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

Looks good, thanks 👍
Just some really minor questions/nits below.

libcrux-ml-dsa/src/polynomial.rs Outdated Show resolved Hide resolved
libcrux-ml-dsa/src/simd/avx2/arithmetic.rs Outdated Show resolved Hide resolved
libcrux-ml-dsa/src/simd/portable/encoding/error.rs Outdated Show resolved Hide resolved
@franziskuskiefer
Copy link
Member Author

@jschneider-bensch if you're happy with this, please merge it into #732.

@jschneider-bensch jschneider-bensch merged commit 8fa5aae into franziskus/mldsa-cleanup Jan 8, 2025
1 check passed
@jschneider-bensch jschneider-bensch deleted the franziskus/mldsa-cleanup-extraction branch January 8, 2025 12:23
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