It looks like this may be close, but for the record:

The LF has a dedicated project for ML-DSA: 
https://github.com/pq-code-package/mldsa-native (part of the Post-Quantum 
Cryptography Alliance). It's derived from the reference implementation and adds 
automatically verified memory-safety + type-safety (= bounds-tracking) and a 
uniform backend interface for assembly optimizations; see the README for more 
details. It's licensed under Apache-2.0 OR MIT OR ISC.

If you are sure that the kernel will never need sign/keygen support, or support 
for optimized assembly, the current ad-hoc patch may be fine. Otherwise, the 
challenges are likely just delayed, e.g. how to safely re-use parts of the 
current code for the timing-sensitive signing, or in contexts with other bounds 
assumptions, or how to integrate assembly optimizations. It may not seem so, 
but this is difficult to get right and where maintainability gets challenging.

Verification here is a vehicle for maintainability: If you change any 
arithmetic code -- say you decide to do less modular reduction for performance 
-- you currently need very careful review that the bounds still check out in 
the worst case. In mldsa-native, this is re-checked automatically.

mldsa-native is production-ready and in the process of being integrated into 
Amazon's AWS-LC crypto library; the sibling-project mlkem-native 
https://github.com/pq-code-package/mlkem-native already has been. mldsa-native 
is not yet a drop-in for the kernel, however. At the least, memory usage needs 
to be brought down and allocation be made flexible. We're working on it, and if 
the kernel community was interested in it, it'd give impetus to accelerate the 
work.

This is just so you're aware. If mldsa-native is of interest, let us know -- it 
would be great to collaborate across the LF instead of duplicating efforts.

Thanks,
Hanno & Matthias (maintainers of mldsa-native)

Reply via email to