kkoyung · GitHub

Bump `ml-dsa` to 0.0.4 to 0.1, with refactoring. Here are some notable changes.
We switch to use `ml_dsa::SigningKey` and `ml_dsa::VerifyingKey` in the
key `Handle`, instead of using seed and encoded verifying key.
`ml_dsa::SigningKey` and `ml_dsa::VerifyingKey` store some pre-computed
value to speed up the signing and verifying calculation. The
serialization steps also change accordingly.
`ml_dsa::SigningKey` and `ml_dsa::VerifyingKey` contain expanded keys
which are pretty large. The `alloc` feature of the `module-lattice`
crate is enabled to ensure that those inner values are stored in heap
rather than stack to avoid stack overflow.
`ml-dsa` 0.1 can now handle the SPKI and PKCS#8 format of ML-DSA keys.
We can leverage these functionalities to simplify our code. In
particular, we don't need to handle the ASN.1 private key structures for
ML-DSA by ourselves. Note that we drop the optional support for the
`both` format of those ASN.1 private key structures, by switching to
using `ml-dsa` PKCS#8 functionality.
Moreover, upgrading `ml-dsa`` to 0.1.0 mitigates RUSTSEC-2025-0144.
https://rustsec.org/advisories/RUSTSEC-2025-0144.html
Testing: Covered by existing WPT tests in WebCrypto subdirectory
Fixes: Part of 42206
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>

@kkoyung

yezhizhen

yezhizhen

@TimvdLippe

This was referenced

Jun 2, 2026

Closed

Merged

alice pushed a commit to alice/servo that referenced this pull request

Jun 3, 2026
Bump `ml-kem` to 0.2.3 to 0.3.2, with refactoring. The refactoring is
similar to servo#45294. Here are some notable changes.
We switch to use `ml_kem::EncapsulationKey` and
`ml_kem::DecapsulationKey` in the key `Handle`, instead of using seed
and encoded encapsulation key. `ml_kem::EncapsulationKey` and
`ml_kem::DecapsulationKey` can store some pre-computed values to speed
up the encapsulation and decapsulation. The serialization steps also
change accordingly.
`ml-kem` 0.3 can now handle the SPKI and PKCS#8 format of ML-KEM keys.
We can leverage these functionalities to simplify our code. In
particular, we don't need to handle the ASN.1 private key structures for
ML-KEM by ourselves. Note that we drop the optional support for the
`both` format of those ASN.1 private key structures, by switching to
using `ml-kem` PKCS#8 functionality.
Testing: Covered by existing WPT tests in `WebCrypto` subdirectory
Fixes: Part of servo#42206
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>

@kkoyung

Read the original on github.com ↗