Repository navigation
crypto: the asynchronous family over the synchronous backends, and the heavy machinery on webcpp::hash's model - #14
Merged
Merged
Conversation
added 16 commits
November 21, 2026 21:21
… cancellation before and during the work and values that wipe themselves
…d work executor tested, and a heavy operation's value must move without throwing
… seam the browser backend fills
…y target Also the review's minors of the AES-GCM commit: the Jamfile's wording of when a call runs, the async_make documentation now true for key pairs, and the async_engine seam's documented shape.
…rage counter is generic, and the review's minors of 4.A3 and 4.A4 are closed
…tions, with use cases, and the sign example reports a missing public key
…ior, a const AES-GCM object gets the constness error, and crypto.hpp names the header it leaves out
…use, and the changelog's first line fits its word limit
…e on GCC 15 release, with the counting operators never inlined and each awaited result named before it is bound
…ts landing on main # Conflicts: # test/Jamfile # test/convenience_header_test.cpp
…s and use cases, and the P-256 chapter and the seam name the message the async functions hash
…er-case helpers, and its const and trailing-comma lint findings are fixed
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Increment 4, part A of the foundation:
<webcpp/crypto/async.hpp>, the asynchronous family over the synchronous backends, and the heavy operations' machinery rebuilt on webcpp::hash's model.The family (each takes first the executor its completion is posted to, holds
detail::timing_guardfirst, runs the synchronous call at initiation and completes through a post, never inline; an error completes with the empty object, which refuses every member withinvalid_state):async_make<Gcm>,async_seal->void(error_code, tag),async_open->void(error_code)async_generate,async_make<Keypair>,async_sign->void(error_code, std::array<uint8_t, 64>),async_verify->void(error_code)async_agree->void(error_code, secret<32>)async_generate,async_makefrom the raw scalar,async_signandasync_verifyover the message (hashed with SHA-256, as WebCrypto's ECDSA does),async_agree(the raw x coordinate)default_async_backend_t<Family>is the synchronous default on every target;detail::asynchronous_backend_vanddetail::async_engineare the seam part B's browser backend fills.The heavy machinery (
detail/heavy.hpp):detail::run_on_workports hash'sheavy_state,heavy_jobandheavy_initiation, carrying a value: guards checked on the caller's thread, the work on the work executor, completion on the handler's associated executor, cancellation before the start (every type) and during it (terminal,partial), values that wipe themselves, every state in the handler's associated allocator. No public heavy operation exists yet.Also:
doc/async.adocand two examples (async_seal,async_sign), the capability table's async rows per family, the generator's per-overload briefs inllms.txt, coverage of every async function in the timing coverage tests, and fixes the Linux lint and GCC 15 release builds asked for.Verified locally: native clang and GCC 15, wasip2, wasip3 and Emscripten in debug and release (the heavy test natively and on Emscripten with
-pthread),generate.py --check, the doc build, the macOS and Linux lints, MSVC 14.3 and 14.5 under Wine (one emulator-only failure,async_p256_no_exceptions, the known no-/EHBoost.JSON artifact). Measurements: none. The CI runs at the end of the owner's queue.