diff --git a/README.md b/README.md index 8625b7f..193e003 100644 --- a/README.md +++ b/README.md @@ -55,11 +55,11 @@ tag is placed. | config | [timing-guard](libraries/config/openspec/changes/archive/2026-11-24-timing-guard) | config: one DIT timing guard for every webcpp library, moved from crypto and hash, Windows on ARM64 covered | own | withdrawn | | 2026-11-24 | | | crypto | [genesis](libraries/crypto/openspec/changes/genesis) | crypto: authenticated encryption, randomness and secp256k1 over C backends | wrapper | implementing | | 2026-10-11 | [code](https://github.com/webcpporg/crypto) | | crypto | [backend-concepts](libraries/crypto/openspec/changes/backend-concepts) | crypto: every backend capability an internal concept, the contract of the shipped backends | wrapper | proposed | | 2026-11-22 | | -| crypto | [hpke](libraries/crypto/openspec/changes/hpke) | crypto: HPKE (RFC 9180) composed from crypto's own primitives, readable names, the mode from the arguments | wrapper | proposed | | 2026-11-23 | | | crypto | [foundation](libraries/crypto/openspec/changes/foundation) | crypto: the cryptographic foundation, every backend in full, one default per family and a browser backend | wrapper | accepted | | 2026-11-14 | | | crypto | [api-gaps](libraries/crypto/openspec/changes/api-gaps) | crypto: the API gaps of version 0.2 closed, and dudect judged on hosted runners | wrapper | implementing | | 2026-11-20 | [code](https://github.com/webcpporg/crypto) | | crypto | [data-independent-timing](libraries/crypto/openspec/changes/data-independent-timing) | crypto: the library sets arm64's DIT around every cryptographic operation | wrapper | implementing | | 2026-11-20 | [code](https://github.com/webcpporg/crypto) | | crypto | [formats](libraries/crypto/openspec/changes/formats) | crypto: one encode and one decode for every key and signature format, the format as a value | wrapper | implementing | | 2026-11-22 | [code](https://github.com/webcpporg/crypto) | +| crypto | [hpke](libraries/crypto/openspec/changes/hpke) | crypto: HPKE (RFC 9180) composed from crypto's own primitives, readable names, the mode from the arguments | wrapper | implementing | | 2026-11-23 | [code](https://github.com/webcpporg/crypto) | | crypto | [one-verb](libraries/crypto/openspec/changes/one-verb) | crypto: codecs' verbs are crypto's: crypto::encode and crypto::decode removed, the check declared to codecs, PEM on a fixed label and decoded in place | wrapper | implementing | | 2026-12-02 | [code](https://github.com/webcpporg/crypto) | | crypto | [unified-sign](libraries/crypto/openspec/changes/unified-sign) | crypto: one sign and verify on every curve, the scheme always named, the key pair contract and four forms of each operation | wrapper | implementing | | 2026-11-22 | [code](https://github.com/webcpporg/crypto) | | crypto | [uniform-types](libraries/crypto/openspec/changes/uniform-types) | crypto: typed signatures, typed X25519 keys, and concepts for key pairs, AEADs and boxes | wrapper | implementing | | 2026-11-22 | [code](https://github.com/webcpporg/crypto) | diff --git a/libraries/crypto/openspec/changes/hpke/.openspec.yaml b/libraries/crypto/openspec/changes/hpke/.openspec.yaml index 875ee6d..ae7c33d 100644 --- a/libraries/crypto/openspec/changes/hpke/.openspec.yaml +++ b/libraries/crypto/openspec/changes/hpke/.openspec.yaml @@ -5,7 +5,7 @@ webcpp: title: "crypto: HPKE (RFC 9180) composed from crypto's own primitives, readable names, the mode from the arguments" kind: wrapper port_of: null - status: proposed + status: implementing release: null - implementation: null + implementation: https://github.com/webcpporg/crypto decided: 2026-11-23 diff --git a/libraries/crypto/openspec/changes/hpke/design.md b/libraries/crypto/openspec/changes/hpke/design.md index 23b4a87..720338c 100644 --- a/libraries/crypto/openspec/changes/hpke/design.md +++ b/libraries/crypto/openspec/changes/hpke/design.md @@ -715,6 +715,80 @@ returning to the owner. agreement and an AEAD, both already measured; a later measurement is a release build's, never a debug build's. +## Rulings made while building (2026-12-04) + +Settled by the builder where the design left a choice open or met a fact it did not foresee; each +keeps the owner's decisions and the design's rulings. + +- **R13: the asynchronous forms take one pack**, `Suite::async_begin_sending(executor, + arguments_then_token...)` and the same for `async_begin_receiving`, the single-shot `async_seal` + and `async_open`, member and free: the synchronous arguments then the completion token, the + arguments kept until the call runs as the synchronous call takes them (a span as a span, writable + where the argument is; a key, an encapsulated key and a pre-shared key by value; a key pair, + which cannot be copied, by reference) and handed to the synchronous overloads. Why: the four + argument lists stay the synchronous overloads' alone, with one catch-all diagnostic; sixteen more + declarations, each repeating them, would add nothing a reader needs. `async_derive_from_seed` + and the contexts' `async_seal` and `async_open` keep their fixed signatures. +- **R14: the encapsulated key is default-constructible, to its zero value**, public: a regular + value type, as R5 calls it, which a moved-from sender holds (B14) and an error completion gives. + No recipient accepts it: X25519's agreement refuses it as `weak_public_key`, P-256's + `from_bytes` as `invalid_public_key`; the tests check both. +- **R15: `default_backends` and `backends` are declared in + `hpke/context.hpp`**, which `hpke.hpp` includes, rather than in `hpke.hpp` (B1): the contexts' + AEAD type is resolved from them. `detail::hpke_access` is in `hpke.hpp`, beside the setups it + calls. What a program writes is unchanged. +- **R16: the catch-alls test the four argument lists through declared-only functions** + (`detail::hpke_forms`, the four forms' parameter types, never defined), so that a call + that converts (a vector to a span) still reaches its real overload and any other list reaches + the catch-all and its one message (B2). A braced `{}` argument, which no template deduces, + reaches no catch-all: the compiler's own "no matching function" names the candidates. +- **R17: `export_secret` declares `result>` for every valid + length and a one-byte secret outside the bounds**, so that its `static_assert` with the bounds is + the build's only error (`secure::secret<0>` would add webcpp::secure's own); the message test + pins it. +- **R18: the counting test runs on the backends that allocate nothing**, libsodium and BearSSL + (X25519 beside BearSSL's AEADs, P-256 wholly on BearSSL), every suite: OpenSSL's AES-GCM, + AES-GCM's native default, allocates its context on the C heap, which the counting test counts + with operator new's, and is its page's (D10). +- **R19: OpenSSL's limits include a plaintext of at least one byte**: `OSSL_HPKE_seal` refuses an + empty one, which RFC 9180 allows; the cross-check seals 1, 17 and 300 bytes, and the empty + message is checked by `hpke_test` (B10). +- **R20: two vector programs**: on the defaults, every target (natively AES-GCM on OpenSSL), and + with BearSSL's AEADs (P-256 wholly on BearSSL, X25519 on `backends`, MLS's suite + natively without OpenSSL, the spec's first scenario), so that every vector runs on both AES-GCM + backends natively. The key encapsulation's and the key schedule's values are read through the + `detail` functions the setups call (`hpke_dhkem`, `hpke_key_schedule`), not stored in the + contexts (B11); `detail::hpke_access` keeps the seam and the sequence number (R9). +- **R21: the vectors' superproject change lands first, on its own branch**: a library's CI checks + out webcpp's `main`, so `third_party/libs/hpke` and `/third_party//hpke` must be on `main` before + crypto's tests run there. The superproject's pull request `third_party/hpke-vectors` (the + submodule, `third_party/Jamfile`, the pin and refusal tests of `tools/test/third_party_test.py`, + the guidelines' table, the release notes) merges before crypto's; the gitlink of crypto follows + in its own pull request. The repository's licence (B3): an IETF Contribution under the IETF + Trust's Legal Provisions, code components under the Simplified BSD License; the submodule + redistributes nothing. +- **R22: the constant-time paths derive the ephemeral key from a secret seed through the test + seam**: the generator's draws are not marked secret by the checkers, so a path with `generate()` + would trace nothing of the sender's agreement. dudect gains HPKE's key schedule against its + shared secret (`hpke_key_schedule`, P-256, HKDF-SHA256 and AES-128-GCM on BearSSL, auth_psk) with + its A/A control (`hpke_key_schedule_aa`): the composition HPKE adds, the curves and AEADs keeping + their own cases. The lane's path list in `crypto.json` names HPKE's. +- **R23: twelve message tests**, D11's list (the two export lengths in one test), with the + specification's `ciphers::aes128_gcm` given as a suite's cipher; each has its MSVC twin in + `test/msvc`. +- **R24: crypto's changelog keeps ten lines**: its unreleased section was at the limit, so its two + PEM lines became one and HPKE's line took the other place. + +- **R25: webcpp::hash writes `max` and `min` in parentheses**: HPKE's headers include + webcpp::hash's HKDF, whose `detail/limits.hpp` wrote `std::numeric_limits::max()`, + which a bare `` before it turns into MSVC's C2589; crypto's `windows_h_before` test + found it on MSVC 14.3. webcpporg/hash's branch `hash/windows-h-macros` parenthesizes every `max` + and `min` of its headers and adds the test `windows_h`; the superproject's gitlink of hash moves + with the vectors (R21), before crypto's pull request. +- **R26: no fuzz target**: crypto's fuzz lane fuzzes its formats' decoders; HPKE decodes nothing: + its untrusted inputs are an encapsulated key of a fixed size, which the curves' fuzzed + `from_bytes` validates, and AEAD ciphertexts, which the tag rejects. + ## Risks / Trade-offs - **A dependency on a hash change** (R1): HPKE cannot start before `hkdf-pieces` merges; that @@ -732,3 +806,17 @@ returning to the owner. Nothing migrates: HPKE is new. After crypto/uniform-types and hash's `hkdf-pieces` merge: branches `crypto/hpke` of webcpporg/crypto, webcpporg/proposals and the superproject (the vectors submodule); local verification on every lane; merged by the controller; one CI at the end. + +## As built + +Built on 2026-12-04: crypto's branch `crypto/hpke` (one commit), the superproject's +`third_party/hpke-vectors` (webcpporg/webcpp#66, the vectors, R21) and hash's +`hash/windows-h-macros` (webcpporg/hash#20, R25). Local verification, crypto's tests and examples: +clang and gcc-15 natively, wasip2, wasip3 and Emscripten, every target clean (first run 684, 489, +634, 616 and 410 passed, then the final head's rebuilt targets); MSVC 14.3 and 14.5 x64 debug +690 passed each on the first run, whose five failures (C2589 of hash's `max` after a bare +``, C4459 of the asynchronous test's globals) were fixed (R25), then 273 rebuilt targets +passed each on the final head, no new failure; the constant-time lane on Linux (memcheck, +MemorySanitizer and dudect, HPKE's paths and `hpke_key_schedule` |t| 1.45, its A/A control 1.32) +and natively; the macOS lint and the Linux lint clean. Each test was seen failing first: one label +changed (576 failed exports in the vectors), the pre-shared key's bound at 31 (16 suites). diff --git a/libraries/crypto/openspec/changes/hpke/proposal.md b/libraries/crypto/openspec/changes/hpke/proposal.md index a83f2dd..a7078f5 100644 --- a/libraries/crypto/openspec/changes/hpke/proposal.md +++ b/libraries/crypto/openspec/changes/hpke/proposal.md @@ -91,5 +91,6 @@ None. RFC 9180 test vectors as a test-data submodule, its `third_party/Jamfile` entry and CODING-GUIDELINES.md's third-party table, the pointer). - **Status:** approved by the owner on 2026-11-23 (`decided`), the open questions answered - (design.md, owner decisions 10 to 14); `proposed` until `reference/plan.md` carries the plan's - code, then `accepted`, which `tools/proposals.py` requires. + (design.md, owner decisions 10 to 14); `implementing` since 2026-12-04, `reference/plan.md` + carrying the plan's code: built on crypto's branch `crypto/hpke`, the vectors on the + superproject's `third_party/hpke-vectors` (design R21). diff --git a/libraries/crypto/openspec/changes/hpke/reference/plan.md b/libraries/crypto/openspec/changes/hpke/reference/plan.md new file mode 100644 index 0000000..e5cb325 --- /dev/null +++ b/libraries/crypto/openspec/changes/hpke/reference/plan.md @@ -0,0 +1,155 @@ +--- +title: "webcpp::crypto, HPKE (RFC 9180): Implementation Plan" +tags: [webcpp, crypto, hpke, rfc9180, mls, plan] +status: accepted +created: 2026-12-04 +--- + +# webcpp::crypto, HPKE (RFC 9180): Implementation Plan + +**Goal:** RFC 9180's HPKE in `webcpp::crypto::public_key_encryption::hpke`, composed from crypto's +X25519 and P-256 agreements, webcpp::hash's HKDF over pieces and crypto's AES-GCM and +ChaCha20-Poly1305, every CFRG vector of those suites passing on every target and OpenSSL's HPKE +agreeing within its limits. + +**Architecture:** `../design.md` D1 to D12, R1 to R24, B1 to B15. Four headers, no backend of +its own; the asynchronous forms in `async.hpp`; one new error value. + +**Spec:** `../proposal.md`, `../design.md`, `../specs/crypto/spec.md`, `../tasks.md`. + +Paths are relative to the library, `libs/crypto/` of the superproject, unless they start with the +superproject's root. `$B2` is `env -u CPATH -u CPLUS_INCLUDE_PATH -u C_INCLUDE_PATH b2 +--user-config=.local/user-config.jam`, run from the superproject's root. + +## Global Constraints + +- English everywhere, no em dash, no trailer in commits; never edit a generated file (run + `python3 doc/tables/generate.py`, then `--check`). +- Every public function that computes on a secret holds `secure::timing_guard` first, is + `noexcept` and returns a `result`; every intermediate secret is a `secure::secret`. +- Nothing allocates; no variable-length input is capped (owner decision 6). + +## Task 1: the test data and the error value + +Files: the superproject's `.gitmodules`, `third_party/libs/hpke` (cfrg/draft-irtf-cfrg-hpke at +`5f503c5`, shallow), `third_party/Jamfile`, `tools/test/third_party_test.py`, +`CODING-GUIDELINES.md`, `AGENTS.md`, `doc/releases/0.1.0.adoc`; crypto's +`include/webcpp/crypto/error.hpp`, `test/error_test.cpp`, `doc/errors.adoc`. + +- [x] Step 1: `/third_party//hpke`, as `/third_party//bips` is: + +```jam +path-constant HPKE : libs/hpke ; +.hpke = [ regex.replace $(HPKE) "\\\\" "/" ] ; +.hpke-files = [ glob libs/hpke/test-vectors.json ] ; +alias hpke : : @hpke-checked-out : : + "\"WEBCPP_TEST_HPKE=\\\"$(.hpke)\\\"\"" + [ webcpp.data $(HPKE) ] + $(.hpke-files) ; +explicit hpke ; +``` + +- [x] Step 2: `error::message_limit_reached = 21`, "the context has sealed or opened as many + messages as its nonce allows"; `error_test` counts 21 values. + +## Task 2: the labeled key derivation + +Files: `include/webcpp/crypto/public_key_encryption/hpke/key_derivation.hpp`. + +- [x] Step 1: the tags and the concept (D2), then RFC 9180's labeled HKDF over pieces (D4): + +```cpp +template +[[nodiscard]] boost::system::result hpke_labeled_expand( + std::span pseudorandom_key, + std::span suite_identifier, std::span label, + std::span application_info, + std::span output_key_material) noexcept { + std::array const length_bytes{ + static_cast(output_key_material.size() >> 8U), + static_cast(output_key_material.size() & 0xffU)}; + auto const expanded = hash::hkdf_expand( + output_key_material, pseudorandom_key, + {length_bytes, hpke_version_label, suite_identifier, label, application_info}); + if (!expanded) { + secure::erase_secret(output_key_material); + return error::backend_failure; + } + return {}; +} +``` + +## Task 3: the key encapsulations + +Files: `include/webcpp/crypto/public_key_encryption/hpke/key_encapsulation.hpp`. + +- [x] Step 1: `basic_encapsulated_key`, the concept `key_encapsulation_mechanism`, the two + tags with their sizes, `key_derivation_type`, `family_type`, `keypair_type` and + `public_key_type` (D2, D3, R5, R14). +- [x] Step 2: `detail::hpke_dhkem`: `extract_and_expand`, `encapsulate` and `decapsulate` + with an optional sender, the agreements joined in a secret, the context on the stack. +- [x] Step 3: `derive_from_seed`: X25519's `sk` unclamped (R7), P-256's candidate loop, its verdict + `p_curve_scalar_valid`'s, declassified; a seed shorter than 32 bytes refused (R6). + +## Task 4: the key schedule, the contexts and the suite + +Files: `include/webcpp/crypto/public_key_encryption/hpke/context.hpp`, +`include/webcpp/crypto/public_key_encryption/hpke.hpp`, `include/webcpp/crypto.hpp`. + +- [x] Step 1: the cipher tags, `suite_cipher`, `sealing_cipher`, `default_backends` and + `backends` (R15), the key schedule (D5): + +```cpp +schedule.key_schedule_context[0] = mode; +std::ranges::copy(psk_id_hash->bytes(), schedule.key_schedule_context.begin() + 1); +std::ranges::copy(info_hash->bytes(), schedule.key_schedule_context.begin() + 1 + hash_size); +auto extracted = hpke_labeled_extract(shared_secret, suite_identifier, + secret_label, pre_shared_key); +``` + +- [x] Step 2: `detail::hpke_context_core` (the AEAD, the base nonce, the exporter secret, + the 64-bit sequence number), `sender_context` and `recipient_context`, move-only, wiped. +- [x] Step 3: `suite`: the four `begin_sending`, the four `begin_receiving`, the + four single-shot `seal` and `open` (`requires sealing_cipher`), each name's catch-all + (R16), `derive_from_seed`; `pre_shared_key`; the free forms; `detail::hpke_access`. + +## Task 5: the tests + +Files: `test/support/hpke_vectors.hpp`, `test/hpke_vectors_default_test.cpp`, +`test/hpke_vectors_bearssl_test.cpp`, `test/hpke_test.cpp`, `test/hpke_allocation_test.cpp`, +`test/hpke_openssl_test.cpp`, `test/Jamfile`. + +- [x] Step 1: the 64 CFRG entries through every path, on the defaults and with BearSSL's AEADs + (R20); seen failing first with one label changed (576 failed exports). +- [x] Step 2: the four modes, refusals, minimums, sequence limit, Marmot's two recovery-key + vectors; seen failing first with the pre-shared key's bound at 31 (16 suites). +- [x] Step 3: no allocation and the long inputs against the joined computation (R18). +- [x] Step 4: OpenSSL's HPKE, both directions, every suite and mode (R19). + +## Task 6: the asynchronous forms + +Files: `include/webcpp/crypto/async.hpp`, `test/hpke_async_test.cpp`. + +- [x] Step 1: `detail::hpke_complete`, the members' and the free forms' definitions (R13), the + browser's refusal (R8). + +## Task 7: messages, coverage, the constant-time lane + +Files: `test/messages/hpke_*`, `test/msvc/hpke_*`, `test/support/hpke_coverage.hpp`, +`test/timing_coverage_sodium_test.cpp`, `test/timing_coverage_bearssl_test.cpp`, +`test/constant_time/paths.hpp`, `test/constant_time/dudect_test.cpp`, `test/user_globals_test.cpp`. + +- [x] Step 1: twelve message tests and their MSVC twins (R23). +- [x] Step 2: every HPKE function's guard on libsodium and BearSSL. +- [x] Step 3: HPKE's two paths (R22) and dudect's key schedule with its A/A control. + +## Task 8: the page and the delivery + +Files: `doc/public_key_encryption.adoc`, `doc/async.adoc`, `doc/overview.adoc`, +`doc/secret_key_encryption.adoc`, `doc/changelog.adoc`, `doc/tables/crypto.json`, `README.md`, +`example/hpke_base.cpp`, `example/hpke_base.expected`, `example/Jamfile`. + +- [x] Step 1: the guide's HPKE section with D12's table; the example; `crypto.json` (the + namespace's row, the operation, the use case, the twelve fixes, the lane's path); the generated + files rerun. +- [ ] Step 2: every lane, the pull requests, the merges, the superproject's gitlink. diff --git a/libraries/crypto/openspec/changes/hpke/tasks.md b/libraries/crypto/openspec/changes/hpke/tasks.md index 3b45580..3fbee7d 100644 --- a/libraries/crypto/openspec/changes/hpke/tasks.md +++ b/libraries/crypto/openspec/changes/hpke/tasks.md @@ -6,36 +6,36 @@ end of every task. A plan with code goes in `reference/plan.md` when the proposa ## 1. Test data and the error value -- [ ] 1.1 The superproject's test-data submodule of the CFRG vectors (cfrg/draft-irtf-cfrg-hpke at 5f503c5) after its licence check, its `third_party/Jamfile` entry and define, wasmtime's directory, CODING-GUIDELINES.md's third-party row (design B3) -- [ ] 1.2 `error::message_limit_reached = 21`, its message, `error_test`, the guide's error table (D9) +- [x] 1.1 The superproject's test-data submodule of the CFRG vectors (cfrg/draft-irtf-cfrg-hpke at 5f503c5) after its licence check, its `third_party/Jamfile` entry and define, wasmtime's directory, CODING-GUIDELINES.md's third-party row (design B3) +- [x] 1.2 `error::message_limit_reached = 21`, its message, `error_test`, the guide's error table (D9) ## 2. The labeled key derivation -- [ ] 2.1 `hpke/key_derivation.hpp`: `hkdf_sha256`, `hkdf_sha512`, the concept `key_derivation_function`, `detail::hpke_labeled_extract` and `hpke_labeled_expand` over webcpp::hash's `hkdf_extract` and `hkdf_expand` taking pieces, the extracted key wiped; tests against the single-buffer `hash::hkdf_extract` and `hkdf_expand` on concatenated inputs, short and long, and a counting `operator new` test (D4, R1, B5) +- [x] 2.1 `hpke/key_derivation.hpp`: `hkdf_sha256`, `hkdf_sha512`, the concept `key_derivation_function`, `detail::hpke_labeled_extract` and `hpke_labeled_expand` over webcpp::hash's `hkdf_extract` and `hkdf_expand` taking pieces, the extracted key wiped; tests against the single-buffer `hash::hkdf_extract` and `hkdf_expand` on concatenated inputs, short and long, and a counting `operator new` test (D4, R1, B5) ## 3. The key encapsulations -- [ ] 3.1 `hpke/key_encapsulation.hpp`: the two tags, their `encapsulated_key` types, the concept `key_encapsulation_mechanism`, the DHKEM's encapsulation and decapsulation and their authenticated forms in `detail`, validation as the typed keys give it (D3, R5) -- [ ] 3.2 `derive_from_seed` for X25519 and P-256, the seed's minimum, the candidate loop and its declassified verdict; the CFRG `ikm`/`sk`/`pk` triples of both curves, unclamped and clamped (D3, R6, R7) +- [x] 3.1 `hpke/key_encapsulation.hpp`: the two tags, their `encapsulated_key` types, the concept `key_encapsulation_mechanism`, the DHKEM's encapsulation and decapsulation and their authenticated forms in `detail`, validation as the typed keys give it (D3, R5) +- [x] 3.2 `derive_from_seed` for X25519 and P-256, the seed's minimum, the candidate loop and its declassified verdict; the CFRG `ikm`/`sk`/`pk` triples of both curves, unclamped and clamped (D3, R6, R7) ## 4. The key schedule, the contexts and the suite -- [ ] 4.1 `hpke/context.hpp`: the four cipher tags, `suite_cipher` and `sealing_cipher`, the key schedule in `detail` (export-only skipping key and nonce), `sender_context` and `recipient_context` (move-only, wiped, the internal 64-bit sequence, `seal`, `open`, both `export_secret` forms, `encapsulated_key()`), `detail::hpke_access` (D5, D6, R3, R4, R9, B11) -- [ ] 4.2 `hpke.hpp`: `suite` with `default_backends`, `pre_shared_key`, the eight `begin_*` overloads, the eight single-shot `seal` and `open` overloads, the catch-alls with their message, the free forms in `hpke`; the convenience header (D7, R2, B1, B2) -- [ ] 4.3 The CFRG vector test: the 64 entries of the supported suites, every mode, every encryption in order, every export, the export-only entries; on every target (D11) -- [ ] 4.4 The round trips and refusals of the four modes for every suite, single-shot and multi-shot; the sequence's exhaustion through the seam; the long inputs (4 KiB, 64 KiB, 1 MiB) with no allocation; Marmot's recovery-key vector (D11, B4, B10) +- [x] 4.1 `hpke/context.hpp`: the four cipher tags, `suite_cipher` and `sealing_cipher`, the key schedule in `detail` (export-only skipping key and nonce), `sender_context` and `recipient_context` (move-only, wiped, the internal 64-bit sequence, `seal`, `open`, both `export_secret` forms, `encapsulated_key()`), `detail::hpke_access` (D5, D6, R3, R4, R9, B11) +- [x] 4.2 `hpke.hpp`: `suite` with `default_backends`, `pre_shared_key`, the eight `begin_*` overloads, the eight single-shot `seal` and `open` overloads, the catch-alls with their message, the free forms in `hpke`; the convenience header (D7, R2, B1, B2) +- [x] 4.3 The CFRG vector test: the 64 entries of the supported suites, every mode, every encryption in order, every export, the export-only entries; on every target (D11) +- [x] 4.4 The round trips and refusals of the four modes for every suite, single-shot and multi-shot; the sequence's exhaustion through the seam; the long inputs (4 KiB, 64 KiB, 1 MiB) with no allocation; Marmot's recovery-key vector (D11, B4, B10) ## 5. The asynchronous forms -- [ ] 5.1 `async_begin_sending`, `async_begin_receiving`, the single-shot and the contexts' `async_seal` and `async_open`, `async_derive_from_seed`, member and free, in `async.hpp`; posted on native backends; the browser stand-in's refusal (D8, R8) +- [x] 5.1 `async_begin_sending`, `async_begin_receiving`, the single-shot and the contexts' `async_seal` and `async_open`, `async_derive_from_seed`, member and free, in `async.hpp`; posted on native backends; the browser stand-in's refusal (D8, R8) ## 6. Cross-checks, diagnostics and lanes -- [ ] 6.1 The OpenSSL cross-check, both directions, every supported suite and mode within OpenSSL's limits, deterministic ephemeral seeds compared, `OSSL_HPKE_keygen` against `derive_from_seed` (D11) -- [ ] 6.2 The message tests of D11's list, with their `crypto.json` `fixes` entries -- [ ] 6.3 The timing coverage tests and the constant-time lane's HPKE paths; the MSVC cases (D10, B6) +- [x] 6.1 The OpenSSL cross-check, both directions, every supported suite and mode within OpenSSL's limits, deterministic ephemeral seeds compared, `OSSL_HPKE_keygen` against `derive_from_seed` (D11) +- [x] 6.2 The message tests of D11's list, with their `crypto.json` `fixes` entries +- [x] 6.3 The timing coverage tests and the constant-time lane's HPKE paths; the MSVC cases (D10, B6) ## 7. The page, the generated files and the delivery -- [ ] 7.1 The guide's HPKE section with D12's name table, MLS's and Marmot's uses and the example `example/hpke_base.cpp`; `crypto.json` and its generated files rerun; the changelog line (B9) +- [x] 7.1 The guide's HPKE section with D12's name table, MLS's and Marmot's uses and the example `example/hpke_base.cpp`; `crypto.json` and its generated files rerun; the changelog line (B9) - [ ] 7.2 Full local verification on every lane (native, Emscripten, wasip2, wasip3, MSVC, gcc, the constant-time lane, the Linux lint), pull requests, merge, one CI at the end