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: 3 additions & 1 deletion libraries/crypto/openspec/changes/foundation/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,9 @@ by target. It never differs by what the program links.
compilation with an `#error` that names the type to write (the owner's answer Q3), since a
silently ignored define would change which code a program runs.
- **Measurements are references.** The own lane `sizes` builds every (family, backend) program
through the superproject's `webcpp.size-table`, which requires `<variant>release`, and the
through the superproject's `webcpp.size-table`, which requires `<variant>release` and extends,
by the owner's decision of 2026-11-17 (C36), from Emscripten page programs to plain linked
programs on every target (Task 11'), and the
generated size matrix reads its table; throughput is measured by hand with a collect script
that refuses a program or data not built at `variant=release` (hash's `bench/collect.py` is
the model), on the machines the page names, and published as a dated page. Neither decides a
Expand Down
13 changes: 10 additions & 3 deletions libraries/crypto/openspec/changes/foundation/reference/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ decision is cited, `D<n>` is the foundation's `design.md` and `genesis D<n>` the
at `77e1ce5` and `/third_party//sodium` (webcpp::hash), and webcpp::hash with
`backends::hash2` as every key derivation's default.
- **The release-build rule exists in the superproject** (`69bf8ab`): `webcpp.size-table`
requires `<variant>release`, and hash's `bench/collect.py` refuses a program or data not built
requires `<variant>release` (and, by C36 of 2026-11-17, serves plain linked programs on every target through foundation Task 11', not only Emscripten page programs), and hash's `bench/collect.py` refuses a program or data not built
at `variant=release`. crypto's size and throughput tables use the same tools.

## Every overlap, resolved

| Item | Where it goes | Why |
| --- | --- | --- |
| Genesis Task 31 (trystero's sealer and `random`) | dropped | the owner's decision; trystero keeps its own sealer until a change of trystero's own adopts crypto |
| Genesis Task 32 (trystero's signer) | dropped | the same; its build half (Task 30a) is in version 0.1 |
| Genesis Task 31 (trystero's sealer and `random`) | dropped by the owner, 2026-11-17 | trystero keeps its own sealer until a change of trystero's own adopts crypto |
| Genesis Task 32 (trystero's signer) | dropped by the owner, 2026-11-17 | its build half (Task 30a) is in version 0.1 |
| Genesis Task 33 (the memory option beside Boost.Asio's SSL, libdatachannel and a TLS handshake) | stream M, task M3, **moved into crypto's own `test/openssl_memory/`** | it proves the option in any webcpp process that also holds Beast's TLS or libdatachannel's DTLS (webcpp::beast, webcpp::webrtc), not only trystero's; the owner's answer Q6 |
| Genesis Task 34 (increment 3 whole) | stream M, task M4 | what is left of increment 3 is the memory option |
| Genesis Tasks 15 and 16 (the memory option) | stream M, tasks M1 and M2 | Task 33 needs them, and D16 routes OpenSSL's per-call allocations through them |
Expand Down Expand Up @@ -210,6 +210,13 @@ is the recommendation, and `../design.md` D32 to D34 and the genesis's design re
`implemented` once version 0.1 and stream M are merged with the CI green on both `main`s; the
nightly level and NIST's archives (O2, O3) go with it if decided by then, or move to a change
of their own.
- **Q8. The memory option is native only (2026-11-17).** OpenSSL's memory option (genesis Tasks
15, 16, 33 and 34) is refused on every WebAssembly target, WASI included (wasip2, wasip3 and
Emscripten). `/webcpp/crypto//openssl` is a separate matter: OpenSSL builds on WASI, so the
alias is refused on Emscripten alone.
- **Q9. Size tooling reaches every target (2026-11-17, C36).** The superproject's release-only
`webcpp.size-table` extends from Emscripten page programs to plain linked programs on every
target; crypto's own lane `sizes` (foundation Task 11') builds on that.
- Still open from before: O1 (a ZIP-215 verifier), O2 (the nightly level), O3 (NIST's
archives), and the genesis's O5 departure C17 (C16, a throughput workflow, falls away with
D32).
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ No macro SHALL change a default: the library MUST NOT read `WEBCPP_CRYPTO_PROFIL
- **THEN** its backend is libsodium, as without the define

### Requirement: Measurements: references from release builds that decide nothing
The own lane `sizes` SHALL build the baseline program and one program per (family, backend) through the superproject's `webcpp.size-table`, which requires `<variant>release`, on native, wasip2, wasip3 and Emscripten, and the documentation's size matrix MUST be generated from its table. Throughput MUST be measured only from programs built at `variant=release`, by a collect script that refuses any other program or data, and published as a dated page that names the machines. No size or throughput MAY decide a default, an order of backends or an API.
The own lane `sizes` SHALL build the baseline program and one program per (family, backend) through the superproject's `webcpp.size-table`, which requires `<variant>release` and, by the owner's decision of 2026-11-17 (C36), reaches plain linked programs on every target and not only Emscripten page programs (foundation Task 11'), on native, wasip2, wasip3 and Emscripten, and the documentation's size matrix MUST be generated from its table. Throughput MUST be measured only from programs built at `variant=release`, by a collect script that refuses any other program or data, and published as a dated page that names the machines. No size or throughput MAY decide a default, an order of backends or an API.

#### Scenario: A debug build is offered to the throughput page
- **WHEN** the collect script is given a program built at `variant=debug`
Expand Down
12 changes: 8 additions & 4 deletions libraries/crypto/openspec/changes/genesis/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ Constraints every decision below works within, from the superproject's rulebook
- An incremental `open` (a later increment may add it only with the plaintext withheld until the
tag verifies), an incremental ChaCha20-Poly1305, tags shorter than 16 bytes.
- A Botan build for WebAssembly, which is a later increment's if a user needs it.
- OpenSSL on WebAssembly, or the memory option anywhere but native.
- OpenSSL on Emscripten, or the memory option anywhere but native (never on a WebAssembly target,
WASI included).
- The CI's three levels as a whole: this plan builds only the nightly level of the own lanes.
- Routing Botan's allocations through the user's allocator: Botan 3.13.0 offers no hook.

Expand Down Expand Up @@ -220,6 +221,9 @@ adapter functions that store each block's size in a header. The resource is neve
because OpenSSL frees through it after `main`, and on Windows with a shared libcrypto after every
static destructor. Every `make` of the backend checks that the functions are webcpp's and
otherwise returns `memory_functions_not_installed`; a missing definition is a link error.
The option is native only and `config.hpp` refuses it on every WebAssembly target, WASI included
(wasip2, wasip3 and Emscripten), by the owner's decision of 2026-11-17; OpenSSL itself still builds
on WASI, and `/webcpp/crypto//openssl` is refused on Emscripten alone.

- **Why a function the program defines:** OpenSSL's hook carries no user data, so any other form
would keep the resource in a global variable of webcpp's, which the rulebook forbids; Boost
Expand Down Expand Up @@ -340,7 +344,7 @@ foundation's design D32 to D35 hold the decisions shared with it.
trystero's repository into crypto's own `test/openssl_memory/` (the option beside Boost.Asio's
SSL, libdatachannel and a TLS handshake, which webcpp::beast's and webcpp::webrtc's programs
are too), and Task 34 as its close: stream M of the roadmap, beside the foundation's
increments 1 and 2. Tasks 31 and 32 (trystero's sealer, `random` and signer) are dropped;
increments 1 and 2. Tasks 31 and 32 (trystero's sealer, `random` and signer: the migration) are dropped by the owner, 2026-11-17;
trystero keeps its code until a change of trystero's own adopts crypto.
- **Increment 4** (Task 35) is built in the foundation's increment 1 as its Task 8b, over the
foundation's `ciphers::aead<Family, Backend>`, whose `aead_state` and `aead_engine` replace
Expand Down Expand Up @@ -404,8 +408,8 @@ foundation's design D32 to D35 hold the decisions shared with it.
## Migration Plan

Nothing to migrate: version 0.1 moved trystero's build onto `/third_party//secp256k1` (Task
30a, its code unchanged), and the owner dropped the rest of trystero's migration on 2026-11-17
(D23). A later change of trystero's own may adopt `aes256_gcm`, `random_device` and
30a, its code unchanged), and trystero's migration onto the library (Tasks 31 and 32) was
dropped by the owner, 2026-11-17 (D23); no step of it remains. A later change of trystero's own may adopt `aes256_gcm`, `random_device` and
`curves::secp256k1::keypair`; the plan's Tasks 31 and 32 stay as its reference.

To resume (details in `reference/STATUS.md`): the order is the foundation's
Expand Down
3 changes: 2 additions & 1 deletion libraries/crypto/openspec/changes/genesis/proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ foundation change in one order (`design.md` D23, and the foundation's `reference
`BCryptGenRandom` on Windows), no generator in user space, no weaker fallback.
- **OpenSSL's memory functions are an option of the config:** with
`WEBCPP_CRYPTO_OPENSSL_MEMORY_RESOURCE` a program names a `std::pmr::memory_resource` and
every allocation of OpenSSL in the process goes to it. Without the option OpenSSL's and
every allocation of OpenSSL in the process goes to it; the option is native only and refused on
every WebAssembly target, WASI included. Without the option OpenSSL's and
Botan's `make` allocate outside the program's allocator, a departure the owner accepted.
- **webcpp::trystero** names `/third_party//secp256k1` since version 0.1 (its build alone);
its sealer, entropy and signer are not changed by this library's work (the owner's decision
Expand Down
19 changes: 13 additions & 6 deletions libraries/crypto/openspec/changes/genesis/reference/plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ the decision. Measured tables come only from release builds.
| 22 | the foundation's Task 11' (task 1.11): the own lane `sizes` through `webcpp.size-table`, which requires `<variant>release`; throughput measured by hand by a collect script that refuses a program or data not built at `variant=release`; no `runners.yml`, no ranking; nothing decides a default |
| 23 | the foundation's increment 4 (task 4.4), Chrome's throughput from release builds |
| 25b, 9's NIST half | stream N, behind gates O2 and O3 |
| 31, 32 | **dropped**; kept as the reference of a future change of trystero's own |
| 31, 32 | **dropped by the owner, 2026-11-17**; kept as the reference of a future change of trystero's own |
| 33 | stream M, **moved into crypto's own tests** (below) |
| 34 | stream M's close (below) |
| 35 | the foundation's Task 8b (task 1.8b), re-cut onto `ciphers::aead<Family, Backend>` |
Expand Down Expand Up @@ -5548,7 +5548,9 @@ option's own change; before it runs, re-read it against the source-built provide
`/webcpp/third_party//openssl` and named through `/webcpp/crypto//openssl` (Task 11), version
3.5.9, on native, wasip2 and wasip3; the feature `webcpp-crypto-openssl-link`, `OPENSSL_ROOT`
and the shared link it names are gone; the error values 13 and 14 are reserved and undeclared;
and the measured counts are 3.6.4's.
and the measured counts are 3.6.4's. The option itself is native only and is refused on every
WebAssembly target, WASI included (wasip2, wasip3 and Emscripten), by the owner's decision of
2026-11-17; only `/webcpp/crypto//openssl` is refused on Emscripten alone.

**Files:**
- Modify: `include/webcpp/crypto/backends/openssl.hpp`.
Expand Down Expand Up @@ -5962,7 +5964,9 @@ option's own change; before it runs, re-read it against the source-built provide
`/webcpp/third_party//openssl` and named through `/webcpp/crypto//openssl` (Task 11), version
3.5.9, on native, wasip2 and wasip3; the feature `webcpp-crypto-openssl-link`, `OPENSSL_ROOT`
and the shared link it names are gone; the error values 13 and 14 are reserved and undeclared;
and the measured counts are 3.6.4's.
and the measured counts are 3.6.4's. The option itself is native only and is refused on every
WebAssembly target, WASI included (wasip2, wasip3 and Emscripten), by the owner's decision of
2026-11-17; only `/webcpp/crypto//openssl` is refused on Emscripten alone.

**Files:**
- Create, in `test/openssl_memory/`: `support.hpp` (the counting resource that is never
Expand Down Expand Up @@ -10581,6 +10585,8 @@ still moves trystero's code onto webcpp::crypto later; Task 32 Step 3's build ha

# Increment 3: trystero's migration

**Dropped by the owner, 2026-11-17** (Tasks 31 and 32 below, and this increment's precondition, are not built; Task 30a's build half is merged in version 0.1). The text below stays as the reference of a future change of trystero's own, and the plan's numbering is kept.

**Deferred after version 0.1 (revision of 2026-11-14).** Kept as written; before it starts,
re-read it against the tree of that day. Already true at the revision: trystero's
shared-connection change has integrated (the precondition below holds, but its table of call
Expand Down Expand Up @@ -10626,7 +10632,7 @@ Before Task 31 starts:

## Task 31: trystero seals with `aes256_gcm` directly, and draws from `random_device`

**Dropped** by the owner's decision of 2026-11-17 (the revision of that day); kept as the reference of a future change of trystero's own.
**Dropped by the owner, 2026-11-17** (the revision of that day); kept as the reference of a future change of trystero's own.

**Files (in `libs/trystero`):**
- Create: `include/webcpp/trystero/detail/sealer.hpp`, `test/sealer_test.cpp`.
Expand Down Expand Up @@ -10876,7 +10882,7 @@ private:

## Task 32: trystero signs with `secp256k1::keypair`, and libsecp256k1 comes from `third_party`

**Dropped** by the owner's decision of 2026-11-17 (the revision of that day); its build half is Task 30a, merged in version 0.1.
**Dropped by the owner, 2026-11-17** (the revision of that day); its build half is Task 30a, merged in version 0.1.

**Files (in `libs/trystero`):**
- Modify: `include/webcpp/trystero/protocol/nostr.hpp` (`signer`, `verify`),
Expand Down Expand Up @@ -10973,7 +10979,8 @@ inline bool verify(std::span<const std::uint8_t, 64> sig, std::span<const std::u

## Task 33: The memory option beside Boost.Asio's SSL, libdatachannel and a TLS handshake

Stream M, **moved into `libs/crypto/test/openssl_memory/`** by the revision of 2026-11-17, which gives its files.
Stream M, **moved into `libs/crypto/test/openssl_memory/`** by the revision of 2026-11-17, which gives its files. The option is native only, refused on every WebAssembly target, WASI
included (the owner's decision of 2026-11-17), so this task's tests build natively alone.

**Files (in `libs/trystero`):**
- Create: `test/openssl_memory/Jamfile`, `test/openssl_memory/neighbours_test.cpp`,
Expand Down
Loading