Skip to content

crypto: dudect_bearssl is printed, not judged, on WASI - #26

Merged
pinhopro merged 2 commits into
mainfrom
wasi-bearssl-ct-unjudged
Dec 4, 2026
Merged

pinhopro merged 2 commits into
mainfrom
wasi-bearssl-ct-unjudged

Conversation

@pinhopro

@pinhopro pinhopro commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

The owner's decision of 2026-12-04: constant-time timing measurements of BearSSL on WASI targets never again fail CI. On GitHub's hosted AMD EPYC 9V74 runners, wasip2 under wasmtime read |t| 30 to 150 on constant_time_equal and 11 to 12 on gcm_seal and ctaes_encrypt, turning unrelated PRs and main red.

The rule (one place): dudect_test.cpp defines unjudged_here, a reason string under __wasi__ (wasip2, wasip3, any future WASI target), nullptr elsewhere, and makes its test::case_results with it. case_results (dudect.hpp) gains an optional reason: when given, every recorded case is printed judged=no whatever its own flag, judges() returns false so each case is measured once (measure_case), print() adds every case printed, not judged: <why>, and the program exits 0. The CI's judge already measures only judged=yes cases again, so it warns and reruns nothing. base58_decode's per-case wasip2 exception is subsumed by the rule.

Unchanged: native runs of dudect_bearssl, ctgrind/memcheck, MSan, dudect_sodium and dudect_secp256k1 (their wasip2 exceptions stay).

Tests: dudect_harness gains unjudged_program (judges(), judged=no line, passes over the threshold). generate_test gains two cases for the new unjudged_checkers.

Docs: crypto.json adds the checker dudect_printed ("dudect (printed, not judged: under wasmtime its timing follows the runner's processor)") listed in unjudged_checkers, used for wasip2 of BearSSL's GCM, ChaCha20-Poly1305 and P-256, ctaes and secure::constant_time_equal; generate.py writes such a checker with no "nothing found". Generated pages regenerated. backends.adoc and testing.adoc state the rule. Spec: webcpporg/proposals#40.

Verified locally: wasip2 constant-time lane (all 11 dudect_bearssl cases judged=no, program and judge pass), native constant-time lane in the arm64 Linux container (14 passed, judge exit 0, all cases judged=yes), b2 libs/crypto/doc with rendered-check, generate.py --check and generate_test.py, macOS clang-tidy clean, Linux lint CLEAN.

🤖 Generated with Claude Code

R added 2 commits December 4, 2026 06:36
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
@pinhopro
pinhopro merged commit 7253893 into main Dec 4, 2026
1 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant