Skip to content

[ML-DSA] Runtime Safety Annotations#187

Open
jschneider-bensch wants to merge 22 commits into
mainfrom
jonas/mldsa-runtime-safety
Open

[ML-DSA] Runtime Safety Annotations#187
jschneider-bensch wants to merge 22 commits into
mainfrom
jonas/mldsa-runtime-safety

Conversation

@jschneider-bensch

@jschneider-bensch jschneider-bensch commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

This PR adds runtime safety annotations for parts of ML-DSA. It covers:

  • everything for the portable implementation of the Operations trait, i.e. arithmetic, encoding, sampling, (i)NTT
  • building on Operations, everything in the top-level modules polynomial and ntt.
  • all the top-level encoding modules, except encoding::signature

I would have liked to include encoding::signature in this as well, but in particular the pre-conditions for hint (de)serialization are quite complicated and would require significant re-organization of the module. The proofs branch of mainline libcrux offers a preview of what is needed at the minimum, if you allow raw F* annotations (which we want to avoid here) and even there, I believe panic freedom is currently established only for deserialization and there is not the additional stack-optimized implementation to take into account.

@jschneider-bensch
jschneider-bensch force-pushed the jonas/mldsa-runtime-safety branch from cfc1a44 to f3bdeff Compare June 29, 2026 14:17
@jschneider-bensch

Copy link
Copy Markdown
Contributor Author

The proofs pushes my current machine with 32gb RAM quite close to the limit of available memory, so I'm not sure this is something we can run on CI. I think the issue comes from simd::portable::invntt and I've tried to alleviate it by marking functions opaque_to_smt (these have no pre-/ or post-conditions, since all the arithmetic in there is wrapping, so I don't think we're skipping proofs here). But I'm not expert enough in F* yet to fully clear the issues up.

@jschneider-bensch
jschneider-bensch marked this pull request as ready for review June 29, 2026 14:39
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.

1 participant