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
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
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
1 change: 1 addition & 0 deletions CODING-GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,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
2 changes: 2 additions & 0 deletions doc/releases/0.1.0.adoc
Original file line number Diff line number Diff line change
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
26 changes: 26 additions & 0 deletions third_party/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,32 @@ alias bips : : <conditional>@bips-checked-out : :
<dependency>$(.bips-files) ;
explicit bips ;

# cfrg/draft-irtf-cfrg-hpke, shallow: test data, never compiled, an IETF
# Contribution under the IETF Trust's Legal Provisions (BCP 78; code
# components under the Simplified BSD License). A test that names hpke reads
# RFC 9180's test vectors, test-vectors.json (Appendix A's source), from the
# directory WEBCPP_TEST_HPKE names, with forward slashes, the directory given
# to wasmtime on WASI (webcpp.data), and runs again when it changes.
path-constant HPKE : libs/hpke ;
.hpke = [ regex.replace $(HPKE) "\\\\" "/" ] ;
.hpke-files = [ glob libs/hpke/test-vectors.json ] ;

rule hpke-checked-out ( properties * )
{
if ! [ path.exists [ path.native $(HPKE)/test-vectors.json ] ]
{
errors.user-error "third_party/libs/hpke is not checked out: it holds no"
"test-vectors.json. Check it out with `git submodule update --init"
"third_party/libs/hpke`." ;
}
}

alias hpke : : <conditional>@hpke-checked-out : :
<define>"\"WEBCPP_TEST_HPKE=\\\"$(.hpke)\\\"\""
[ webcpp.data $(HPKE) ]
<dependency>$(.hpke-files) ;
explicit hpke ;

# novifinancial/ed25519-speccheck (Apache-2.0), shallow: test data, never
# compiled. A test that names ed25519-speccheck reads the twelve Ed25519 edge
# cases of "Taming the many EdDSAs", cases.json, from the directory
Expand Down
1 change: 1 addition & 0 deletions third_party/libs/hpke
Submodule hpke added at 5f503c
27 changes: 27 additions & 0 deletions tools/test/third_party_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@

ED25519_SPECCHECK = 'third_party/libs/ed25519-speccheck'

HPKE = 'third_party/libs/hpke'

# The commit cfrg/draft-irtf-cfrg-hpke is pinned at: RFC 9180's test vectors, its
# test-vectors.json (libs/crypto/test/support/hpke_vectors.hpp).
HPKE_COMMIT = '5f503c564da00b0687b3de75f1dfbdfc4079ad31'

# The commit novifinancial/ed25519-speccheck is pinned at: the twelve Ed25519 edge cases of
# "Taming the many EdDSAs", its cases.json (libs/crypto/test/ed25519_speccheck_test.cpp).
ED25519_SPECCHECK_COMMIT = '65519336fda78a3d016e947df6d82848aca0c9da'
Expand Down Expand Up @@ -363,6 +369,12 @@ def test_ed25519_speccheck_is_pinned(_: Path) -> None:
assert listed.stdout.split()[:2] == ['160000', ED25519_SPECCHECK_COMMIT], listed.stdout


def test_hpke_is_pinned(_: Path) -> None:
listed = subprocess.run(['git', '-C', str(harness.ROOT), 'ls-files', '-s', HPKE],
capture_output=True, text=True, check=True)
assert listed.stdout.split()[:2] == ['160000', HPKE_COMMIT], listed.stdout


def test_bips_target_files(_: Path) -> None:
jamfile = (harness.ROOT / 'third_party' / 'Jamfile').read_text()
found = re.search(r'^\.bips-files = \[ glob ([^\]]*)\] ;', jamfile, re.MULTILINE)
Expand Down Expand Up @@ -510,6 +522,19 @@ def test_ed25519_speccheck_not_checked_out_is_refused(root: Path) -> None:
harness.expect(harness.run_b2(root, 'libs/demo/test//pass'), True)


def test_hpke_not_checked_out_is_refused(root: Path) -> None:
harness.third_party_of_its_own(root, 'hpke', checked_out=False)
harness.add_library(root, 'hpke_reader', (
'import webcpp ;\n\nwebcpp.run reads_vectors : reads_vectors.cpp\n'
' : <library>/webcpp/third_party//hpke ;\n'),
{'reads_vectors.cpp': 'int main() { return 0; }\n'})
result = harness.run_b2(root, 'libs/hpke_reader/test')
harness.expect(result, False, 'third_party/libs/hpke is not checked out',
'git submodule update --init third_party/libs/hpke')
# A build that needs no vectors never looks for them.
harness.expect(harness.run_b2(root, 'libs/demo/test//pass'), True)


def test_ctaes_not_checked_out_is_refused(root: Path) -> None:
harness.copy_integration_libraries(root, 'config', 'crypto')
harness.third_party_of_its_own(root, 'bitcoin', checked_out=False)
Expand Down Expand Up @@ -1186,8 +1211,10 @@ def test_botan_test_program_runs(root: Path) -> None:
test_a_changed_suite_file_runs_the_test_again,
test_a_suite_not_checked_out_is_refused,
test_ed25519_speccheck_not_checked_out_is_refused,
test_hpke_not_checked_out_is_refused,
test_bips_is_pinned,
test_ed25519_speccheck_is_pinned,
test_hpke_is_pinned,
test_bips_target_files,
test_bip352_vectors_match_libsecp256k1,
test_bearssl_is_pinned,
Expand Down
Loading