-
Notifications
You must be signed in to change notification settings - Fork 17
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
Allow hax extraction for ML-DSA #558
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Two nits, then we can get this in.
Oh and I created a conflict with #524 that need to get resolved. |
After merging and resolving, more of the AVX2 implementation seems to be going through hax, probably because the multiplexing works 👍 |
This PR will make it possible to extract ML-DSA to F*.
match
scrutinees to known-size types as a workaround for F*: pattern matching is disallowed onusize
s,isize
s (+u128
/i128
/f32
/f64
) hax#464loop/continue/break
-style rejection sampling with a bounded loop. As @xvzcf had already pointed out, the probability of the bounded rejection sampling to not succeed within 576 attempts is smaller than 2^128. Nonetheless, I've introduced aSigningError
type to indicate this, so we don't panic, even in this most unlikely case.RefMut
issues inencoding::signature
: Solved this by accessingsignature[offset + ...]
directly instead of usinglet hint_serialized = &mut signature[offset..]
.FunctionalizeLoops
issue inencoding::signature
: The error message was a bit opaque, in that the issue was early returns in this function. I've replaced them with some (rather inelegant, I'm afraid) flag and that's used to manually breaks out of the loops and signals an error should be returned at the end.cargo hax into fstar