Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cargo/mutants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# the cross-implementation cases distinguish it.

test_package = [
"webcrypto-impl-core",
"wasmtime-webcrypto",
"lann-webcrypto-core",
"lann-webcrypto-wasmtime",
"conformance-adapter-wasmtime",
]

Expand Down
2 changes: 1 addition & 1 deletion .github/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h1><code>lann:webcrypto</code></h1>
browser" run</span>
</li>
<li>
<a href="doc/wasmtime_webcrypto/">wasmtime-webcrypto</a>
<a href="doc/lann_webcrypto_wasmtime/">lann-webcrypto-wasmtime</a>
<span class="dim">— API docs for the Wasmtime host crate</span>
</li>
<li>
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Run rust checks
run: just rust-checks

# The WPT WebCryptoAPI suites against the componentize-sdk JS guest
# The WPT WebCryptoAPI suites against the webcrypto-componentize JS guest
# library: componentizes the runner with the pinned componentize-js
# (downloaded — see the componentize-js-toolchain workflow), composes it
# with a freshly built in-guest provider and driver, and runs it under
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/componentize-js-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: componentize-js toolchain
# function of nothing but the pinned revision and the host platform, so it
# is built once per (revision, platform) and published on the rolling
# `toolchains` release; CI's gating jobs and contributors download it
# (componentize-sdk/wpt/component.sh).
# (js/componentize/wpt/component.sh).
#
# Pushing a change to the pin runs this automatically. Until it finishes,
# checks that need the toolchain fail with instructions rather than silently
Expand All @@ -15,7 +15,7 @@ name: componentize-js toolchain
on:
push:
paths:
- componentize-sdk/componentize-js.rev
- js/componentize/componentize-js.rev
- .github/workflows/componentize-js-toolchain.yml
workflow_dispatch:

Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
id: id
run: |
{
echo "rev=$(cat componentize-sdk/componentize-js.rev)"
echo "rev=$(cat js/componentize/componentize-js.rev)"
echo "platform=${{ matrix.platform }}"
} >> "$GITHUB_OUTPUT"

Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
asset="componentize-js-${{ steps.id.outputs.rev }}-${{ steps.id.outputs.platform }}.gz"
gzip -c "$RUNNER_TEMP/out/bin/componentize-js" > "$asset"
echo "asset=$asset" >> "$GITHUB_ENV"
# Consumers pin these (componentize-sdk/componentize-js.sha256) and
# Consumers pin these (js/componentize/componentize-js.sha256) and
# refuse to execute anything else, so surface them here rather than
# making someone re-download to find out what was built.
{
Expand All @@ -127,7 +127,7 @@ jobs:
gh release view toolchains >/dev/null 2>&1 || \
gh release create toolchains --latest=false \
--title "Toolchains (CI artifacts)" \
--notes "componentize-js builds, one asset per pinned revision and platform. See componentize-sdk/wpt/component.sh."
--notes "componentize-js builds, one asset per pinned revision and platform. See js/componentize/wpt/component.sh."
# No --clobber: a published (revision, platform) is immutable, so
# that a recorded digest cannot be invalidated by replacing the
# asset underneath it. Re-publishing is a deliberate act — delete
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/timing-lab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
env:
TIMING_LAB_SAMPLES: ${{ inputs.samples || '2000' }}

# Mutation testing: cargo-mutants over impl-core and wasmtime-impl, oracle =
# Mutation testing: cargo-mutants over lann-webcrypto-core and lann-webcrypto-wasmtime, oracle =
# their unit tests + both conformance suites through the wasmtime adapter's
# env-gated oracle test. A missed mutant fails the job: it is a change to
# the crypto that no suite distinguishes — exactly the assertion-strength
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ node_modules/

# Build artifacts
build/
jco-impl/generated/
js/jco/generated/
examples/jco-demo/generated/
conformance/adapters/jco/generated/
conformance/adapters/jco/generated-signing/
Expand Down
125 changes: 66 additions & 59 deletions AGENTS.md

Large diffs are not rendered by default.

116 changes: 58 additions & 58 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[workspace]
members = [
"impl-core",
"guest-sdk",
"wasmtime-impl",
"guest-impl",
"rust/core",
"rust/guest",
"rust/wasmtime",
"rust/guest-provider",
"examples/crypto-demo",
"examples/demo-driver",
"examples/wasmtime-demo",
Expand Down
53 changes: 29 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ algorithm:
`error` variant carries no misuse cases — incrementality comes from the
streams, not from resource state.
- **`crypto.subtle` fidelity is measured, not assumed.** The
`componentize-sdk` library re-exposes the package as `crypto.subtle`, and
`webcrypto-componentize` library re-exposes the package as `crypto.subtle`, and
the vendored WebCryptoAPI web-platform-tests run through it in CI —
WPT → shim → WIT → implementation — so the platform's own test suite
meters what the interface shape preserves. Any deviation the shape forced
Expand All @@ -81,26 +81,31 @@ are specified in [`wit/README.md`](wit/README.md) and the WIT doc comments.

```
wit/ # the lann:webcrypto package (defined once, here)
impl-core/ # shared RustCrypto core of both Rust
# implementations (crate: webcrypto-impl-core);
# ECDSA signing is compiled out of wasm builds
wasmtime-impl/ # Wasmtime host crate (RustCrypto); add_to_linker +
# WasiWebcryptoView; crate: wasmtime-webcrypto
jco-impl/ # jco host library: webcrypto.js, browser-compatible
# Web Crypto API only (crypto.subtle /
# getRandomValues); no dependencies
guest-impl/ # in-guest wasm component: RustCrypto in wasm,
rust/ # the Rust crates (dir = crate name minus the
# `lann-webcrypto-` family root)
core/ # shared RustCrypto core of both Rust
# implementations; ECDSA signing is compiled out
# of wasm builds
wasmtime/ # Wasmtime host crate (RustCrypto); add_to_linker +
# WasiWebcryptoView
guest/ # guest-side Rust library over the lann:webcrypto
# imports: typed wrappers and a byte-source
# abstraction, so consumers need not hand-roll
# stream plumbing
guest-provider/ # in-guest wasm component: RustCrypto in wasm,
# EXPORTS the package surface, composable via
# `wac plug` — see its README for the wasm
# timing-channel classification & export policy
guest-sdk/ # guest-side Rust library over the lann:webcrypto
# imports (crate: lann-webcrypto-guest): typed
# wrappers and a byte-source abstraction, so
# consumers need not hand-roll stream plumbing
componentize-sdk/ # WebCrypto-subset library (crypto.subtle) for JS
js/ # the JS packages (dir = npm name minus the
# `@lann/webcrypto-` family root)
jco/ # jco host library: webcrypto.js,
# browser-compatible Web Crypto API only
# (crypto.subtle / getRandomValues); no
# dependencies
componentize/ # WebCrypto-subset library (crypto.subtle) for JS
# guests built with componentize-js, backed by the
# lann:webcrypto imports; the JS counterpart of
# guest-sdk
# rust/guest
examples/
crypto-demo/ # guest component: known-answer vectors, chunked
# streams, error taxonomy, extractability —
Expand All @@ -109,9 +114,9 @@ examples/
demo-driver/ # CLI driver for the fully in-guest composed demo
wasmtime-demo/ # thin native host + the integration test
jco-demo/ # Node 24+ driver: transpiles crypto-demo with jco
# against the jco-impl host and runs it
# against the webcrypto-jco host and runs it
componentize-demo/ # JS guest (componentize-js) exercising the
# componentize-sdk library; drives through the
# webcrypto-componentize library; drives through the
# same demo interface and composed pipeline
conformance/ # cross-implementation conformance tests: vendored
# Wycheproof vectors + translation policy, a shared
Expand All @@ -125,7 +130,7 @@ timing-lab/ # dudect-style statistical timing tests of the

Components that name the package in their own WIT pull it in through
`wit/deps/lann-webcrypto` symlinks back to the root `wit/`, so there is a
single copy to edit; guests built on `guest-sdk` reach it through that
single copy to edit; guests built on `lann-webcrypto-guest` reach it through that
crate's bindings instead.

## Build & run
Expand All @@ -141,16 +146,16 @@ just test-node # transpile and run the same guest under the jco ho
just test-webcrypto-composed # compose guest + in-guest provider + driver (wac plug)
# and run the whole thing under `wasmtime run`
just test-webcrypto-componentize-wpt # the WPT WebCryptoAPI suites against the
# componentize-sdk JS guest library, via its
# webcrypto-componentize JS guest library, via its
# published runner component (no componentize-js
# toolchain needed — see componentize-sdk/wpt/)
# toolchain needed — see js/componentize/wpt/)
just test-webcrypto-componentize # the composed pipeline with the JS demo guest
# (needs the componentize-js CLI — see
# componentize-sdk/README.md)
# js/componentize/README.md)
just wpt-parity # the WPT suites against the platform's own
# crypto.subtle and through the jco round trip;
# holds the round trip to the platform's pass set
# (see componentize-sdk/wpt/README.md)
# (see js/componentize/wpt/README.md)
just conformance # the Wycheproof-derived conformance tests over the
# enabled targets; renders conformance/matrix.md
just conformance-web # serve the conformance results viewer locally
Expand All @@ -170,7 +175,7 @@ with `CONFORMANCE_BROWSER=1`; needs Chrome/Chromium 137+); the
`crypto-demo` guest additionally covers the jco host end to end.

A note on the in-guest provider: wasm offers no portable constant-time
guarantees, so [`guest-impl/README.md`](guest-impl/README.md) classifies
guarantees, so [`rust/guest-provider/README.md`](rust/guest-provider/README.md) classifies
algorithms by how exploitable their timing channels are in wasm (classes A–D)
and enforces the policy structurally — class D algorithms (e.g. RSA
private-key ops) are simply never exported by it, so compositions that need
Expand Down
Loading
Loading