While memory-safety in programming languages is "important;" cf. https://media.defense.gov/2023/Dec/06/2003352724/-1/-1/0/THE-CASE-FOR-MEMORY-SAFE-ROADMAPS-TLP-CLEAR.PDF ,
the underlying compiler technology -- LLVM -- of Rust seems to regularly exhibit terrible constant-timeness in practice; seemingly often requiring highly non-standard programming practices to ensure constant-time of cryptographic implementations.
Speaking as a maintainer of that library, after Kyberslash we tried to add automatic linting for this sort of issue (the authors of the popular Rust linter "clippy" actually added a lint to detect use of division and modulus operations for us after Kyberslash), but it didn't detect this problem.It may because we have various lint exceptions configured I should go through and remove. I still need to investigate.
--
You received this message because you are subscribed to the Google Groups "pqc-forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pqc-forum+...@list.nist.gov.
To view this discussion visit https://groups.google.com/a/list.nist.gov/d/msgid/pqc-forum/686b8c53-7cba-4877-a30c-dc0c5ac42b0dn%40list.nist.gov.
Thank you for the detailed discussion —
One observation as an outsider: issues like this suggest that “constant-time” is no longer a purely algorithmic or even implementation-level property, but an emergent property of the full compilation and execution pipeline (language → compiler → optimizer → microarchitecture).
In that sense, many of these findings are less about specific primitives (ML-DSA, Kyber, etc.) and more about the lack of runtime observability into behavioral deviations that do not violate functional correctness.
As PQC transitions from reference implementations into production systems, it seems likely that side-channel risk will increasingly manifest as gradual behavioral drift rather than immediate failure — particularly in highly optimized environments.
I don’t have a proposed fix here, but I think this framing may be useful when thinking about future tooling, testing, and assurance models for PQC deployments.
Thanks again to the maintainers for surfacing this so transparently.
Regards
Vijay S
--
You received this message because you are subscribed to the Google Groups "pqc-forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pqc-forum+...@list.nist.gov.
r1.0 /= TwoGamma2::U32;To view this discussion visit https://groups.google.com/a/list.nist.gov/d/msgid/pqc-forum/9b881899-304c-414c-8c5d-e06c13d96f87%40app.fastmail.com.
As interesting as theoretical conversations on the risk of timing side-channels introduced at code generation time by optimizing compilers are... this does not look like such a case?The issue was the following line of Rust code, which was simply a variable-time operation.r1.0 /= TwoGamma2::U32;I don't think this teaches us anything on Rust, LLVM, optimizing compilers, or the need for special intrinsics. The exact same code would have been variable-time in every other language and with every other compiler.
It appears the only things that would have avoided this systematically would have been static analysis to forbid division operations, special types that forbid all variable-time operations (which don't exist in any language IIUC), or maybe dynamic analysis like ctgrind.I say maybe because I reported a similar issue in BoringSSL recently (a modulo operation instead of a division), and AFAIK BoringSSL applies ctgrind pretty systematically, but it failed to detect this, possibly because it does not consider division/modulo of "uninitialized" memory to be illegal. https://boringssl-review.googlesource.com/c/boringssl/+/83348
I thought this is already implemented? There was a press-release from
December
(https://blog.trailofbits.com/2025/12/02/introducing-constant-time-support-for-llvm-to-protect-cryptographic-code/)
and I heard excited talk about it.