Skip to content

crypto: webcpp::crypto 0.1, its third-party code, its build and its rulebook - #20

Merged
pinhopro merged 65 commits into
mainfrom
crypto/v0.1
Nov 16, 2026
Merged

pinhopro merged 65 commits into
mainfrom
crypto/v0.1

Conversation

@pinhopro

Copy link
Copy Markdown
Contributor

Summary

The superproject's half of webcpp::crypto version 0.1 (proposal genesis, plan Tasks 25 and 30
in one pull request, as version 0.1 joins increments 1 and 2): the third-party submodules crypto
builds from source, their targets under /third_party, the tools and lint rules crypto's
evidence needs, the rulebook, and the submodule libs/crypto at the head of
webcpporg/crypto's pull request. It also moves libs/asio and libs/trystero to the commits of
their own pull requests.

The branch is rebased onto #19's head (tools/release-link-followups, a60e6fe), as if #19 had
merged: until it does, this pull request shows #19's three commits too. Merge order (the
owner's): #19, then webcpporg/asio's pull request (with a merge commit: its base is the asio
commit #19 records, which asio's main merged in #4), then this one; then webcpporg/crypto's
and webcpporg/trystero's are re-run against the new main and merged by fast-forward, so that
main records commits of their main. hash/v0.1 and nodiscard/v0.1 follow; #17 rebases onto
them. The third-party targets compile libs/crypto/src/canary_*.c, so they cannot land without
the submodule.

What changes

  • Submodules (CODING-GUIDELINES.md chapter 10 rows with pin and licence):
    third_party/libs/bearssl (webcpporg/bearssl), wycheproof (C2SP, shallow), secp256k1
    (v0.8.0), bips (shallow, BIP340 and BIP341 vectors), bitcoin (shallow, ctaes as Bitcoin
    Core v31.1 ships it); libs/crypto (../crypto.git).
  • third_party/Jamfile and the Jamroot: /third_party beside /webcpp/third_party; BearSSL,
    ctaes and libsecp256k1 built file by file with crypto's canary (libsecp256k1's tables by
    target, BearSSL's entropy defines keyed on the target OS, /OPT:REF quoted); one
    configuration for each library and its own tests.
  • Tools: webcpp.same-program (a library named and not called adds no byte);
    tools/test/crypto_jamfiles_test.py with the user's Jamfiles as fixtures and its outcome
    format (contains:, not-contains:, line:, same-as:); openssl_one_copy_test.py;
    webcpp.compile-diagnostic fails on a directive clang's -verify drops (and asio's three
    tests that it caught are fixed in webcpporg/asio's pull request); libsecp256k1 no longer an
    external library in tools/ci.
  • Lint rules: canary pins (each canary's commit against its submodule), entropy sources
    (no weaker source in a header that reads entropy), nodiscard results (opt-in per library
    through meta/lint.json; crypto opts in).
  • Documentation site: tables that do not fit stack as cards, names in tables break between
    their parts, links over code keep underscores visible, references leave detail macros out;
    the changelog rule refuses inline anchors.
  • libs/trystero: libsecp256k1 from /third_party//secp256k1 instead of its own build.
  • Rulebook: CODING-GUIDELINES.md chapter 15 gains crypto's section as built, chapter 17
    keeps only crypto's later work, chapters 5, 9, 10, 16 and 19 updated; AGENTS.md (library
    table, layout, the c-suites lane, MSVC message cases); README.md's crypto row;
    doc/releases/0.1.0.adoc.

Verification

Local, from scratch (b2 -a), at the final commits of this branch and the library:

  • crypto: native Apple Clang 152 passed, gcc-15 141, wasip2 140, wasip3 133, Emscripten 92;
    c-suites on native, wasip2, wasip3, Emscripten; trystero native 52 and Emscripten 59;
  • amd64 Linux in the CI's docker image (gcc-14): 141 passed;
  • MSVC 14.3 and 14.5 at /W4 /WX in a local Wine-hosted lane that mirrors the CI's MSVC lanes: every
    must-fail message case fails for the right reason; the same-program and report findings of its
    first run (backslash paths, .pdb outputs) are fixed. MSVC 14.3 verified locally on the final
    combined tree (nodiscard/v0.1 c510459, which holds this branch): 347 of 355 rows pass, the 8 left
    being the known Wine artifact (no-exceptions units that include Boost.JSON, which the Windows CI
    compiles), summarize.sh: "green but for the known Wine failures"; 14.5 is left to the Windows
    CI, since both versions gave identical results on every earlier local run;
  • b2 -a doc with every library's rendered check (14 pages, 390 to 1440 px, no sideways
    scroll); matrix.py plan and own-lanes for crypto (ten lanes, external: false; c-suites
    on four targets);
  • all 57 tools/**/*_test.py (61 with hash's), the lint lint: clean;
  • crypto_jamfiles_test.py within Task 10's 30 minutes on every target (71 to 324 s).

Reviews: per-task spec and quality reviews, a final whole-branch review by three reviewers
(API, tests and build, documentation), one fix wave, a scoped re-review that approved it, and a
polish round on the rendered tables.

Known limits

  • MSVC's exact message text (C1189, C2338, LNK2001, LNK2038) is checked on no CI; the cases
    themselves fail on msvc-14.3 and msvc-14.5 on every push (chapter 19).
  • The source-built OpenSSL is no-asm on MSVC, wasip2 and wasip3; crypto has no size table
    until its sizes lane.
  • The tools job has no macOS or Windows leg; ld64's messages were checked on a developer's
    macOS.
  • The site's stacking tables use a small inline script; without it they scroll in their box.

Follow-ups

  • webcpporg/webcpp, branch hash/v0.1: webcpp::hash's pull request, stacked on this one.
  • The deferred crypto tasks (memory option, constant time, sizes, browser lane, nightly level,
    NIST CAVP) and trystero's code migration onto crypto.
  • [[nodiscard]] on asio, beast, cobalt and trystero (55 functions) and their opting into the
    rule: nodiscard/v0.1, stacked on hash/v0.1, with one pull request per library.
  • The proposals' pull request recording version 0.1 as implemented.

🤖 Generated with Claude Code

R added 30 commits November 15, 2026 11:09
…NG-GUIDELINES.md: OpenSSL targets and alias name
…y and its tests, and cases for both refusals
… drops

The rule compiled with -verify-ignore-unexpected=error, which tolerates the
cascade of errors after a header's #error but also hid the errors -verify
reports on a directive it cannot read: a header it names that cannot be
located, a {{...}} whose }} is not on its line. -verify then dropped the
directive and the test passed on nothing.

The test is now a type of its own (tools/compile_diagnostic): the object's
compile writes its compilation database entry (-MJ), and check.py runs that
exact command again with clang's diagnostic log, which records every
diagnostic, those -verify ignores included, and fails on any error located
in a directive. The cascade is still tolerated.

Also wraps the same-program usage line of webcpp.jam's header comment,
which was over the Jam comment width.
R added 28 commits November 16, 2026 02:40
…//secp256k1, for the lax DER decoding of ECDSA signatures
…mscripten refusals and the canaries as contains: lines, openssl_linked's tag, and encrypt_and_sign waiting for the BearSSL backend
…same-as: copies, every Jamfile and outcome tagged for the page; doc: crypto among the new libraries of 0.1.0
Chapter 15 gains crypto's decisions as version 0.1 built them, and chapter 17 keeps only the later work; chapter 5 names crypto under rule 5, chapter 16 lists crypto's later work, and chapter 19 records its limits against rules 11 and 12. AGENTS.md lists the library, the new submodules, the lane c-suites and the MSVC message cases; README.md gains its row.
…Emscripten without a backend, a missing /third_party// name and the BIPs' pin; third_party: BearSSL's entropy defines keyed on Windows alone
…ithout [[nodiscard]] in a library that asks for it in its meta/lint.json; third_party: the seeder comment rewrapped to 80 columns
…n their parts, links keep code's underscores visible, references leave detail macros out; the rulebook: crypto's outcome directive not-contains:, the c-suites limit on MSVC, the nodiscard results rule, chapter 10 sorted
…r anchor:, which shows no text: crypto's [[nodiscard]] was missing from its line
…em whole, and stacks only after that; a matrix of eight columns or more scrolls in its box rather than stack; the measure runs again on load and once the fonts are ready; the roles keep and key-column; the table of contents breaks a name after its ::
… they break at a _ or a -, and a key-column table stacks rather than break them so; code in a table wraps only where postprocess.mjs marks a break; a matrix's first column, and a key-column table's, keep their hyphenated keys whole, a matrix's 9em wide
…ts directory between either separator, as b2 spells a path on Windows with backslashes, where it compared nothing and failed every pair
…s beside the program is the program's, not a failure outside every test: a link-fail test's expected failure on MSVC
The library's repository is webcpporg/crypto. The third-party targets compile its canaries, so the submodule lands with them in one pull request. The recorded commit becomes the library's main by a fast-forward once this merges.
…e counting header's misc-definitions-in-headers exception that Linux's clang-tidy asks
…scope, the head's col and the body's row, as html-validate's wcag/h63 asks of webcpp::crypto's namespace tables
@pinhopro
pinhopro merged commit 8f8ef50 into main Nov 16, 2026
2 of 20 checks passed
@pinhopro
pinhopro deleted the crypto/v0.1 branch November 17, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant