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: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@
[submodule "libs/codecs"]
path = libs/codecs
url = ../codecs.git
[submodule "third_party/libs/hpke"]
path = third_party/libs/hpke
url = https://github.com/cfrg/draft-irtf-cfrg-hpke.git
shallow = true
10 changes: 6 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ for web developers and for AI developers (`CODING-GUIDELINES.md` chapter 16).
| asio | Boost.Asio with browser event-loop suspension, WASIp2/P3 networking and optional source-built TLS | native, emscripten, wasip2, wasip3 | a submodule at `libs/asio`; see its feature matrix for variants |
| beast | HTTP and WebSocket applications using native/WASIp3 sockets, browser WebSocket/fetch, WASI host HTTP or supplied streams | native, emscripten, wasip2, wasip3, by backend | a submodule at `libs/beast`; all 53 upstream applications remain in its compatibility matrix |
| cobalt | Boost.Cobalt coroutine applications with shipped Wasm adaptations and optional corrected SSL | native, emscripten, wasip2, wasip3, by capability | a submodule at `libs/cobalt`; see its feature and application matrices for variants |
| codecs | one contract for converting bytes and values to text and back, and any data through streams; seven formats (hex, base32, base58, base64, bech32, percent, RFC 7468's armor); header-only, percent over Boost.URL; webcpp's own | native, wasip2, wasip3, emscripten; its own lanes `constant-time` and `fuzz` | a submodule at `libs/codecs`; depends on config and secure, percent also on Boost.URL |
| codecs | one contract for converting bytes and values to text and back, and any data through streams; eight formats (hex, base32, z-base-32, base58, base64, bech32, percent, RFC 7468's armor); header-only, percent over Boost.URL; webcpp's own | native, wasip2, wasip3, emscripten; its own lanes `constant-time` and `fuzz` | a submodule at `libs/codecs`; depends on config and secure, percent also on Boost.URL |
| config | webcpp's configuration, which every library includes first: the target, exceptions and webcpp's version, as Boost.Config is Boost's; webcpp's own | native, wasip2, wasip3, emscripten | a submodule at `libs/config` |
| crypto | AES-GCM, the AES block cipher, random_device and secp256k1 over C libraries built from source (BearSSL, OpenSSL, libsecp256k1, ctaes), webcpp's own | native, wasip2, wasip3, emscripten (OpenSSL not on emscripten); its own lane `c-suites` | a submodule at `libs/crypto`; depends on hash and secure |
| hash | hashing and key derivation: Boost.Hash2's algorithms by alias, Keccak-256, BLAKE3, HKDF, PBKDF2, Argon2 and scrypt over C backends (XKCP, BLAKE3, libsodium, BearSSL, OpenSSL, Botan) and a browser backend; a wrapper | native, wasip2, wasip3, emscripten (by backend); its own lane `c-suites` | a submodule at `libs/hash`; depends on config and secure |
Expand Down Expand Up @@ -114,7 +114,7 @@ webcpp/
a submodule under third_party/libs/, pinned at a commit and keeping its
own licence (openssl, libdatachannel, bearssl, secp256k1, bitcoin for
ctaes, xkcp, libsodium, blake3, and the test data wycheproof, bips,
JSON-Schema-Test-Suite and nativejson-benchmark), and the Jamfile that
hpke, JSON-Schema-Test-Suite and nativejson-benchmark), and the Jamfile that
declares it as /webcpp/third_party//<target> and
/third_party//<target> (guidelines chapter 10)
doc/ the index page (index.adoc, Jamfile)
Expand Down Expand Up @@ -271,7 +271,7 @@ Jamroot is its build configuration, and `libs/<name>` is its repository.
- for crypto: nothing installed, with the pinned submodules initialised:
`git submodule update --init third_party/libs/bearssl
third_party/libs/secp256k1 third_party/libs/bitcoin third_party/libs/wycheproof
third_party/libs/bips third_party/libs/ed25519-speccheck`, and
third_party/libs/bips third_party/libs/ed25519-speccheck third_party/libs/hpke`, and
`third_party/libs/openssl` for its OpenSSL backend (below); b2 builds every
backend from its sources;
- for Botan (`/third_party//botan`, webcpp::hash's `backends::botan` and
Expand Down Expand Up @@ -1673,7 +1673,9 @@ jobs:
every library's tests hold it, and trystero's guarantee 6 rests on it.
The image is `tools/ci/container/Dockerfile`'s: Ubuntu 24.04, the
runner's release, pinned by the digest of its image index, with `g++-14`,
`clang-18`, Python, Git, Make, Perl and CMake, every package,
`clang-18`, `libclang-rt-18-dev` (Clang 18's `sanitizer/` headers, which
secure's `declassify_compile_msan` includes), Python, Git, Make, Perl and
CMake, every package,
`ca-certificates` included, from Ubuntu's snapshot of the archive at the
date its `ARG SNAPSHOT` names (`Snapshot: yes` on the sources, `apt-get
--snapshot`), so that one Dockerfile is one set of packages. The snapshot
Expand Down
42 changes: 28 additions & 14 deletions CODING-GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,14 @@ exactly its authors' and the program carries only what it calls.
fix upstream. Until upstream applies it, the pin may point at our fork's
branch carrying exactly that submitted patch and nothing else, and it
returns to upstream once the patch is applied. BearSSL is pinned so:
`ae63032` of `webcpporg/bearssl`'s branch
`upstream/ecdsa-bits2int-constant-time`, upstream's `7bea48e` and the ECDSA
nonce fix submitted upstream (owner decision of 2026-12-02, which
superseded the exception of 2026-11-21 that let a mirror's `webcpp` branch
carry a fix of webcpp's own).
`f8a2f3d` of `webcpporg/bearssl`'s branch `webcpp-pin`, upstream's
`7bea48e` and two fixes submitted upstream, each on a branch of its own on
top of `7bea48e`: the ECDSA nonce fix (`ae63032`, branch
`upstream/ecdsa-bits2int-constant-time`; owner decision of 2026-12-02,
which superseded the exception of 2026-11-21 that let a mirror's `webcpp`
branch carry a fix of webcpp's own) and P-256's scalar check (`ec57f88`,
branch `upstream/ec-p256-check-scalar-constant-time`; owner decision of
2026-12-04, an explicit exception to this rule like the first).
2. `third_party/Jamfile` builds it from its own sources, file by file, as a
static library, in the library's own C dialect, on every target and with
every file: a file that does not apply to a target still compiles, to the
Expand Down Expand Up @@ -984,7 +987,7 @@ update --init third_party/libs/<name>`; a build that needs none never looks.

| Target | What it is | Licence |
| --- | --- | --- |
| `bearssl` | BearSSL at `ae63032` of webcpp's fork `webcpporg/bearssl`, branch `upstream/ecdsa-bits2int-constant-time`: upstream's `7bea48e` and exactly the ECDSA nonce fix submitted upstream, until upstream applies it (chapter 5 rule 1); a static library built file by file by `third_party/Jamfile` with webcpp::crypto's and webcpp::hash's canaries (hash's when `libs/hash` is checked out), on every target; `WEBCPP_CRYPTO_HAS_BEARSSL=1`, and `WEBCPP_HASH_HAS_BEARSSL=1` with hash's canary | MIT |
| `bearssl` | BearSSL at `f8a2f3d` of webcpp's fork `webcpporg/bearssl`, branch `webcpp-pin`: upstream's `7bea48e` and exactly the two fixes submitted upstream, the ECDSA nonce's (`ae63032`) and P-256's scalar check's (`ec57f88`), until upstream applies them (chapter 5 rule 1); a static library built file by file by `third_party/Jamfile` with webcpp::crypto's and webcpp::hash's canaries (hash's when `libs/hash` is checked out), on every target; `WEBCPP_CRYPTO_HAS_BEARSSL=1`, and `WEBCPP_HASH_HAS_BEARSSL=1` with hash's canary | MIT |
| `bips` | `bitcoin/bips` at `927b6de9`, shallow, test data: crypto's tests read BIP340's `bip-0340/test-vectors.csv` and BIP341's `bip-0341/wallet-test-vectors.json` at run time under the directory its define `WEBCPP_TEST_BIPS` gives, on every target (wasmtime is given it, `webcpp.data`), and run again when it changes | BSD-2-Clause, as BIP340's header states |
| `bitcoin_base58_vectors` | Bitcoin Core's base58 vectors, `src/test/data/base58_encode_decode.json` and `src/test/data/key_io_valid.json` of the submodule `third_party/libs/bitcoin` (Bitcoin Core v31.1 at `9be056a`, shallow), test data that nothing compiles: codecs' tests (the first file) and hash's Base58Check test (the second) read them at run time under the directory its define `WEBCPP_TEST_BITCOIN_BASE58_VECTORS` gives, on every target (wasmtime is given it, `webcpp.data`), and run again when either changes | MIT |
| `blake2_vectors` | BLAKE2's reference code package `BLAKE2/BLAKE2` at `ed1974e` (2023-02-12), the submodule `third_party/libs/blake2`, shallow, test data that nothing compiles: hash's tests read `testvectors/blake2b-kat.txt` and `testvectors/blake2-kat.json` at run time under the directory its define `WEBCPP_TEST_BLAKE2_VECTORS` gives, on every target (wasmtime is given it, `webcpp.data`), and run again when one of them changes | CC0-1.0 |
Expand All @@ -995,6 +998,7 @@ update --init third_party/libs/<name>`; a build that needs none never looks.
| `ca_certificates` | Dated Mozilla/curl CA data snapshot under `third_party/ca_certificates`, verified against its manifest and embedded by a build-generated header; updated explicitly by `tools/ca_certificates/update.py` | MPL-2.0 |
| `ctaes` | `src/crypto/ctaes` of `bitcoin/bitcoin` v31.1 at `9be056a` (commit `9be056a8a72b624dae9623b2f7bded92c2a21c91`), the submodule `third_party/libs/bitcoin`, shallow; `third_party/Jamfile` compiles its `ctaes.c` alone, with webcpp::crypto's canary, on every target (`WEBCPP_CRYPTO_HAS_CTAES=1`); the tree's `src/secp256k1/` subtree is never on an include path and no glob over `third_party/libs` reaches it | MIT |
| `ed25519-speccheck` | `novifinancial/ed25519-speccheck` at `65519336` (2021-02-26), shallow, test data: crypto's tests read the twelve Ed25519 edge cases of "Taming the many EdDSAs", its `cases.json`, at run time under the directory its define `WEBCPP_TEST_ED25519_SPECCHECK` gives, on every target (wasmtime is given it, `webcpp.data`), and run again when it changes | Apache-2.0 |
| `hpke` | `cfrg/draft-irtf-cfrg-hpke` at `5f503c5` (2021-05-24), shallow, test data: crypto's tests read RFC 9180's test vectors, its `test-vectors.json` (Appendix A's source, 128 entries), at run time under the directory its define `WEBCPP_TEST_HPKE` gives, on every target (wasmtime is given it, `webcpp.data`), and run again when it changes | IETF Trust Legal Provisions (BCP 78; code components under the Simplified BSD License) |
| `json-schema-test-suite` | the JSON Schema Test Suite at `5b0ee16` (2026-09-21), test data: a test that names it reads the suite at run time from the directory its define `WEBCPP_TEST_JSON_SCHEMA_TEST_SUITE` gives, on every target (wasmtime is given it, `webcpp.data`), and runs again when a file of the suite changes | MIT |
| `libdatachannel` | libdatachannel 0.24.6 at `6b1e2e620f1e37f0eafeee702eaea0043cb305fd`, with pinned libjuice, libsrtp, plog and usrsctp sources; static native archives built by upstream CMake through B2 against the same source-built OpenSSL, from a staged copy the patches of `tools/libdatachannel/patches` correct | MPL-2.0 and the nested dependencies' own licences |
| `nativejson-benchmark` | Milo Yip's nativejson-benchmark at `478d572` (2022-10-28), test data: document's benchmarks (`libs/document/bench`) read its `data/canada.json`, `data/citm_catalog.json` and `data/twitter.json` at run time under the directory its define `WEBCPP_TEST_NATIVEJSON_BENCHMARK` gives, on every target (wasmtime is given it, `webcpp.data`), and run again when one of them changes; its own submodules are never checked out | MIT |
Expand Down Expand Up @@ -7359,18 +7363,25 @@ since that change); what is decided and not built is in chapter 17.
2026-11-21 to 2026-12-02 webcpp's BearSSL carried a fix of its own on the
mirror's `webcpp` branch and the checkers found nothing; the owner decision
of 2026-12-02 (chapter 5 rule 1) replaced it with the same fix submitted
upstream: BearSSL is pinned at `ae63032` of `webcpporg/bearssl`'s branch
upstream: BearSSL was pinned at `ae63032` of `webcpporg/bearssl`'s branch
`upstream/ecdsa-bits2int-constant-time`, upstream's `7bea48e` and that one
patch, until upstream applies it, and the checkers find nothing under it
(2026-12-02). The planted
patch, and the checkers found nothing under it on arm64 (2026-12-02). On
the x86-64 runner memcheck then found Clang turning P-256's scalar check
(`check_scalar` of `ec_p256_m62.c`, which `agree` reaches) into a jump on
the secret scalar, a select of the C made a branch by the code generator;
the owner decision of 2026-12-04 added the fix submitted upstream for it:
BearSSL is pinned at `f8a2f3d` of the fork's branch `webcpp-pin`, upstream's
`7bea48e` and the two patches, until upstream applies them, and memcheck
finds nothing under it on x86-64 either (2026-12-04). The planted
programs failed and dudect passed there too: dudect judged P-256's signing
with its low-S step (|t| 1.70 on Linux, 1.63 natively on an Apple M5 Max,
release, one run each; provisional, measured again in the final quiet
pass).
Source: `libs/crypto/test/constant_time/Jamfile`, `test/sizes/Jamfile`,
`bench/throughput.cpp`, `doc/backends.adoc` (libs/crypto);
BearSSL's `src/ec/ecdsa_i31_bits.c` at `7bea48e` (upstream) and at
`ae63032` (`webcpporg/bearssl`, the patch submitted upstream); the
BearSSL's `src/ec/ecdsa_i31_bits.c` and `src/ec/ec_p256_m62.c` at
`7bea48e` (upstream) and at `f8a2f3d` (`webcpporg/bearssl`, the patches
submitted upstream, `ae63032` and `ec57f88`); the
superseded fix's commits, `32381d6` and `205c5ff` of the mirror's `webcpp`
branch, are history.

Expand Down Expand Up @@ -10062,14 +10073,14 @@ delivery.
### codecs (bytes and values to text and back, and the conversion contract; own; accepted 2026-11-26, merged)

webcpp::codecs is webcpp's one contract for converting bytes and typed values to
text and back, and any data through one-shot and stream transformers, with seven
text and back, and any data through one-shot and stream transformers, with eight
formats over it, webcpp's own (`"port-of": null`, categories String and
Cryptography). It is implemented in `webcpporg/codecs`, the submodule
`libs/codecs`, built on the branch `codecs/genesis` of its repository and of the
superproject and merged on 2026-11-30, after the owner's CI ran once, at the
end. Its headers are `<webcpp/codecs.hpp>`, the core, which
registers no format and includes none, and
`<webcpp/codecs/{config,hex,base32,base58,base64,bech32,percent,armor}.hpp>`,
`<webcpp/codecs/{config,hex,base32,zbase32,base58,base64,bech32,percent,armor}.hpp>`,
each format reachable only through its own header, with `detail/core/` and
`detail/formats/` behind them; its targets are `/webcpp/codecs//codecs`,
header-only, depending on Boost's headers, config and secure, and
Expand Down Expand Up @@ -10123,7 +10134,10 @@ The owner's decisions:
`encode` and `decode` taking any `CharSet`; only this header depends on
Boost.URL), and, by decision 13, RFC 7468's armor. base58 becomes a template by
decisions 25 and 26 and bech32 by decision 27; `formats::base58`,
`formats::bech32` and `formats::bech32m` stay.
`formats::bech32` and `formats::bech32m` stay. z-base-32 (`formats::zbase32`,
pkarr's keys) joins them by the change `zbase32` (scope approved by the owner on
2026-12-01): base32's one implementation over its alphabet, lower case alone, no
padding, canonical, always constant time and streaming natively.
Source: design.md owner decision 5 and D13 (proposals); `include/webcpp/codecs/*.hpp`
(libs/codecs).
- **Owner decisions 6 and 11: constant time.** hex, base32, base64 and bech32 (and
Expand Down
6 changes: 4 additions & 2 deletions doc/releases/0.1.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ applications for native, browser and WASI targets, with explicit source distribu
and optional corrected SSL integration, from R.
* link:{library-pages}codecs/{library-page}[codecs]: one contract for converting
bytes and typed values to text and back, and any data through streams, for
{cpp}20, with hex, base32, base58, base64, bech32, percent-encoding and RFC 7468's
armor over it, from R.
{cpp}20, with hex, base32, z-base-32, base58, base64, bech32, percent-encoding
and RFC 7468's armor over it, from R.
* link:{library-pages}config/{library-page}[config]: webcpp's configuration,
which every library includes first: the target, exceptions and the version,
from R.
Expand Down Expand Up @@ -182,6 +182,8 @@ target through `/webcpp/third_party//wycheproof`.
`/third_party//secp256k1`, its tables chosen by `webcpp-secp256k1-tables`.
* Added bitcoin/bips to `third_party/`, whose BIP340 vectors a test reads on every
target through `/third_party//bips`.
* Added RFC 9180's test vectors (cfrg/draft-irtf-cfrg-hpke) to `third_party/`,
which crypto's HPKE tests read on every target through `/third_party//hpke`.
* Changed `/third_party//bips` to also serve BIP341's
`bip-0341/wallet-test-vectors.json`, whose cases run again when it changes.
* Changed the lint to never read third-party code under `third_party/libs/`.
Expand Down
2 changes: 1 addition & 1 deletion libs/codecs
Submodule codecs updated 69 files
+2 −2 AGENTS.md
+2 −2 README.md
+1 −1 doc/allocators.adoc
+1 −1 doc/changelog.adoc
+4 −4 doc/codecs.adoc
+40 −1 doc/formats.adoc
+8 −1 doc/overview.adoc
+1 −1 doc/secrecy.adoc
+1 −1 doc/streams.adoc
+1 −0 example/Jamfile
+59 −0 example/zbase32_pkarr.cpp
+6 −0 example/zbase32_pkarr.expected
+10 −763 include/webcpp/codecs/base32.hpp
+69 −26 include/webcpp/codecs/detail/formats/base32.hpp
+807 −0 include/webcpp/codecs/detail/formats/base32_codec.hpp
+84 −0 include/webcpp/codecs/detail/formats/zbase32.hpp
+70 −0 include/webcpp/codecs/zbase32.hpp
+2 −0 meta/include-boundaries.json
+1 −1 meta/libraries.json
+12 −2 test/Jamfile
+56 −0 test/allocation_test.cpp
+4 −2 test/base32_stream_test.cpp
+6 −2 test/base32_test.cpp
+77 −4 test/constant_time/dudect_test.cpp
+76 −21 test/constant_time/paths.hpp
+12 −3 test/fuzz/Jamfile
+1 −0 test/fuzz/corpus/zbase32/alphabet
+1 −0 test/fuzz/corpus/zbase32/character_digit_two
+1 −0 test/fuzz/corpus/zbase32/character_digit_zero
+1 −0 test/fuzz/corpus/zbase32/character_equals
+1 −0 test/fuzz/corpus/zbase32/character_ff
+1 −0 test/fuzz/corpus/zbase32/character_high_byte
+1 −0 test/fuzz/corpus/zbase32/character_letter_l
+1 −0 test/fuzz/corpus/zbase32/character_letter_v
+1 −0 test/fuzz/corpus/zbase32/character_newline
+ − test/fuzz/corpus/zbase32/character_nul
+1 −0 test/fuzz/corpus/zbase32/character_rfc4648_letter
+1 −0 test/fuzz/corpus/zbase32/character_space
+1 −0 test/fuzz/corpus/zbase32/document_d47a04
+1 −0 test/fuzz/corpus/zbase32/document_f0bfc7
+1 −0 test/fuzz/corpus/zbase32/empty
+1 −0 test/fuzz/corpus/zbase32/four_bytes
+1 −0 test/fuzz/corpus/zbase32/length_1
+1 −0 test/fuzz/corpus/zbase32/length_3
+1 −0 test/fuzz/corpus/zbase32/length_6
+1 −0 test/fuzz/corpus/zbase32/length_and_character
+1 −0 test/fuzz/corpus/zbase32/length_and_trailing_bits
+1 −0 test/fuzz/corpus/zbase32/one_byte
+1 −0 test/fuzz/corpus/zbase32/pkarr_invalid_key
+1 −0 test/fuzz/corpus/zbase32/pkarr_key
+1 −0 test/fuzz/corpus/zbase32/pkarr_key_cut
+1 −0 test/fuzz/corpus/zbase32/pkarr_key_padded
+1 −0 test/fuzz/corpus/zbase32/pkarr_key_trailing_bit
+1 −0 test/fuzz/corpus/zbase32/pkarr_key_upper_case
+1 −0 test/fuzz/corpus/zbase32/pkarr_other_key
+1 −0 test/fuzz/corpus/zbase32/sixty_four_bytes
+1 −0 test/fuzz/corpus/zbase32/trailing_bits_four_bytes
+1 −0 test/fuzz/corpus/zbase32/trailing_bits_one_byte
+1 −0 test/fuzz/corpus/zbase32/trailing_bits_three_bytes
+1 −0 test/fuzz/corpus/zbase32/trailing_bits_two_bytes
+1 −0 test/fuzz/corpus/zbase32/two_bytes
+28 −0 test/fuzz/zbase32_fuzz.cpp
+37 −0 test/noexcept_test.cpp
+91 −0 test/support/zbase32_reference.hpp
+3 −0 test/windows_h_after_test.cpp
+3 −0 test/windows_h_before_test.cpp
+350 −0 test/zbase32_stream_test.cpp
+528 −0 test/zbase32_test.cpp
+130 −0 test/zbase32_vectors.hpp
2 changes: 1 addition & 1 deletion libs/crypto
Submodule crypto updated 117 files
Loading