Skip to content

Commit dfaa693

Browse files
committed
Write about SubtleCrypto
1 parent c5230b3 commit dfaa693

File tree

3 files changed

+54
-38
lines changed

3 files changed

+54
-38
lines changed

_posts/2025-12-12-november-in-servo.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ summary: ao!! wrrrrao!!
77
categories:
88
---
99

10+
@kkoyung has landed some huge improvements in the [**SubtleCrypto API**](https://w3c.github.io/webcrypto/), including some of the more [modern algorithms in this WICG draft](https://wicg.github.io/webcrypto-modern-algos/), and a fix for constant-time base64 (#40334).
11+
We now have full support for **SHA3-256**, **SHA3-384**, **SHA3-512** (@kkoyung, #40765), **cSHAKE128**, **cSHAKE256** (@kkoyung, #40832), **Argon2d**, **Argon2i**, **Argon2id**, **ChaCha20-Poly1305**, **ECDH**, **ECDSA**, and **X25519**:
12+
13+
<figure style="overflow-x: scroll;">
14+
15+
| Algorithm | deriveBits | exportKey | generateKey | importKey | sign | verify |
16+
|---|---|---|---|---|---|---|
17+
| Argon2d | #40936 | n/a | n/a | #40932 | n/a | n/a |
18+
| Argon2i | #40936 | n/a | n/a | #40932 | n/a | n/a |
19+
| Argon2id | #40936 | n/a | n/a | #40932 | n/a | n/a |
20+
| ChaCha20-Poly1305 | n/a | #40948 | n/a | #40948 | n/a | n/a |
21+
| ECDH | #40333 | #40298 | #40305 | #40253 | n/a | n/a |
22+
| ECDSA | n/a | #40536 | #40553 | #40523 | #40591 | #40557 |
23+
| X25519 | #40497 | #40421 | #40480 | #40398 | n/a | n/a |
24+
</figure>
25+
1026
<style>
1127
._correction {
1228
max-width: 33em;

commits.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ https://github.com/servo/servo/pull/40309 (@mukilan, @mrobinson, #40309) composi
4141
# `Painter`. This allows us to post new frame notifications only to the painters that WebRender notified us about.
4242
# Testing: Should be covered by existing tests.
4343
+https://github.com/servo/servo/pull/40305 (@kkoyung, #40305) script: Implement generate key operation of ECDH (#40305)
44-
dom; crypto.subtle.generateKey("ECDH")
44+
;dom; crypto.subtle.generateKey("ECDH")
4545
# Continue on adding ECDH support to WebCrypto API. This patch implements generate key operation of ECDH.
4646
# Testing:
4747
# - Pass some WPT tests that were expected to fail.
@@ -142,7 +142,7 @@ https://github.com/servo/servo/pull/40128 (@aaron-wgd, #40128) servoshell/deskto
142142
# Testing: Tested manually on linux/wayland.
143143
# Fixes: Intermittent panics on touch end events, see above.
144144
+https://github.com/servo/servo/pull/40298 (@kkoyung, #40298) script: Implement export key operation of ECDH (#40298)
145-
dom; crypto.subtle.exportKey() for ECDH keys
145+
;dom; crypto.subtle.exportKey() for ECDH keys
146146
# Continue on adding ECDH support to WebCrypto WPI. This patch implements export key operation of ECDH.
147147
# Testing:
148148
# - Pass some WPT tests that were expected to fail.
@@ -728,7 +728,7 @@ https://github.com/servo/servo/pull/40316 (@tharkum, #40316) html: Support relea
728728
# Fixes (partially): https://github.com/servo/servo/issues/40265
729729
# Fixes: https://github.com/servo/servo/issues/37173
730730
+https://github.com/servo/servo/pull/40421 (@kkoyung, #40421) script: Implement export key operation of X25519 (#40421)
731-
dom; crypto.subtle.exportKey() for X25519 keys
731+
;dom; crypto.subtle.exportKey() for X25519 keys
732732
# Continue on adding X25519 support to WebCrypto API. This patch implements export key operation of X25519, using
733733
# X25519 implementation from the crate `x25519-dalek`.
734734
# Testing:
@@ -741,7 +741,7 @@ https://github.com/servo/servo/pull/40316 (@tharkum, #40316) html: Support relea
741741
# remove the `ignore_malloc_size_of` annotation in the structs `CompressionStream` and `DecompressionStream`
742742
# Testing: Existing tests suffice.
743743
+https://github.com/servo/servo/pull/40333 (@kkoyung, #40333) script: Implement derive bits operation of ECDH (#40333)
744-
dom; crypto.subtle.deriveBits("ECDH")
744+
;dom; crypto.subtle.deriveBits("ECDH")
745745
# Finish adding ECDH support to WebCrypto API. This patch implements derive bits operation of ECDH.
746746
# Testing: Pass some WPT tests that were expected to fail.
747747
# Fixes: Part of #39060
@@ -851,7 +851,7 @@ https://github.com/servo/servo/pull/40411 (@simonwuelker, #40411) xpath: Handle
851851
# Add CanGc argument to SafeFromJSValConvertible::safe_from_jsval
852852
# Fixes: #40392
853853
+https://github.com/servo/servo/pull/40398 (@kkoyung, #40398) script: Implement import key operation of X25519 (#40398)
854-
dom; crypto.subtle.importKey(,,"X25519")
854+
;dom; crypto.subtle.importKey(,,"X25519")
855855
# Start adding X25519 support to WebCrypto API. This patch implements import key operation of X25519, using X25519
856856
# implementation from the crate `x25519-dalek`.
857857
# Testing:
@@ -1051,7 +1051,7 @@ https://github.com/servo/servo/pull/40371 (@Gae24, #40371) script: remove microt
10511051
# Testing: Covered by existing tests
10521052
# Fixes: #20908
10531053
+https://github.com/servo/servo/pull/40334 (@kkoyung, #40334) script: Use `base64ct` instead of `base64` in SubtleCrypto (#40334)
1054-
security dom
1054+
;security dom
10551055
# The `SubtleCrypto` interface of WebCrypto API needs to encode and decode keys in base64 alphabets when
10561056
# exporting/importing keys in JsonWebKey format.
10571057
# We currently use the `base64` crate to handle base64 encoding and decoding. This patch switches to use the `base64ct`
@@ -1152,7 +1152,7 @@ https://github.com/servo/servo/pull/40482 (@mukilan, @mrobinson, #40482) composi
11521152
# used and that will be handled in a follow-up patch.
11531153
# Testing: Covered by existing tests.
11541154
+https://github.com/servo/servo/pull/40480 (@kkoyung, #40480) script: Implement generate key operation of X25519 (#40480)
1155-
dom; crypto.subtle.generateKey("X25519")
1155+
;dom; crypto.subtle.generateKey("X25519")
11561156
# Continue on adding X25519 support to WebCrypto API. This patch implements generate key operation of X25519, using
11571157
# X25519 implementation from the crate `x25519-dalek`.
11581158
# Testing: Pass some WPT tests that were expected to fail.
@@ -1271,7 +1271,7 @@ https://github.com/servo/servo/pull/40489 (@eerii, #40489) tools: Remove wrapped
12711271
# when inspecting one instance of Firefox from another.
12721272
# Testing: Check with `mach test-scripts`
12731273
+https://github.com/servo/servo/pull/40497 (@kkoyung, #40497) script: Implement derive bits operation of X25519 (#40497)
1274-
dom; crypto.subtle.deriveBits("X25519")
1274+
;dom; crypto.subtle.deriveBits("X25519")
12751275
# Finish adding X25519 support to WebCrypto API. This patch implements derive bits operation of X25519, using X25519
12761276
# implementation from the crate `x25519-dalek`.
12771277
# Testing: Pass some WPT tests that were expected to fail.
@@ -1334,7 +1334,7 @@ https://github.com/servo/servo/pull/40489 (@eerii, #40489) tools: Remove wrapped
13341334
# Testing: No functional changes. Existing tests should test this.
13351335
# Fixes: Part of #40530
13361336
+https://github.com/servo/servo/pull/40536 (@kkoyung, #40536) script: Implement export key operation of ECDSA (#40536)
1337-
dom; crypto.subtle.exportKey() for ECDSA keys
1337+
;dom; crypto.subtle.exportKey() for ECDSA keys
13381338
# Continue on adding ECDSA support to WebCrypto API. This patch implements export key operation of ECDSA, using
13391339
# ECDSA implementation from the crates `p256`, `p384`, `p521` and `elliptic_curve`.
13401340
# Testing:
@@ -1389,7 +1389,7 @@ https://github.com/servo/servo/pull/40527 (@tharkum, #40527) dom: Add the attrib
13891389
# Testing: Improvements in the following tests
13901390
# - html/semantics/embedded-content/media-elements/user-interface/muted.html
13911391
+https://github.com/servo/servo/pull/40523 (@kkoyung, #40523) script: Implement import key operation of ECDSA (#40523)
1392-
dom; crypto.subtle.importKey(,,"ECDSA")
1392+
;dom; crypto.subtle.importKey(,,"ECDSA")
13931393
# Start adding ECDSA support to WebCrypto API. This patch implements import key operation of ECDSA, using ECDSA
13941394
# implementation from the crates `p256`, `p384`, `p521` and `elliptic_curve`.
13951395
# Testing:
@@ -1814,7 +1814,7 @@ https://github.com/servo/servo/pull/40541 (@simonwuelker, #40541) tests: Import
18141814
# Testing: 2 WPT are now passing
18151815
# Fixes: #40550
18161816
+https://github.com/servo/servo/pull/40557 (@kkoyung, #40557) script: Implement verify operation of ECDSA (#40557)
1817-
dom; crypto.subtle.verify("ECDSA")
1817+
;dom; crypto.subtle.verify("ECDSA")
18181818
# Continue on adding ECDSA support to WebCrypto API. This patch implements verify operation of ECDSA, using ECDSA
18191819
# implementation from the crates `ecdsa` for the operation, `p256`, `p384`, `p521`, and `elliptic_curve` for the key,
18201820
# and `sha1`, `sha2` and `digest` for digesting messages.
@@ -1828,7 +1828,7 @@ https://github.com/servo/servo/pull/40541 (@simonwuelker, #40541) tests: Import
18281828
-https://github.com/servo/servo/pull/40551 (@yezhizhen, #40551) Fix compilation warning for platforms other than Linux (#40551)
18291829
# Testing: This only changes lint.
18301830
+https://github.com/servo/servo/pull/40553 (@kkoyung, #40553) script: Implement generate key operation of ECDSA (#40553)
1831-
dom; crypto.subtle.generateKey("ECDSA")
1831+
;dom; crypto.subtle.generateKey("ECDSA")
18321832
# Continue on adding ECDSA support to WebCrypto API. This patch implements generate key operation of ECDSA, using
18331833
# ECDSA implementation from the crates `p256`, `p384`, `p521` and `elliptic_curve`.
18341834
# Testing: Pass some WPT tests that were expected to fail.
@@ -1883,7 +1883,7 @@ https://github.com/servo/servo/pull/40590 (@mrobinson, #40590) script: Use `Scri
18831883
# under the wrong version number.
18841884
# Testing: not required as the code is identical, only version numbers have changed.
18851885
+https://github.com/servo/servo/pull/40591 (@kkoyung, #40591) script: Implement sign operation of ECDSA (#40591)
1886-
dom; crypto.subtle.sign("ECDSA")
1886+
;dom; crypto.subtle.sign("ECDSA")
18871887
# Finish adding ECDSA support to WebCrypto API. This patch implements sign operation of ECDSA, using ECDSA implementation
18881888
# from the crates `ecdsa` for the operation, `p256`, `p384`, `p521`, and `elliptic_curve` for the key, and `sha1`,
18891889
# `sha2` and `digest` for digesting messages.
@@ -2873,7 +2873,7 @@ https://github.com/servo/servo/pull/40433 (@mrobinson, #40433) paint: Do trigger
28732873
# This PR avoids prints, which are controlled by a debugging option.
28742874
# Testing: Only changes logging, no functional behavior change.
28752875
+https://github.com/servo/servo/pull/40765 (@kkoyung, #40765) script: Implement SHA-3 in WebCrypto API (#40765)
2876-
dom; crypto.subtle.digest("SHA3-256"), SHA3-384, SHA3-512; first among major engines!
2876+
;dom; crypto.subtle.digest("SHA3-256"), SHA3-384, SHA3-512; first among major engines!
28772877
# Implements digest operation of SHA-3, including `SHA3-256`, `SHA3-384` and `SHA3-512`, using the crate `sha3`
28782878
# for the SHA-3 calculation.
28792879
# Testing: Pass WPT tests that were expected to fail.
@@ -3963,7 +3963,7 @@ https://github.com/servo/servo/pull/40301 (@jdm, @uthmaniv, #40301) fonts: Add W
39633963
# Testing: Newly passing tests.
39643964
# Fixes: #36590
39653965
+https://github.com/servo/servo/pull/40832 (@kkoyung, #40832) script: Implement CShake in WebCrypto API (#40832)
3966-
dom; crypto.subtle.digest("cSHAKE128"), cSHAKE256
3966+
;dom; crypto.subtle.digest("cSHAKE128"), cSHAKE256
39673967
# Implements digest operation of CShake, including `cSHAKE128` and `cSHAKE256`, using the crate `sha3` and `digest`
39683968
# for the CShake calculation.
39693969
# Testing: Pass WPT tests that were expected to fail.
@@ -4731,7 +4731,7 @@ https://github.com/servo/servo/pull/40661 (@janvarga, #40661) storage: Introduce
47314731
# Testing: This should not change observable behavior and tests are updated for the
47324732
# new APIs.
47334733
+https://github.com/servo/servo/pull/40936 (@kkoyung, #40936) script: Finishing implementation of Argon2 in WebCrypto (#40936)
4734-
dom; full support for Argon2 including crypto.subtle.deriveBits("Argon2d"), Argon2i, Argon2id (get key length is an internal algorithm)
4734+
;dom; full support for Argon2 including crypto.subtle.deriveBits("Argon2d"), Argon2i, Argon2id (get key length is an internal algorithm)
47354735
# Finish adding Argon2 support to WebCrypto API, using the crate `argon2` to support the cryptographic calculation.
47364736
# This patch implements "derive bits" operation and the "get key length" operation of Argon2. Actual error messages
47374737
# are also provided for the existing "import key" operation of Argon2.
@@ -4751,7 +4751,7 @@ https://github.com/servo/servo/pull/40709 (@jdm, #40709) servodriver: Clear cook
47514751
# Fixes: #40695
47524752
# Fixes: #40697
47534753
+https://github.com/servo/servo/pull/40932 (@kkoyung, #40932) script: Implement import key operation of Argon2 (#40932)
4754-
dom; roll this into the other Argon2 patch (import key is an internal algorithm)
4754+
;dom; crypto.subtle.importKey("Argon2d"), Argon2i, Argon2id
47554755
# Start adding Argon2 support to WebCrypto API.
47564756
# This patch implements import key operation of Argon2.
47574757
# Testing:
@@ -4809,7 +4809,7 @@ https://github.com/servo/servo/pull/40953 (@mrobinson, #40953) servoshell: Alway
48094809
# For instance, this fixes a crash when running WPT tests on some systems.
48104810
# Testing: This fixes an issue when running WPT tests locally.
48114811
+https://github.com/servo/servo/pull/40948 (@kkoyung, #40948) script: Implement import/export key operation of ChaCha20-Poly1305 (#40948)
4812-
dom; crypto.subtle.importKey("ChaCha20-Poly1305") and exportKey() for ChaCha20-Poly1305 keys
4812+
;dom; crypto.subtle.importKey("ChaCha20-Poly1305") and exportKey() for ChaCha20-Poly1305 keys
48134813
# Start adding ChaCha20-Poly1305 support to WebCrypto API.
48144814
# This patch implements "import key" operation and "export key" operation of ChaCha20-Poly1305, using the crate
48154815
# `chacha20poly1305` to support the cryptographic calculation.

0 commit comments

Comments
 (0)