Files
servo/components/script
Kingsley Yung 37cce14548 script: Add Ed25519 support to SubtleCrypto (#39369)
This patch adds the cryptographic algorithm Ed25519 support to
`SubtleCrypto` interface, covering the "sign", "verify", "generateKey",
"importKey" and "exportKey" operations.

One may notice that the following related WPT tests do not pass in this
patch. They are caused by the unimplemented Step 2 and 3 of the "verify"
operation (https://w3c.github.io/webcrypto/#ed25519-operations-verify)
of Ed25519, which check whether the key represents an invalid point or a
small-order element on the Elliptic Curve of Ed25519.

```plaintext
[Ed25519 Verification checks with small-order key of order - Test 0]
[Ed25519 Verification checks with small-order key of order - Test 1]
[Ed25519 Verification checks with small-order key of order - Test 2]
[Ed25519 Verification checks with small-order key of order - Test 12]
[Ed25519 Verification checks with small-order key of order - Test 13]
```

The specification mentions that not all implementation perform this
check. There is also a discussion on it at specification level
(https://github.com/WICG/webcrypto-secure-curves/issues/27). As of
today, Chrome, Edge, Firefox and Safari do not implement it, and do not
pass those tests [1]. Meanwhile, the `aws-lc-rs` crate does not provide
relevant code. We may leave it unimplemented for now, and decide what to
do later.

[1]
https://wpt.fyi/results/WebCryptoAPI/sign_verify/eddsa_small_order_points.https.any.html?run_id=4820942170882048&run_id=6289205228732416&run_id=5178672043786240&run_id=5113794717286400

Testing: Pass WPT tests that were expected to fail.
Fixes: Part of #39060

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
2025-10-27 07:19:27 +00:00
..
2025-10-02 07:51:19 +00:00
2025-10-24 18:03:29 +00:00
2025-10-02 07:51:19 +00:00
2025-10-02 07:51:19 +00:00