Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
b153f9a
third_party: Bitcoin Core's key_io vectors, test data of hash's Base5…
Nov 30, 2026
b31936b
guidelines: hash reads Bitcoin Core's key_io vectors
Nov 30, 2026
18a9ef7
tools: the crypto fixtures name the schemes in crypto::signing_schemes
Nov 30, 2026
b9c8fa0
tools: the crypto fixtures name the schemes in crypto::signing_scheme…
Nov 30, 2026
b4d063c
guidelines: crypto's current rules name the schemes in crypto::signin…
Nov 30, 2026
bec59b4
tools: the crypto fixtures verify with a policy
Nov 30, 2026
8fd5db6
guidelines: crypto's verification takes a policy after the scheme
Nov 30, 2026
22bb880
guidelines: low S is the ECDSA signatures' members is_low_s() and low…
Dec 1, 2026
95f2449
guidelines: the low S paragraphs wrapped to the file's width
Dec 1, 2026
a043ff8
tools: crypto's Jamfile fixtures copy codecs into their scratch super…
Dec 1, 2026
99f1d8f
tools: crypto's fuzz own lane installs libFuzzer's and the sanitizers…
Dec 1, 2026
0037294
tools: crypto's fuzz own lane lint fix
Dec 1, 2026
f650d72
libs/crypto: the gitlink at Ed25519's formats as codecs value codecs …
Dec 1, 2026
8f99862
libs/crypto: the gitlink at Ed25519's formats fix round 1 (48a1146)
Dec 1, 2026
ca0fa4d
libs/crypto: the gitlink at X25519's formats (fa45a2f)
Dec 1, 2026
5bc7be6
libs/crypto: the gitlink at X25519's formats lint fix (9f7551d)
Dec 1, 2026
8d954ed
libs/crypto: the gitlink at X25519's formats fix round 1 (d6943a6)
Dec 1, 2026
c2bd048
guidelines: P-256's key formats take the compressed point, decompress…
Dec 1, 2026
f9d5558
libs/crypto: the gitlink at P-256's formats (9558ee9)
Dec 1, 2026
b85c0ee
libs/crypto: the gitlink at P-256's formats lint fix (8cc2ba7)
Dec 1, 2026
fb150bc
libs/crypto: the gitlink at P-256's formats page fix (7f7be0e)
Dec 1, 2026
5c90c63
libs/crypto: the gitlink at P-256's constant-time check fix (794637e)
Dec 1, 2026
ff9ac45
libs/crypto: the gitlink at P-256's formats MSVC fix (eedc974)
Dec 1, 2026
5b6c4f2
third_party: BearSSL's library compiles crypto's P-256 decompression …
Dec 1, 2026
2eb7a61
libs/crypto: the gitlink at P-256's decompression on BearSSL (1d59350)
Dec 1, 2026
7bf5537
libs/crypto: the gitlink at P-256's decompression MSVC fix (8edf524)
Dec 1, 2026
b767872
tools: the crypto fixtures' BearSSL text names src/p256_decompress_be…
Dec 1, 2026
fa62b32
guidelines: the P-256 key formats line rewrapped to its paragraph's w…
Dec 1, 2026
65129e0
libs/crypto: the gitlink at Task 8 fix round 1 (6a9bba8)
Dec 1, 2026
fc54a0e
third_party: BearSSL's library compiles src/canary_bearssl.c alone ag…
Dec 1, 2026
9183d06
libs/crypto: the gitlink at P-256's decompression in the BearSSL head…
Dec 1, 2026
6d7f716
libs/crypto: the gitlink at the i31 prototypes compiling alone (93e98e0)
Dec 1, 2026
e09bd8f
libs/crypto: the gitlink at the i31 prototypes' MSVC fix (e31a70c)
Dec 1, 2026
563794f
guidelines: secp256k1's x-only key is a type; its tweak is xonly_publ…
Dec 1, 2026
dc3dcc1
libs/crypto: the gitlink at secp256k1's typed x-only key (19a1fb6)
Dec 1, 2026
86eba3f
libs/crypto: the gitlink at secp256k1's x-only key lint fix (402996c)
Dec 1, 2026
c79c052
libs/crypto: the gitlink at Task 9's fix round 1 (f1cc3b0)
Dec 1, 2026
a65fee2
guidelines: secp256k1's DER is formats::der; its PKCS#8 decode named …
Dec 2, 2026
1732c20
libs/crypto: the gitlink at secp256k1's formats (3b3fd30)
Dec 2, 2026
c0d1994
libs/crypto: the gitlink at secp256k1's formats lint fix (3675f3a)
Dec 2, 2026
f2cb151
libs/crypto: the gitlink at secp256k1's formats fix round 1 (c7eb353)
Dec 2, 2026
9de2051
tools: the crypto fixtures of the pem family go
Dec 2, 2026
ef42fdb
libs/crypto: the gitlink at PEM's old home removed and the asynchrono…
Dec 2, 2026
902edf9
libs/crypto: the gitlink at PEM's old home removed, fix round 1 (78cb…
Dec 2, 2026
e96b2f0
libs/crypto: the gitlink at the guide on the new names and the format…
Dec 2, 2026
da5010b
libs/crypto: the gitlink at the guide's fix round 1 (892211e)
Dec 2, 2026
6dbee4f
guidelines: crypto's formats on codecs, its policies and its x-only key
Dec 2, 2026
7f329c1
libs/hash: the gitlink at base58_with_checksum (cf30e13)
Dec 2, 2026
2d76294
guidelines: the formats block names the typed x-only key; the intro, …
Dec 2, 2026
64b3158
guidelines: codecs merged, hash merged but for its Base58Check; chapt…
Dec 2, 2026
ca84925
libs/crypto: the gitlink at the final review's fix wave (f5a27df)
Dec 2, 2026
fbc8940
libs/hash: the gitlink at the final review's fix wave (f9188f2)
Dec 2, 2026
0b8d803
guidelines: two paragraphs of chapter 17 reflowed
Dec 2, 2026
6e38dc4
libs/crypto: the gitlink at the final review's residual fix (25bd6e3)
Dec 2, 2026
5b5315d
third_party: BearSSL at 27611cc, webcpp's ECDSA nonce fix corrected f…
Dec 2, 2026
b616e4c
third_party: BearSSL at upstream 7bea48e (owner decision of 2026-12-0…
Dec 2, 2026
822ebc2
guidelines: chapter 5 rule 1, never patch third-party code; a depende…
Dec 2, 2026
32eab22
libs: the crypto and hash gitlinks at BearSSL upstream 7bea48e
Dec 2, 2026
09e4ea2
third_party: BearSSL at our fork's upstream-submission commit ae63032…
Dec 2, 2026
c83e956
guidelines: chapter 5 rule 1, a dependency's fix is submitted upstrea…
Dec 2, 2026
07e970b
libs: the crypto and hash gitlinks at BearSSL ae63032, the bits2int f…
Dec 2, 2026
c1e319d
libs/crypto: the gitlink at the merge of crypto's formats change (605…
Dec 2, 2026
09f59d1
libs/hash: the gitlink at the merge of hash's base58_with_checksum (3…
Dec 2, 2026
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
241 changes: 163 additions & 78 deletions CODING-GUIDELINES.md

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ Each line is a rule of CODING-GUIDELINES.md, named by its chapter.
customize, and on emscripten a library uses what the browser offers
(chapter 4).
- **A C library is brought in as its authors wrote it:** a pinned submodule,
never edited (an unmodified `webcpporg` mirror when upstream is not on
GitHub), built file by file by webcpp's Jamfile with function sections, named
never edited (a `webcpporg` mirror when upstream is not on GitHub; our
fork's branch carrying exactly a fix submitted upstream, until upstream
applies it), built file by file by webcpp's Jamfile with function sections, named
by the program in its own Jamfile (`/third_party//<name>`), and guarded by a
compile-time check, a link-time canary and, on MSVC, `detect_mismatch`, each
saying what to add (chapter 5, "Bringing a C library into webcpp").
Expand Down
2 changes: 1 addition & 1 deletion libs/crypto
Submodule crypto updated 910 files
31 changes: 17 additions & 14 deletions third_party/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,17 @@ rule crypto-checked-out ( properties * )
.c-library = $(.c-sections) <conditional>@crypto-checked-out
<include>$(CRYPTO)/include ;

# BearSSL (MIT), from webcpp's fork webcpporg/bearssl, branch webcpp: upstream
# 7bea48e with one commit, ECDSA's nonce decoded at its full length so that
# signing does not branch on its bit length (CODING-GUIDELINES chapter 5,
# rule 1). Every .c of src/, the POWER8 ones too, which off POWER compile to
# the stubs other files call. One source of entropy, getentropy, with RDRAND
# and /dev/urandom off (libs/crypto's random_device reads the same source):
# wasi-libc and Emscripten declare getentropy only under _DEFAULT_SOURCE, and
# macOS only in <sys/random.h>, which src/rand/sysrng.c does not include. On
# Windows BearSSL's only seeder is CryptGenRandom, not the system's
# BCryptGenRandom, so every seeder is off there and BearSSL has none.
# BearSSL (MIT) at ae63032 of webcpp's fork webcpporg/bearssl, branch
# upstream/ecdsa-bits2int-constant-time: upstream's 7bea48e and exactly the
# ECDSA nonce fix submitted upstream, until upstream applies it
# (CODING-GUIDELINES chapter 5, rule 1). Every .c of src/, the POWER8 ones too,
# which off POWER compile to the stubs other files call. One source of entropy,
# getentropy, with RDRAND and /dev/urandom off (libs/crypto's random_device
# reads the same source): wasi-libc and Emscripten declare getentropy only
# under _DEFAULT_SOURCE, and macOS only in <sys/random.h>, which
# src/rand/sysrng.c does not include. On Windows BearSSL's only seeder is
# CryptGenRandom, not the system's BCryptGenRandom, so every seeder is off
# there and BearSSL has none.
path-constant BEARSSL : libs/bearssl ;

rule bearssl-checked-out ( properties * )
Expand Down Expand Up @@ -361,15 +362,17 @@ lib ctaes : libs/bitcoin/src/crypto/ctaes/ctaes.c $(CRYPTO)/src/canary_ctaes.c
explicit ctaes ;

# Bitcoin Core's base58 vectors (MIT), src/test/data/base58_encode_decode.json
# of the same submodule at the tag, read at run time by codecs' tests from the
# directory WEBCPP_TEST_BITCOIN_BASE58_VECTORS gives, on every target, as test
# data that nothing compiles. Quoted as blake3_vectors' define is, with
# and key_io_valid.json of the same submodule at the tag, read at run time by
# codecs' tests (the first) and by hash's Base58Check test (the second) from
# the directory WEBCPP_TEST_BITCOIN_BASE58_VECTORS gives, on every target, as
# test data that nothing compiles. Quoted as blake3_vectors' define is, with
# forward slashes, so that a path with a space or a backslash survives.
.bitcoin-base58-vectors = [ regex.replace $(BITCOIN)/src/test/data "\\\\" "/" ] ;
alias bitcoin_base58_vectors : : <conditional>@bitcoin-checked-out : :
<define>"\"WEBCPP_TEST_BITCOIN_BASE58_VECTORS=\\\"$(.bitcoin-base58-vectors)\\\"\""
[ webcpp.data $(BITCOIN)/src/test/data ]
<dependency>libs/bitcoin/src/test/data/base58_encode_decode.json ;
<dependency>libs/bitcoin/src/test/data/base58_encode_decode.json
<dependency>libs/bitcoin/src/test/data/key_io_valid.json ;
explicit bitcoin_base58_vectors ;

# The precomputed tables of libsecp256k1 (spec section 3.5): auto (the
Expand Down
2 changes: 1 addition & 1 deletion third_party/libs/bearssl
13 changes: 7 additions & 6 deletions tools/ci/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,17 @@
# native programs under Valgrind's memcheck (valgrind, with valgrind/memcheck.h) and under
# MemorySanitizer, whose runtime and sanitizer/ headers are libclang-rt-18-dev's, and their
# drivers read MemorySanitizer's frames with llvm-symbolizer-18, which llvm-18 installs; on
# wasip2 crypto's runs dudect alone, which needs none. codecs' fuzz lane links libFuzzer,
# AddressSanitizer and UndefinedBehaviorSanitizer, whose runtimes and sanitizer/ headers (the
# malloc hooks its targets count the heap with) are libclang-rt-18-dev's, and its sanitizers
# symbolise their reports with llvm-symbolizer-18. The lint, which analyses those programs
# natively, installs every package of the table (lint-packages).
# wasip2 crypto's runs dudect alone, which needs none. codecs' and crypto's fuzz lanes link
# libFuzzer, AddressSanitizer and UndefinedBehaviorSanitizer, whose runtimes and sanitizer/ headers
# (the malloc hooks their targets count the heap with) are libclang-rt-18-dev's, and their
# sanitizers symbolise their reports with llvm-symbolizer-18. The lint, which analyses those
# programs natively, installs every package of the table (lint-packages).
OWN_LANE_PACKAGES: dict[tuple[str, str, str], tuple[str, ...]] = {
('crypto', 'constant-time', 'native'): ('valgrind', 'llvm-18', 'libclang-rt-18-dev'),
('secure', 'constant-time', 'native'): ('valgrind', 'llvm-18', 'libclang-rt-18-dev'),
('codecs', 'constant-time', 'native'): ('valgrind', 'llvm-18', 'libclang-rt-18-dev'),
('codecs', 'fuzz', 'native'): ('llvm-18', 'libclang-rt-18-dev')}
('codecs', 'fuzz', 'native'): ('llvm-18', 'libclang-rt-18-dev'),
('crypto', 'fuzz', 'native'): ('llvm-18', 'libclang-rt-18-dev')}

# MSVC's lanes build 64-bit programs, embed their manifest with the linker and abbreviate b2's
# paths against Windows's MAX_PATH, as xstate-cpp's green Windows jobs did. b2 abbreviates each
Expand Down
24 changes: 15 additions & 9 deletions tools/ci/matrix_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1338,24 +1338,28 @@ def test_an_own_lane_installs_its_packages(root):
# its entry, by library, lane and target: crypto's, secure's and codecs' constant-time lanes
# natively have Valgrind, llvm-18 (llvm-symbolizer-18, which reads MemorySanitizer's frames) and
# libclang-rt-18-dev (clang-18's MemorySanitizer runtime and its sanitizer/ headers);
# crypto's on wasip2, where it runs dudect alone, none; codecs' fuzz lane natively llvm-18 and
# libclang-rt-18-dev (libFuzzer's and the sanitizers' runtimes, and the sanitizer/ header of
# the malloc hooks), and no Valgrind; every other own lane none. The own-lanes job installs
# them with apt on Linux, only where the list is not empty, before the lane runs.
# crypto's on wasip2, where it runs dudect alone, none; codecs' and crypto's fuzz lanes
# natively llvm-18 and libclang-rt-18-dev (libFuzzer's and the sanitizers' runtimes, and the
# sanitizer/ header of the malloc hooks), and no Valgrind; every other own lane none. The
# own-lanes job installs them with apt on Linux, only where the list is not empty, before the
# lane runs.
packages = ('valgrind', 'llvm-18', 'libclang-rt-18-dev')
fuzz_packages = ('llvm-18', 'libclang-rt-18-dev')
assert matrix.OWN_LANE_PACKAGES == {('crypto', 'constant-time', 'native'): packages,
('secure', 'constant-time', 'native'): packages,
('codecs', 'constant-time', 'native'): packages,
('codecs', 'fuzz', 'native'): fuzz_packages}
('codecs', 'fuzz', 'native'): fuzz_packages,
('crypto', 'fuzz', 'native'): fuzz_packages}
boost_only(root)
oracle_library(root, 'beta')
harness.add_library(root, 'crypto',
'import webcpp ;\n'
'webcpp.targets native wasip2 ;\n'
'webcpp.run plain : plain.cpp ;\n'
'webcpp.lane constant-time : plain : native wasip2 ;\n',
{'plain.cpp': 'int main() {}\n'})
'webcpp.run fuzzed : fuzzed.cpp ;\n'
'webcpp.lane constant-time : plain : native wasip2 ;\n'
'webcpp.lane fuzz : fuzzed : native ;\n',
{'plain.cpp': 'int main() {}\n', 'fuzzed.cpp': 'int main() {}\n'})
harness.add_library(root, 'secure',
'import webcpp ;\n'
'webcpp.targets native ;\n'
Expand All @@ -1372,7 +1376,8 @@ def test_an_own_lane_installs_its_packages(root):
{'plain.cpp': 'int main() {}\n', 'fuzzed.cpp': 'int main() {}\n'})
assert {entry.get('id', entry['lane']): entry['apt'] for entry in own_lanes(root)} == {
'oracle': [], 'native.crypto.constant-time': list(packages),
'wasip2.crypto.constant-time': [], 'native.secure.constant-time': list(packages),
'wasip2.crypto.constant-time': [], 'native.crypto.fuzz': list(fuzz_packages),
'native.secure.constant-time': list(packages),
'native.codecs.constant-time': list(packages),
'native.codecs.fuzz': list(fuzz_packages)}, own_lanes(root)
steps = job_steps(workflow_jobs()['own-lanes'])
Expand All @@ -1389,7 +1394,8 @@ def test_the_lint_installs_the_own_lanes_packages(root):
# The lint analyses every own lane's programs, natively with clang-18 on Linux, so it needs
# their headers: lint-packages prints every package of OWN_LANE_PACKAGES once, sorted, the
# one source (crypto's, secure's and codecs' constant-time lanes list the same three, and
# codecs' fuzz lane two of them), and the lint job installs them before the lint runs.
# codecs' and crypto's fuzz lanes two of them), and the lint job installs them before the lint
# runs.
result = run(root, 'lint-packages')
assert result.returncode == 0, (result.returncode, result.stderr)
assert result.stdout == 'libclang-rt-18-dev llvm-18 valgrind\n', result.stdout
Expand Down
4 changes: 2 additions & 2 deletions tools/test/crypto_jamfiles_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@


def main(argv: list[str]) -> int:
return user_jamfiles.main('crypto_jamfiles', CASES, ('config', 'secure', 'crypto', 'hash'),
NOT_YET, argv)
return user_jamfiles.main('crypto_jamfiles', CASES,
('config', 'secure', 'codecs', 'crypto', 'hash'), NOT_YET, argv)


if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ build: fails
# tag::messages[]
[native-darwin]
contains: Undefined symbols for architecture
contains: _webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
contains: _webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
[native-linux]
contains: webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
contains: undefined reference to `webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link'
contains: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
contains: undefined reference to `webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link'
[wasip2]
contains: wasm-ld: error:
contains: undefined symbol: webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
contains: undefined symbol: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
[wasip3]
contains: wasm-ld: error:
contains: undefined symbol: webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
contains: undefined symbol: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
[emscripten]
contains: wasm-ld: error:
contains: undefined symbol: webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
contains: undefined symbol: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
contains: em++: error:
# end::messages[]
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ build: fails
# tag::messages[]
[native-darwin]
contains: Undefined symbols for architecture
contains: _webcpp_crypto_bearssl_32381d6_sysrng__add_third_party_bearssl_to_your_link
contains: _webcpp_crypto_bearssl_ae63032_sysrng__add_third_party_bearssl_to_your_link
[native-linux]
contains: webcpp_crypto_bearssl_32381d6_sysrng__add_third_party_bearssl_to_your_link
contains: undefined reference to `webcpp_crypto_bearssl_32381d6_sysrng__add_third_party_bearssl_to_your_link'
contains: webcpp_crypto_bearssl_ae63032_sysrng__add_third_party_bearssl_to_your_link
contains: undefined reference to `webcpp_crypto_bearssl_ae63032_sysrng__add_third_party_bearssl_to_your_link'
[wasip2]
contains: wasm-ld: error:
contains: undefined symbol: webcpp_crypto_bearssl_32381d6_sysrng__add_third_party_bearssl_to_your_link
contains: undefined symbol: webcpp_crypto_bearssl_ae63032_sysrng__add_third_party_bearssl_to_your_link
[wasip3]
contains: wasm-ld: error:
contains: undefined symbol: webcpp_crypto_bearssl_32381d6_sysrng__add_third_party_bearssl_to_your_link
contains: undefined symbol: webcpp_crypto_bearssl_ae63032_sysrng__add_third_party_bearssl_to_your_link
[emscripten]
contains: wasm-ld: error:
contains: undefined symbol: webcpp_crypto_bearssl_32381d6_sysrng__add_third_party_bearssl_to_your_link
contains: undefined symbol: webcpp_crypto_bearssl_ae63032_sysrng__add_third_party_bearssl_to_your_link
contains: em++: error:
# end::messages[]
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ int main() {
std::array<std::uint8_t, 32> const message{};
std::array<std::uint8_t, 32> const aux{};
auto key = webcpp::crypto::curves::secp256k1::keypair::from_secret(secret);
return key && key->sign(webcpp::crypto::schnorr, message, aux) ? 0 : 1;
return key && key->sign(webcpp::crypto::signing_schemes::schnorr, message, aux) ? 0 : 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ int main() {
std::array<std::uint8_t, 32> const message{};
std::array<std::uint8_t, 32> const aux{};
auto key = webcpp::crypto::curves::secp256k1::keypair::from_secret(secret);
return key && key->sign(webcpp::crypto::schnorr, message, aux) ? 0 : 1;
return key && key->sign(webcpp::crypto::signing_schemes::schnorr, message, aux) ? 0 : 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ build: fails
# tag::messages[]
[native-darwin]
contains: Undefined symbols for architecture
contains: _webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
contains: _webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
[native-linux]
contains: webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
contains: undefined reference to `webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link'
contains: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
contains: undefined reference to `webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link'
[wasip2]
contains: wasm-ld: error:
contains: undefined symbol: webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
contains: undefined symbol: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
[wasip3]
contains: wasm-ld: error:
contains: undefined symbol: webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
contains: undefined symbol: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
[emscripten]
contains: wasm-ld: error:
contains: undefined symbol: webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
contains: undefined symbol: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
contains: em++: error:
# end::messages[]

# The canary is the only link error (spec section 4.3): no line names an undefined symbol or
# reference that is not it. Each linker's own words for one.
[native-darwin]
not-contains: ", referenced from: unless webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
not-contains: ", referenced from: unless webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
[native-linux]
not-contains: undefined reference unless webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
not-contains: undefined reference unless webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
[wasip2]
not-contains: undefined symbol unless webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
not-contains: undefined symbol unless webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
[wasip3]
not-contains: undefined symbol unless webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
not-contains: undefined symbol unless webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
[emscripten]
not-contains: undefined symbol unless webcpp_crypto_bearssl_32381d6_getentropy__add_third_party_bearssl_to_your_link
not-contains: undefined symbol unless webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link
9 changes: 6 additions & 3 deletions tools/test/fixtures/crypto_jamfiles/ed25519_default/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ int main() {
auto const key = ed25519::keypair::from_secret(seed);
bool ok = false;
if (key) {
auto const signature = key->sign(crypto::eddsa, message);
auto const signature = key->sign(crypto::signing_schemes::eddsa, message);
auto const public_key = key->public_key();
ok = signature && public_key && secure::constant_time_equal(signature->bytes(), expected) &&
crypto::verify(crypto::eddsa, *signature, message, *public_key).has_value();
ok =
signature && public_key && secure::constant_time_equal(signature->bytes(), expected) &&
crypto::verify(crypto::signing_schemes::eddsa, crypto::verification_policies::canonical,
*signature, message, *public_key)
.has_value();
}
auto const name = ed25519::keypair::backend_type::name;
std::printf("ed25519 %s backend=%.*s\n", ok ? "ok" : "FAILED", static_cast<int>(name.size()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
// accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)

// A program that names a policy of its own in Ed25519's crypto::verify, on its default backend
// linked, stops where it calls it, with the one policy there is.
// A program that names a policy of its own in Ed25519's crypto::verify, in the policy's place after
// the scheme, on its default backend linked, stops where it calls it, with the one policy Ed25519
// takes.
#include <webcpp/crypto/curves/ed25519.hpp>
#include <webcpp/crypto/signing.hpp>

Expand All @@ -25,8 +26,8 @@ int main() {
webcpp::crypto::curves::ed25519::public_key::from_bytes(std::array<std::uint8_t, 32>{});
webcpp::crypto::curves::ed25519::signature const signature{};
return public_key &&
webcpp::crypto::verify(webcpp::crypto::eddsa, signature,
std::span<std::uint8_t const>{}, *public_key, lenient{})
webcpp::crypto::verify(webcpp::crypto::signing_schemes::eddsa, lenient{},
signature, std::span<std::uint8_t const>{}, *public_key)
? 0
: 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
targets: emscripten
build: fails
# tag::messages[]
contains: webcpp::crypto: Ed25519's only verification policy is curves::ed25519::strict.
contains: webcpp::crypto: verify: crypto::signing_schemes::eddsa and eddsa_prehashed take crypto::verification_policies::canonical.
# end::messages[]
Loading
Loading