Repository navigation
crypto: HPKE (RFC 9180) in public_key_encryption::hpke, with crypto#24 and crypto#26 - #27
Merged
Merged
Conversation
added 10 commits
December 4, 2026 00:36
…ion, as tests on OpenSSL, on BearSSL with ctaes for the block and on the defaults, with no QUIC API; the capability table names them
… X25519 or P-256, webcpp::hash's HKDF over pieces and AES-GCM or ChaCha20-Poly1305 The change hpke of webcpporg/proposals (libraries/crypto/openspec/changes/hpke, rulings R1 to R24): RFC 9180's Hybrid Public Key Encryption with no backend of its own. - hpke::suite<KeyEncapsulation, KeyDerivation, Cipher[, Backend]> over key_encapsulation::x25519_hkdf_sha256 and p256_hkdf_sha256, key_derivation::hkdf_sha256 and hkdf_sha512, cipher::aes128_gcm, aes256_gcm, chacha20_poly1305 and export_only, each checked by its concept; Backend default_backends, one backend, or backends<KeyBackend, CipherBackend>. - The mode follows from the arguments: begin_sending and begin_receiving in base, psk, auth and auth_psk mode, the single-shot seal and open, and a catch-all per name whose one message lists the four argument lists; derive_from_seed (RFC 9180's DeriveKeyPair, X25519's secret kept unclamped); sender_context and recipient_context, move-only and wiped, sealing and opening in order on an internal 64-bit sequence number, exporting with export_secret<Length> and export_secret(purpose, output); the free forms in hpke and the asynchronous forms in async.hpp, refused on the browser's backend. - The labeled HKDF passes "HPKE-v1", the suite identifier, the label and the input as pieces to webcpp::hash's HKDF: no input is copied, capped or allocated. A pre-shared key under 32 bytes, an empty id and a seed under 32 bytes are refused. - error::message_limit_reached, the value 21. Tests: every CFRG vector of these suites (64 entries, four modes, 12,336 encryptions in order, the exports) on the defaults and with BearSSL's AEADs, on every target; the four modes, refusals, minimums, the sequence's limit through the seam, and Marmot's recovery-key vectors; OpenSSL's OSSL_HPKE_* in both directions within its limits, with the same encapsulated key and ciphertexts for the same ephemeral seed; no allocation, and long inputs (1 MiB info, 64 KiB associated data, id and purpose) against webcpp::hash's HKDF on the joined labeled inputs; the asynchronous forms; twelve message tests and their MSVC twins; the timing coverage on libsodium and BearSSL; two constant-time paths and dudect's key schedule with its A/A control. The guide's HPKE section with the table of RFC 9180's names, the example hpke_base, crypto.json's rows and the generated files, the changelog.
The owner's decision of 2026-12-04: under wasmtime the timing of dudect_bearssl's cases follows the runner's processor (GitHub's AMD EPYC 9V74 read |t| 30 to 150 on constant_time_equal and 11 to 12 on gcm_seal and ctaes_encrypt), so on a target that defines __wasi__ the program measures every case once, prints it judged=no with a line saying why, and passes; the CI's judge measures none of them again. One rule, case_results made with the reason, replaces base58_decode's wasip2 exception. Native runs, memcheck, MemorySanitizer, dudect_sodium and dudect_secp256k1 keep their verdicts. The tables show dudect on wasip2 for BearSSL, ctaes and secure::constant_time_equal as printed, not judged, with no result (crypto.json's unjudged_checkers).
# Conflicts: # doc/generated/constant-time.adoc # doc/generated/namespace-curves.adoc # doc/llms.txt # doc/tables/crypto.json
…ct_bearssl, printed and not judged on WASI like the rest of it; the tables regenerated at BearSSL's pin f8a2f3d
…FC 9180), which the doc check requires of a @see
…h the reference reads as one that does not exist; the guide writes C++ as {cpp}
…possessive inside inline code, no code span across a line of a Doc Comment, the suite-key message reworded
…nline code; llms.txt regenerated from the headers
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.
Summary
HPKE (RFC 9180) in
public_key_encryption::hpke, together with the batch that lands with it in one merge:export_secret, single-shotseal/open,derive_from_seed, the asynchronous forms (refused on the browser backend). Composed from X25519 or P-256, webcpp::hash's HKDF over pieces and AES-GCM or ChaCha20-Poly1305; no heap allocation. Tested against every CFRG vector for these suites (/third_party//hpke, webcpp#66) and against OpenSSL'sOSSL_HPKE_*in both directions.dudect_bearsslis printed, not judged, on every WASI target (the owner's decision of 2026-12-04); native lanes, memcheck, MemorySanitizer and the secp256k1/sodium programs keep their verdicts.dudect_bearssland follow the WASI rule; the generated tables regenerated at BearSSL's pin f8a2f3d.@seetitles, an undocumented unnamed parameter, ellipses and possessives inside inline code, a code span across a Doc Comment line.Verification (local, on the combined superproject tree)
dudect_bearsslrelease, native and wasip2: pass.The full CI runs once on the superproject (webcpp#65) with this merge.
🤖 Generated with Claude Code