diff --git a/AGENTS.md b/AGENTS.md index c83afd3..0211533 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -71,9 +71,11 @@ specific to crypto. - Every C library is upstream code (CODING-GUIDELINES.md chapter 5 rule 1): never modify third-party code; a defect found in a dependency is reported to the owner, who submits the fix upstream, and until upstream applies it the pin may point at our fork's branch carrying exactly - that patch. BearSSL is ae63032 of webcpporg/bearssl's branch - upstream/ecdsa-bits2int-constant-time: upstream 7bea48e and the ECDSA nonce fix submitted - upstream (bits2int, a Minerva-class leak); the pin returns to upstream once the patch is - applied. A moved pin is a change of its own (rule 12). + that patch. BearSSL is f8a2f3d of webcpporg/bearssl's branch webcpp-pin: upstream 7bea48e + and two fixes, each submitted upstream on a branch of its own: the ECDSA nonce fix (ae63032, + upstream/ecdsa-bits2int-constant-time; bits2int, a Minerva-class leak) and P-256's scalar + check (ec57f88, upstream/ec-p256-check-scalar-constant-time; clang made a jump on the secret + scalar on x86-64), carried by the owner's explicit exception to the rule; the pin returns to + upstream once upstream applies them. A moved pin is a change of its own (rule 12). - X25519's constant time on wasip2 is an open finding (the page's constant-time table): do not describe it as a pass. diff --git a/doc/backends.adoc b/doc/backends.adoc index 576f427..7399575 100644 --- a/doc/backends.adoc +++ b/doc/backends.adoc @@ -62,14 +62,19 @@ is BearSSL's `br_ecdsa_i31_sign_raw` and `br_ecdsa_i31_vrfy_raw` on every target, over the curve code chosen. [#crypto-backends-bearssl-fix] -webcpp's BearSSL is `ae63032` of its fork's branch -`upstream/ecdsa-bits2int-constant-time` +webcpp's BearSSL is `f8a2f3d` of its fork's branch `webcpp-pin` +(link:https://github.com/webcpporg/bearssl/commit/f8a2f3d96fc6e3ce8c7b626fec4fc506fef2b0ce[webcpporg/bearssl +f8a2f3d]): upstream's commit `7bea48e` and exactly two patches, the fixes below, +each on a branch of its own on top of `7bea48e`, which the owner submits +upstream: `ae63032` on `upstream/ecdsa-bits2int-constant-time` (link:https://github.com/webcpporg/bearssl/commit/ae63032d9f30bf53674db5445875adf71b8626b7[webcpporg/bearssl -ae63032]): upstream's commit `7bea48e` and exactly one patch, the fix below, -which the owner submits upstream. webcpp never modifies third-party code: a -defect found in a dependency is reported to the owner, who submits the fix -upstream, and the pin returns to upstream once upstream applies it -(CODING-GUIDELINES.md chapter 5, rule 1). Upstream's ECDSA signing reads RFC 6979's nonce through +ae63032]) and `ec57f88` on `upstream/ec-p256-check-scalar-constant-time` +(link:https://github.com/webcpporg/bearssl/commit/ec57f886ee0a0783acfca1b465b43ccd62b71046[webcpporg/bearssl +ec57f88]). webcpp never modifies third-party code: a defect found in a +dependency is reported to the owner, who submits the fix upstream, and the pin +returns to upstream once upstream applies it (CODING-GUIDELINES.md chapter 5, +rule 1); both patches are carried by the owner's explicit exception to that +rule. Upstream's ECDSA signing reads RFC 6979's nonce through `br_ecdsa_i31_bits2int` (link:https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ecdsa_i31_bits.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l44[ecdsa_i31_bits.c, lines 44 and 45]): `br_i31_decode` writes the nonce's actual bit length into @@ -90,6 +95,27 @@ MemorySanitizer; dudect, which would see one measurement in about 256 differ by a few instructions, did not. At the pin both checkers find nothing in P-256's `sign` (<>). +The second patch is in P-256's check of the scalar, `check_scalar` in +the `mul` of `br_ec_p256_m62`, which ECDH (`agree`) calls on the secret scalar +(link:https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ec_p256_m62.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l1623[ec_p256_m62.c, +lines 1623 to 1627]). Its C compares the scalar with the order byte by byte +through masks, without a branch, but the compiler reads the mask as a select, +and Clang on x86-64 turns that select into a conditional jump on the running +comparison: Clang 18 in its pass that converts a `cmov` in a loop into a +jump, Clang 22 and Apple Clang 21 earlier, in CodeGenPrepare. The jump tells +how many leading bytes of the scalar equal the order's, a prefix about one +scalar in 256 has; under callgrind the instructions `mul` executes differ with +that prefix. GCC, and Clang on arm64, keep the select. The patch computes +0 < k < n as k - 1 < n - 1, two borrow chains in one loop with no test of an +intermediate value, which every compiler tried keeps without a jump: Clang 18 +and 22 and GCC 13 on x86-64, Clang 18 and GCC 13 on arm64, from `-O0` to `-O3` +and `-Os`, and Apple Clang 21. It changes `check_scalar` in `ec_p256_m62.c` +and its copy in `ec_p256_m64.c` alone, and gives the same verdict as before on +11 million scalars. The constant-time lane found the jump on 2026-12-03 under +memcheck on the x86-64 runner (MemorySanitizer, which checks the select before +the code generator, cannot see it, and the lane's arm64 runs had none); at +the pin memcheck finds nothing in `agree`. + A program has one copy of each library: libsecp256k1's tables and OpenSSL's state are global symbols, so webcpp's build is never linked with another copy. @@ -188,7 +214,11 @@ Apple M5 Max, while webcpp's BearSSL carried a fix of its own on its mirror's `webcpp` branch, replaced on 2026-12-02 by the same fix submitted upstream (<>). Every path above passed under both, P-256's signing with its low-S step included, and again on 2026-12-02 at the pin -`ae63032`. The run of 2026-11-21 on upstream's BearSSL, without the fix, +`ae63032`. On 2026-12-03 memcheck's two programs, `ctgrind` and +`ctgrind_space`, ran on x86-64 too (Ubuntu 24.04's image `linux-lint:amd64`, +under emulation, clang 18): at `ae63032` they reported the jump of P-256's +scalar check above, as the CI's x86-64 runner did, and at the pin `f8a2f3d` +they passed. The run of 2026-11-21 on upstream's BearSSL, without the fix, reported the nonce's leak under both. Each planted program failed where it must, and the lane's dudect programs passed there too, with `dudect_planted` at 34.89 on the 2026-11-21 run. diff --git a/doc/generated/backend-facts.adoc b/doc/generated/backend-facts.adoc index 4a49878..34ee42b 100644 --- a/doc/generated/backend-facts.adoc +++ b/doc/generated/backend-facts.adoc @@ -54,7 +54,7 @@ The library behind each, and what it costs a program: |Backend |Library |Licence |Its own API, reachable |Allocation |BearSSL -|BearSSL at webcpporg/bearssl commit ae63032d, upstream commit 7bea48e5 plus exactly the ECDSA nonce fix submitted upstream, until upstream applies it, built from source +|BearSSL at webcpporg/bearssl commit f8a2f3d9, upstream commit 7bea48e5 plus exactly the two fixes submitted upstream (the ECDSA nonce's and P-256's scalar check's), until upstream applies them, built from source |MIT |`++`, all of it |none: the key schedule and GCM's state live inside the object diff --git a/doc/generated/constant-time.adoc b/doc/generated/constant-time.adoc index 0fd9a27..e181586 100644 --- a/doc/generated/constant-time.adoc +++ b/doc/generated/constant-time.adoc @@ -12,8 +12,8 @@ |Backend |By design |Measured, native |Measured, wasip2 |Measured, wasip3 |Measured, emscripten |BearSSL -|by design: `+aes_ct64+` and `+ghash_ctmul64+`, or AES-NI and PCLMUL where the CPU has them; on a 32-bit host a 64-bit multiplication may not be constant time, which BearSSL documents; ECDSA signing at webcpp's pin, whose patch submitted upstream closes upstream's leak of the RFC 6979 nonce's bit length (link:https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ecdsa_i31_bits.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l44[BearSSL's ecdsa_i31_bits.c at upstream 7bea48e, lines 44 and 45: the nonce decoded with its actual bit length in the integer's header, then shifted over the words that length needs]; link:https://minerva.crocs.fi.muni.cz/[Minerva: the leak of an ECDSA nonce's bit length through timing, and the lattice that recovers the key (CVE-2019-15809)]; the patch: link:https://github.com/webcpporg/bearssl/commit/ae63032d9f30bf53674db5445875adf71b8626b7[webcpporg/bearssl, commit ae63032 on its branch upstream/ecdsa-bits2int-constant-time, webcpp's pin: upstream 7bea48e plus exactly the patch submitted upstream, br_ecdsa_i31_bits2int and br_ecdsa_i15_bits2int setting the integer's header, before the right shift, to the larger of the decoded bit length and the order's, both public; the pin returns to upstream once upstream applies it]); link:https://www.bearssl.org/constanttime.html[BearSSL, constant-time crypto]; link:https://www.bearssl.org/ctmul.html[BearSSL, constant-time multiplications] -|Valgrind's memcheck (Linux): AES-GCM, ChaCha20-Poly1305, P-256 (the key pair's making, `+sign+` of a digest (`+crypto::signing_schemes::prehashed+`), which makes its signature low S without a branch, then `+low_s()+` and `+is_low_s()+` of it, `+agree+` and the private formats, `+pkcs8+`, `+raw+` and `+pem(pkcs8)+` both ways; BearSSL's own branches on its signing's verdicts listed in `+bearssl_verdicts.supp+`; nothing found at webcpp's pin ae63032, whose patch submitted upstream closes upstream's leak of the nonce's bit length in `+sign+` that this checker found on 2026-11-21, `+sign+` with its low-S step included (Valgrind 3.22, arm64 Linux container, 2026-12-02)); MemorySanitizer (Linux, clang): AES-GCM, ChaCha20-Poly1305, P-256 (the same paths as memcheck's; the same leak in `+sign+` on 2026-11-21 on upstream's BearSSL, nothing at webcpp's pin ae63032, `+sign+` with its low-S step included (clang 18, arm64 Linux container, 2026-12-02)); dudect (judged; on a runner GitHub hosts, by two of three runs): AES-GCM, ChaCha20-Poly1305, P-256 (`+sign+` of a digest and `+agree+`, each against the key pair's scalar; `+sign+` with its low-S step judged constant time, \|t\| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)) +|by design: `+aes_ct64+` and `+ghash_ctmul64+`, or AES-NI and PCLMUL where the CPU has them; on a 32-bit host a 64-bit multiplication may not be constant time, which BearSSL documents; ECDSA signing at webcpp's pin, whose patch submitted upstream closes upstream's leak of the RFC 6979 nonce's bit length (link:https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ecdsa_i31_bits.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l44[BearSSL's ecdsa_i31_bits.c at upstream 7bea48e, lines 44 and 45: the nonce decoded with its actual bit length in the integer's header, then shifted over the words that length needs]; link:https://minerva.crocs.fi.muni.cz/[Minerva: the leak of an ECDSA nonce's bit length through timing, and the lattice that recovers the key (CVE-2019-15809)]; the patch: link:https://github.com/webcpporg/bearssl/commit/ae63032d9f30bf53674db5445875adf71b8626b7[webcpporg/bearssl, commit ae63032 on its branch upstream/ecdsa-bits2int-constant-time, one of the two patches of webcpp's pin f8a2f3d (upstream 7bea48e plus exactly the patches submitted upstream): br_ecdsa_i31_bits2int and br_ecdsa_i15_bits2int setting the integer's header, before the right shift, to the larger of the decoded bit length and the order's, both public; the pin returns to upstream once upstream applies it]); P-256's `+mul+`, which ECDH calls, at webcpp's pin, whose other patch submitted upstream removes the jump on the secret scalar that Clang makes on x86-64 of upstream's scalar check (link:https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ec_p256_m62.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l1623[BearSSL's ec_p256_m62.c at upstream 7bea48e, lines 1623 to 1627: the scalar compared with the order through masks that Clang on x86-64 compiles into a conditional jump on the comparison so far]; the patch: link:https://github.com/webcpporg/bearssl/commit/ec57f886ee0a0783acfca1b465b43ccd62b71046[webcpporg/bearssl, commit ec57f88 on its branch upstream/ec-p256-check-scalar-constant-time, the other patch of webcpp's pin f8a2f3d: check_scalar in ec_p256_m62.c and ec_p256_m64.c computing 0 < k < n as k - 1 < n - 1 with two borrow chains, no select for a compiler to turn into a jump; the pin returns to upstream once upstream applies it]); link:https://www.bearssl.org/constanttime.html[BearSSL, constant-time crypto]; link:https://www.bearssl.org/ctmul.html[BearSSL, constant-time multiplications] +|Valgrind's memcheck (Linux): AES-GCM, ChaCha20-Poly1305, P-256 (the key pair's making, `+sign+` of a digest (`+crypto::signing_schemes::prehashed+`), which makes its signature low S without a branch, then `+low_s()+` and `+is_low_s()+` of it, `+agree+` and the private formats, `+pkcs8+`, `+raw+` and `+pem(pkcs8)+` both ways; BearSSL's own branches on its signing's verdicts listed in `+bearssl_verdicts.supp+`; nothing found at webcpp's pin f8a2f3d, whose patches submitted upstream close upstream's leak of the nonce's bit length in `+sign+` that this checker found on 2026-11-21 and the jump on the scalar in P-256's scalar check that it found under `+agree+` on the x86-64 runner on 2026-12-03, `+sign+` with its low-S step included (Valgrind 3.22, arm64 Linux container, 2026-12-02; x86-64, `+ctgrind+` and `+ctgrind_space+`, 2026-12-04)); MemorySanitizer (Linux, clang): AES-GCM, ChaCha20-Poly1305, P-256 (the same paths as memcheck's; the same leak in `+sign+` on 2026-11-21 on upstream's BearSSL, nothing at webcpp's pin ae63032, `+sign+` with its low-S step included (clang 18, arm64 Linux container, 2026-12-02); MemorySanitizer checks the select of P-256's scalar check before the code generator makes it a jump, so the second patch changes nothing it sees); dudect (judged; on a runner GitHub hosts, by two of three runs): AES-GCM, ChaCha20-Poly1305, P-256 (`+sign+` of a digest and `+agree+`, each against the key pair's scalar; `+sign+` with its low-S step judged constant time, \|t\| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)) |dudect (judged; on a runner GitHub hosts, by two of three runs): AES-GCM, ChaCha20-Poly1305, P-256 (`+sign+` of a digest and `+agree+`, each against the key pair's scalar; `+sign+` with its low-S step judged constant time, \|t\| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)) |not measured yet |not measured yet diff --git a/doc/generated/messages.adoc b/doc/generated/messages.adoc index 8f7353d..28d97be 100644 --- a/doc/generated/messages.adoc +++ b/doc/generated/messages.adoc @@ -1307,19 +1307,19 @@ On each target, the build's output contains: + * native, macOS: ** `+Undefined symbols for architecture+` -** `+_webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link+` +** `+_webcpp_crypto_bearssl_f8a2f3d_getentropy__add_third_party_bearssl_to_your_link+` * native, Linux: -** `+webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link+` -** `pass:[undefined reference to `webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link']` +** `+webcpp_crypto_bearssl_f8a2f3d_getentropy__add_third_party_bearssl_to_your_link+` +** `pass:[undefined reference to `webcpp_crypto_bearssl_f8a2f3d_getentropy__add_third_party_bearssl_to_your_link']` * wasip2: ** `+wasm-ld: error:+` -** `+undefined symbol: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link+` +** `+undefined symbol: webcpp_crypto_bearssl_f8a2f3d_getentropy__add_third_party_bearssl_to_your_link+` * wasip3: ** `+wasm-ld: error:+` -** `+undefined symbol: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link+` +** `+undefined symbol: webcpp_crypto_bearssl_f8a2f3d_getentropy__add_third_party_bearssl_to_your_link+` * emscripten: ** `+wasm-ld: error:+` -** `+undefined symbol: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link+` +** `+undefined symbol: webcpp_crypto_bearssl_f8a2f3d_getentropy__add_third_party_bearssl_to_your_link+` ** `pass:[em++: error:]` `+canary_other_commit+`:: A BearSSL of another commit than the headers'. The fix: Build the library at the commit of webcpp's submodule, or link it through b2. @@ -1363,19 +1363,19 @@ On each target, the build's output contains: + * native, macOS: ** `+Undefined symbols for architecture+` -** `+_webcpp_crypto_bearssl_ae63032_sysrng__add_third_party_bearssl_to_your_link+` +** `+_webcpp_crypto_bearssl_f8a2f3d_sysrng__add_third_party_bearssl_to_your_link+` * native, Linux: -** `+webcpp_crypto_bearssl_ae63032_sysrng__add_third_party_bearssl_to_your_link+` -** `pass:[undefined reference to `webcpp_crypto_bearssl_ae63032_sysrng__add_third_party_bearssl_to_your_link']` +** `+webcpp_crypto_bearssl_f8a2f3d_sysrng__add_third_party_bearssl_to_your_link+` +** `pass:[undefined reference to `webcpp_crypto_bearssl_f8a2f3d_sysrng__add_third_party_bearssl_to_your_link']` * wasip2: ** `+wasm-ld: error:+` -** `+undefined symbol: webcpp_crypto_bearssl_ae63032_sysrng__add_third_party_bearssl_to_your_link+` +** `+undefined symbol: webcpp_crypto_bearssl_f8a2f3d_sysrng__add_third_party_bearssl_to_your_link+` * wasip3: ** `+wasm-ld: error:+` -** `+undefined symbol: webcpp_crypto_bearssl_ae63032_sysrng__add_third_party_bearssl_to_your_link+` +** `+undefined symbol: webcpp_crypto_bearssl_f8a2f3d_sysrng__add_third_party_bearssl_to_your_link+` * emscripten: ** `+wasm-ld: error:+` -** `+undefined symbol: webcpp_crypto_bearssl_ae63032_sysrng__add_third_party_bearssl_to_your_link+` +** `+undefined symbol: webcpp_crypto_bearssl_f8a2f3d_sysrng__add_third_party_bearssl_to_your_link+` ** `pass:[em++: error:]` `+canary_secp256k1_missing+`:: libsecp256k1's headers used without its library. The fix: Link `+/third_party//secp256k1+`. @@ -1475,19 +1475,19 @@ On each target, the build's output contains: + * native, macOS: ** `+Undefined symbols for architecture+` -** `+_webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link+` +** `+_webcpp_crypto_bearssl_f8a2f3d_getentropy__add_third_party_bearssl_to_your_link+` * native, Linux: -** `+webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link+` -** `pass:[undefined reference to `webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link']` +** `+webcpp_crypto_bearssl_f8a2f3d_getentropy__add_third_party_bearssl_to_your_link+` +** `pass:[undefined reference to `webcpp_crypto_bearssl_f8a2f3d_getentropy__add_third_party_bearssl_to_your_link']` * wasip2: ** `+wasm-ld: error:+` -** `+undefined symbol: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link+` +** `+undefined symbol: webcpp_crypto_bearssl_f8a2f3d_getentropy__add_third_party_bearssl_to_your_link+` * wasip3: ** `+wasm-ld: error:+` -** `+undefined symbol: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link+` +** `+undefined symbol: webcpp_crypto_bearssl_f8a2f3d_getentropy__add_third_party_bearssl_to_your_link+` * emscripten: ** `+wasm-ld: error:+` -** `+undefined symbol: webcpp_crypto_bearssl_ae63032_getentropy__add_third_party_bearssl_to_your_link+` +** `+undefined symbol: webcpp_crypto_bearssl_f8a2f3d_getentropy__add_third_party_bearssl_to_your_link+` ** `pass:[em++: error:]` `+chacha_default_not_linked_on_emscripten+`:: A program for Emscripten that calls the three ChaCha20-Poly1305 AEADs on their default, libsodium, and links none. The fix: As `+chacha_default_not_linked+`. diff --git a/doc/generated/namespace-curves.adoc b/doc/generated/namespace-curves.adoc index 07f0f98..1095a8a 100644 --- a/doc/generated/namespace-curves.adoc +++ b/doc/generated/namespace-curves.adoc @@ -45,7 +45,7 @@ |libsecp256k1: native, Valgrind's memcheck (Linux; libsecp256k1's own `+ctime_tests.c+`, and webcpp's code around it: the key pair's making and `+secret()+`, its signatures and x-only tweak, ECDH in three forms (`+agree+`, `+agree_hashed+` and `+agree_point+`), the secret key's tweaks and negation, and PKCS#8), MemorySanitizer (Linux, clang; the same paths as memcheck's) and dudect (judged; on a runner GitHub hosts, by two of three runs; `+agree+`), nothing found; wasip2, dudect (judged; on a runner GitHub hosts, by two of three runs; `+agree+`), nothing found; not measured yet on wasip3, emscripten (<>) |libsodium: native, Valgrind's memcheck (Linux), MemorySanitizer (Linux, clang) and dudect (judged; on a runner GitHub hosts, by two of three runs), nothing found; wasip2, dudect (judged; on a runner GitHub hosts, by two of three runs), nothing found; not measured yet on wasip3, emscripten (<>) |libsodium: native, Valgrind's memcheck (Linux) and MemorySanitizer (Linux, clang), nothing found, and dudect (judged; on a runner GitHub hosts, by two of three runs): nothing found with arm64's DIT (data-independent timing) bit set, which webcpp sets around every call on 64-bit ARM under macOS, iOS, Linux, Android and Windows where the CPU has it, as Apple requires of constant-time code (link:https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Enable-DIT-for-constant-time-cryptographic-operations[Apple, Writing ARM64 code for Apple platforms: enable DIT for constant-time cryptographic operations]); the lane's dudect sets nothing itself and measures what a program gets: \|t\| 1.8 to 2.8 against the threshold 10 (2026-11-21, five runs), while its `dudect_planted`, an early-exit scan of the secret key run inside the same guard, reads \|t\| 66.72 and 65.53 (2026-11-21): DIT does not hide a leak. Without DIT, dudect times `agree` with an all-zero secret key against random ones at \|t\| 6.7 to 14.5 (2026-11-19) and 4.3 to 7.8 (2026-11-21, three runs): about one nanosecond in 15 µs. Each on an Apple M5 Max, from a release build. libsodium does not set DIT, and webcpp sets nothing on x86 or WebAssembly; wasip2, dudect (judged; on a runner GitHub hosts, by two of three runs): an open finding, its cause measured: dudect times `agree` with an all-zero secret key against random ones at \|t\| 13 to 32 (2026-11-18; a fixed key against another fixed key: 22.9) and 107 to 260 (2026-11-19), and 25.25 in the lane on 2026-11-21, against the threshold 10, under wasmtime 47 on an Apple M5 Max, from a release build. The cause is Apple silicon's DIT (data-independent timing), which wasmtime does not set (link:https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Enable-DIT-for-constant-time-cryptographic-operations[Apple, Writing ARM64 code for Apple platforms: enable DIT for constant-time cryptographic operations]): with DIT set in wasmtime's main thread, an experiment and not the lane, the same case reads \|t\| 1.5 to 2.1; no branch on a secret was found in the WebAssembly or in wasmtime's compiled code. The lane cannot set DIT from inside the WebAssembly, so it prints this value on wasip2 without judging it; the CI's x86-64 run measures it next; not measured yet on wasip3, emscripten (<>) -|BearSSL: native, Valgrind's memcheck (Linux; the key pair's making, `+sign+` of a digest (`+crypto::signing_schemes::prehashed+`), which makes its signature low S without a branch, then `+low_s()+` and `+is_low_s()+` of it, `+agree+` and the private formats, `+pkcs8+`, `+raw+` and `+pem(pkcs8)+` both ways; BearSSL's own branches on its signing's verdicts listed in `+bearssl_verdicts.supp+`; nothing found at webcpp's pin ae63032, whose patch submitted upstream closes upstream's leak of the nonce's bit length in `+sign+` that this checker found on 2026-11-21, `+sign+` with its low-S step included (Valgrind 3.22, arm64 Linux container, 2026-12-02)), MemorySanitizer (Linux, clang; the same paths as memcheck's; the same leak in `+sign+` on 2026-11-21 on upstream's BearSSL, nothing at webcpp's pin ae63032, `+sign+` with its low-S step included (clang 18, arm64 Linux container, 2026-12-02)) and dudect (judged; on a runner GitHub hosts, by two of three runs; `+sign+` of a digest and `+agree+`, each against the key pair's scalar; `+sign+` with its low-S step judged constant time, \|t\| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)), nothing found; wasip2, dudect (judged; on a runner GitHub hosts, by two of three runs; `+sign+` of a digest and `+agree+`, each against the key pair's scalar; `+sign+` with its low-S step judged constant time, \|t\| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)), nothing found; not measured yet on wasip3, emscripten (<>) +|BearSSL: native, Valgrind's memcheck (Linux; the key pair's making, `+sign+` of a digest (`+crypto::signing_schemes::prehashed+`), which makes its signature low S without a branch, then `+low_s()+` and `+is_low_s()+` of it, `+agree+` and the private formats, `+pkcs8+`, `+raw+` and `+pem(pkcs8)+` both ways; BearSSL's own branches on its signing's verdicts listed in `+bearssl_verdicts.supp+`; nothing found at webcpp's pin f8a2f3d, whose patches submitted upstream close upstream's leak of the nonce's bit length in `+sign+` that this checker found on 2026-11-21 and the jump on the scalar in P-256's scalar check that it found under `+agree+` on the x86-64 runner on 2026-12-03, `+sign+` with its low-S step included (Valgrind 3.22, arm64 Linux container, 2026-12-02; x86-64, `+ctgrind+` and `+ctgrind_space+`, 2026-12-04)), MemorySanitizer (Linux, clang; the same paths as memcheck's; the same leak in `+sign+` on 2026-11-21 on upstream's BearSSL, nothing at webcpp's pin ae63032, `+sign+` with its low-S step included (clang 18, arm64 Linux container, 2026-12-02); MemorySanitizer checks the select of P-256's scalar check before the code generator makes it a jump, so the second patch changes nothing it sees) and dudect (judged; on a runner GitHub hosts, by two of three runs; `+sign+` of a digest and `+agree+`, each against the key pair's scalar; `+sign+` with its low-S step judged constant time, \|t\| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)), nothing found; wasip2, dudect (judged; on a runner GitHub hosts, by two of three runs; `+sign+` of a digest and `+agree+`, each against the key pair's scalar; `+sign+` with its low-S step judged constant time, \|t\| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)), nothing found; not measured yet on wasip3, emscripten (<>) |Standards |link:https://www.secg.org/sec2-v2.pdf[SEC 2, Recommended Elliptic Curve Domain Parameters], link:https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki[BIP 340, Schnorr signatures for secp256k1], link:https://www.rfc-editor.org/rfc/rfc6979[RFC 6979, deterministic ECDSA nonces], link:https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki[BIP 324, version 2 P2P encrypted transport protocol], link:https://github.com/bitcoin/bips/blob/master/bip-0327.mediawiki[BIP 327, MuSig2 for BIP340-compatible multi-signatures], link:https://github.com/bitcoin/bips/blob/master/bip-0352.mediawiki[BIP 352, Silent Payments] diff --git a/doc/llms.txt b/doc/llms.txt index 856359d..84e8738 100644 --- a/doc/llms.txt +++ b/doc/llms.txt @@ -338,7 +338,7 @@ Generated by doc/tables/generate.py with the page's tables. Page: https://webcpp - ElligatorSwift: libsecp256k1: native, Valgrind's memcheck (Linux; libsecp256k1's own `ctime_tests.c`, and webcpp's `ellswift_create` and `ellswift_xdh` around it) and MemorySanitizer (Linux, clang; the same paths as memcheck's), nothing found; not measured yet on wasip2, wasip3, emscripten. - MuSig2: libsecp256k1: native, Valgrind's memcheck (Linux; libsecp256k1's own `ctime_tests.c`, and webcpp's `generate_nonce` and `partial_sign` around it) and MemorySanitizer (Linux, clang; the same paths as memcheck's), nothing found; not measured yet on wasip2, wasip3, emscripten. - BIP 352 silent payments: libsecp256k1: native, Valgrind's memcheck (Linux; libsecp256k1's own `ctime_tests.c`, and webcpp's `create_outputs`, `create_label` and `scan_outputs` around it, each workspace's wipe included) and MemorySanitizer (Linux, clang; the same paths as memcheck's), nothing found; not measured yet on wasip2, wasip3, emscripten. -- P-256: BearSSL: native, Valgrind's memcheck (Linux; the key pair's making, `sign` of a digest (`crypto::signing_schemes::prehashed`), which makes its signature low S without a branch, then `low_s()` and `is_low_s()` of it, `agree` and the private formats, `pkcs8`, `raw` and `pem(pkcs8)` both ways; BearSSL's own branches on its signing's verdicts listed in `bearssl_verdicts.supp`; nothing found at webcpp's pin ae63032, whose patch submitted upstream closes upstream's leak of the nonce's bit length in `sign` that this checker found on 2026-11-21, `sign` with its low-S step included (Valgrind 3.22, arm64 Linux container, 2026-12-02)), MemorySanitizer (Linux, clang; the same paths as memcheck's; the same leak in `sign` on 2026-11-21 on upstream's BearSSL, nothing at webcpp's pin ae63032, `sign` with its low-S step included (clang 18, arm64 Linux container, 2026-12-02)) and dudect (judged; on a runner GitHub hosts, by two of three runs; `sign` of a digest and `agree`, each against the key pair's scalar; `sign` with its low-S step judged constant time, |t| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)), nothing found; wasip2, dudect (judged; on a runner GitHub hosts, by two of three runs; `sign` of a digest and `agree`, each against the key pair's scalar; `sign` with its low-S step judged constant time, |t| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)), nothing found; not measured yet on wasip3, emscripten. +- P-256: BearSSL: native, Valgrind's memcheck (Linux; the key pair's making, `sign` of a digest (`crypto::signing_schemes::prehashed`), which makes its signature low S without a branch, then `low_s()` and `is_low_s()` of it, `agree` and the private formats, `pkcs8`, `raw` and `pem(pkcs8)` both ways; BearSSL's own branches on its signing's verdicts listed in `bearssl_verdicts.supp`; nothing found at webcpp's pin f8a2f3d, whose patches submitted upstream close upstream's leak of the nonce's bit length in `sign` that this checker found on 2026-11-21 and the jump on the scalar in P-256's scalar check that it found under `agree` on the x86-64 runner on 2026-12-03, `sign` with its low-S step included (Valgrind 3.22, arm64 Linux container, 2026-12-02; x86-64, `ctgrind` and `ctgrind_space`, 2026-12-04)), MemorySanitizer (Linux, clang; the same paths as memcheck's; the same leak in `sign` on 2026-11-21 on upstream's BearSSL, nothing at webcpp's pin ae63032, `sign` with its low-S step included (clang 18, arm64 Linux container, 2026-12-02); MemorySanitizer checks the select of P-256's scalar check before the code generator makes it a jump, so the second patch changes nothing it sees) and dudect (judged; on a runner GitHub hosts, by two of three runs; `sign` of a digest and `agree`, each against the key pair's scalar; `sign` with its low-S step judged constant time, |t| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)), nothing found; wasip2, dudect (judged; on a runner GitHub hosts, by two of three runs; `sign` of a digest and `agree`, each against the key pair's scalar; `sign` with its low-S step judged constant time, |t| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)), nothing found; not measured yet on wasip3, emscripten. ## Rules of use diff --git a/doc/tables/crypto.json b/doc/tables/crypto.json index 9d9ba46..3771f91 100644 --- a/doc/tables/crypto.json +++ b/doc/tables/crypto.json @@ -45,14 +45,16 @@ "webauthn": ["W3C Web Authentication, its algorithm identifiers: ES256 is ECDSA on P-256 with SHA-256", "https://www.w3.org/TR/webauthn-2/#sctn-alg-identifier"], "webauthn-signatures": ["W3C Web Authentication, section 6.5.5: an ES256 assertion's signature is DER, RFC 3279's Ecdsa-Sig-Value", "https://www.w3.org/TR/webauthn-2/#sctn-signature-attestation-types"], "bearssl-bits2int": ["BearSSL's ecdsa_i31_bits.c at upstream 7bea48e, lines 44 and 45: the nonce decoded with its actual bit length in the integer's header, then shifted over the words that length needs", "https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ecdsa_i31_bits.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l44"], - "bearssl-bits2int-fix": ["webcpporg/bearssl, commit ae63032 on its branch upstream/ecdsa-bits2int-constant-time, webcpp's pin: upstream 7bea48e plus exactly the patch submitted upstream, br_ecdsa_i31_bits2int and br_ecdsa_i15_bits2int setting the integer's header, before the right shift, to the larger of the decoded bit length and the order's, both public; the pin returns to upstream once upstream applies it", "https://github.com/webcpporg/bearssl/commit/ae63032d9f30bf53674db5445875adf71b8626b7"], + "bearssl-bits2int-fix": ["webcpporg/bearssl, commit ae63032 on its branch upstream/ecdsa-bits2int-constant-time, one of the two patches of webcpp's pin f8a2f3d (upstream 7bea48e plus exactly the patches submitted upstream): br_ecdsa_i31_bits2int and br_ecdsa_i15_bits2int setting the integer's header, before the right shift, to the larger of the decoded bit length and the order's, both public; the pin returns to upstream once upstream applies it", "https://github.com/webcpporg/bearssl/commit/ae63032d9f30bf53674db5445875adf71b8626b7"], + "bearssl-check-scalar": ["BearSSL's ec_p256_m62.c at upstream 7bea48e, lines 1623 to 1627: the scalar compared with the order through masks that Clang on x86-64 compiles into a conditional jump on the comparison so far", "https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ec_p256_m62.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l1623"], + "bearssl-check-scalar-fix": ["webcpporg/bearssl, commit ec57f88 on its branch upstream/ec-p256-check-scalar-constant-time, the other patch of webcpp's pin f8a2f3d: check_scalar in ec_p256_m62.c and ec_p256_m64.c computing 0 < k < n as k - 1 < n - 1 with two borrow chains, no select for a compiler to turn into a jump; the pin returns to upstream once upstream applies it", "https://github.com/webcpporg/bearssl/commit/ec57f886ee0a0783acfca1b465b43ccd62b71046"], "minerva": ["Minerva: the leak of an ECDSA nonce's bit length through timing, and the lattice that recovers the key (CVE-2019-15809)", "https://minerva.crocs.fi.muni.cz/"], - "bearssl-ecdsa-stack": ["BearSSL's ecdsa_i31_sign_raw.c at upstream 7bea48e, unchanged at webcpp's pin ae63032, lines 45 to 51 and 115 to 135: the scalar, the nonce and the HMAC-DRBG state in the function's stack frame, never zeroed", "https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ecdsa_i31_sign_raw.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l45"], + "bearssl-ecdsa-stack": ["BearSSL's ecdsa_i31_sign_raw.c at upstream 7bea48e, unchanged at webcpp's pin f8a2f3d, lines 45 to 51 and 115 to 135: the scalar, the nonce and the HMAC-DRBG state in the function's stack frame, never zeroed", "https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ecdsa_i31_sign_raw.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l45"], "ieee1363": ["IEEE 1363-2000, Standard Specifications for Public-Key Cryptography: a signature as the two integers r and s, each at the order's length", "https://standards.ieee.org/ieee/1363/2049/"], "rfc3279": ["RFC 3279, section 2.2.3: an ECDSA signature in X.509, the DER of a SEQUENCE of the INTEGERs r and s", "https://www.rfc-editor.org/rfc/rfc3279#section-2.2.3"], "rfc7518": ["RFC 7518, section 3.4: JWS's ES256 signature is r and s, 32 bytes each, not DER", "https://www.rfc-editor.org/rfc/rfc7518#section-3.4"], - "bearssl-mul-stack-m62": ["BearSSL's ec_p256_m62.c at upstream 7bea48e, unchanged at webcpp's pin ae63032, point_mul_inner from line 1251: the scalar's running point and the window entries it selects in the function's stack frame, never zeroed", "https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ec_p256_m62.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l1251"], - "bearssl-mul-stack-m31": ["BearSSL's ec_p256_m31.c at upstream 7bea48e, unchanged at webcpp's pin ae63032, p256_mul from line 1116: the scalar's running point and the window entries it selects in the function's stack frame, never zeroed", "https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ec_p256_m31.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l1116"], + "bearssl-mul-stack-m62": ["BearSSL's ec_p256_m62.c at upstream 7bea48e, point_mul_inner from line 1251, which webcpp's pin f8a2f3d leaves unchanged: the scalar's running point and the window entries it selects in the function's stack frame, never zeroed", "https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ec_p256_m62.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l1251"], + "bearssl-mul-stack-m31": ["BearSSL's ec_p256_m31.c at upstream 7bea48e, unchanged at webcpp's pin f8a2f3d, p256_mul from line 1116: the scalar's running point and the window entries it selects in the function's stack frame, never zeroed", "https://www.bearssl.org/gitweb/?p=BearSSL;a=blob;f=src/ec/ec_p256_m31.c;hb=7bea48e5e850ab4cafbe68d3765cdaba13a86d6f#l1116"], "webcrypto-ecdh": ["W3C Web Cryptography API, ECDH's deriveBits: the shared point's x coordinate, its first length bits", "https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations"], "trystero-ecdh": ["Trystero 0.27.0 (commit 8d3f57e), packages/core/src/crypto.ts: derivePairwiseAesKey's deriveBits with ECDH, 256 bits, at lines 303 to 304, keying HKDF with SHA-256 at lines 311 to 328", "https://github.com/dmotz/trystero/blob/8d3f57ef42c3d622840eec479784c99deeeb2d05/packages/core/src/crypto.ts#L303-L328"], "trystero-scale-ecdh": ["Trystero 0.27.0 (commit 8d3f57e), packages/core/src/scale/manager.ts line 306: its ECDH P-256 key pair generated", "https://github.com/dmotz/trystero/blob/8d3f57ef42c3d622840eec479784c99deeeb2d05/packages/core/src/scale/manager.ts#L306"], @@ -144,11 +146,11 @@ "jamfile": "/third_party//bearssl", "targets": ["native", "wasip2", "wasip3", "emscripten"], "header": "", - "library": "BearSSL at webcpporg/bearssl commit ae63032d, upstream commit 7bea48e5 plus exactly the ECDSA nonce fix submitted upstream, until upstream applies it, built from source", + "library": "BearSSL at webcpporg/bearssl commit f8a2f3d9, upstream commit 7bea48e5 plus exactly the two fixes submitted upstream (the ECDSA nonce's and P-256's scalar check's), until upstream applies them, built from source", "licence": "MIT", "own_api": "``, all of it", "allocation": "none: the key schedule and GCM's state live inside the object", - "constant_time": "by design: `aes_ct64` and `ghash_ctmul64`, or AES-NI and PCLMUL where the CPU has them; on a 32-bit host a 64-bit multiplication may not be constant time, which BearSSL documents; ECDSA signing at webcpp's pin, whose patch submitted upstream closes upstream's leak of the RFC 6979 nonce's bit length ({bearssl-bits2int}; {minerva}; the patch: {bearssl-bits2int-fix})", + "constant_time": "by design: `aes_ct64` and `ghash_ctmul64`, or AES-NI and PCLMUL where the CPU has them; on a 32-bit host a 64-bit multiplication may not be constant time, which BearSSL documents; ECDSA signing at webcpp's pin, whose patch submitted upstream closes upstream's leak of the RFC 6979 nonce's bit length ({bearssl-bits2int}; {minerva}; the patch: {bearssl-bits2int-fix}); P-256's `mul`, which ECDH calls, at webcpp's pin, whose other patch submitted upstream removes the jump on the secret scalar that Clang makes on x86-64 of upstream's scalar check ({bearssl-check-scalar}; the patch: {bearssl-check-scalar-fix})", "constant_time_sources": ["bearssl-ct", "bearssl-ctmul"] }, "openssl": { @@ -1129,7 +1131,7 @@ {"targets": ["native", "wasip2", "wasip3", "emscripten"], "backend": "bearssl", "tests": ["p256_keys_bearssl", "p256_ecdsa_bearssl", "p256_ecdh_bearssl", "default_backend_none_linked"], "why": "the one backend of the P-curves on all four targets, constant time by design and allocating nothing ({bearssl}); OpenSSL and Botan join in increments 8 and 7"} ], "backends": { - "bearssl": {"targets": "all", "lane": {"native": ["memcheck", "msan", "dudect"], "wasip2": ["dudect"]}, "lane_note": {"memcheck": "the key pair's making, `sign` of a digest (`crypto::signing_schemes::prehashed`), which makes its signature low S without a branch, then `low_s()` and `is_low_s()` of it, `agree` and the private formats, `pkcs8`, `raw` and `pem(pkcs8)` both ways; BearSSL's own branches on its signing's verdicts listed in `bearssl_verdicts.supp`; nothing found at webcpp's pin ae63032, whose patch submitted upstream closes upstream's leak of the nonce's bit length in `sign` that this checker found on 2026-11-21, `sign` with its low-S step included (Valgrind 3.22, arm64 Linux container, 2026-12-02)", "msan": "the same paths as memcheck's; the same leak in `sign` on 2026-11-21 on upstream's BearSSL, nothing at webcpp's pin ae63032, `sign` with its low-S step included (clang 18, arm64 Linux container, 2026-12-02)", "dudect": "`sign` of a digest and `agree`, each against the key pair's scalar; `sign` with its low-S step judged constant time, |t| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)"}} + "bearssl": {"targets": "all", "lane": {"native": ["memcheck", "msan", "dudect"], "wasip2": ["dudect"]}, "lane_note": {"memcheck": "the key pair's making, `sign` of a digest (`crypto::signing_schemes::prehashed`), which makes its signature low S without a branch, then `low_s()` and `is_low_s()` of it, `agree` and the private formats, `pkcs8`, `raw` and `pem(pkcs8)` both ways; BearSSL's own branches on its signing's verdicts listed in `bearssl_verdicts.supp`; nothing found at webcpp's pin f8a2f3d, whose patches submitted upstream close upstream's leak of the nonce's bit length in `sign` that this checker found on 2026-11-21 and the jump on the scalar in P-256's scalar check that it found under `agree` on the x86-64 runner on 2026-12-03, `sign` with its low-S step included (Valgrind 3.22, arm64 Linux container, 2026-12-02; x86-64, `ctgrind` and `ctgrind_space`, 2026-12-04)", "msan": "the same paths as memcheck's; the same leak in `sign` on 2026-11-21 on upstream's BearSSL, nothing at webcpp's pin ae63032, `sign` with its low-S step included (clang 18, arm64 Linux container, 2026-12-02); MemorySanitizer checks the select of P-256's scalar check before the code generator makes it a jump, so the second patch changes nothing it sees", "dudect": "`sign` of a digest and `agree`, each against the key pair's scalar; `sign` with its low-S step judged constant time, |t| 1.70 on Linux and 1.63 natively on an Apple M5 Max (release, one run each, 2026-11-22; provisional, measured again in the final quiet pass)"}} } } ], diff --git a/include/webcpp/crypto/detail/canary.h b/include/webcpp/crypto/detail/canary.h index 300b345..7289c59 100644 --- a/include/webcpp/crypto/detail/canary.h +++ b/include/webcpp/crypto/detail/canary.h @@ -22,7 +22,7 @@ #ifdef WEBCPP_CRYPTO_BEARSSL_CANARY_COMMIT #define WEBCPP_CRYPTO_BEARSSL_COMMIT WEBCPP_CRYPTO_BEARSSL_CANARY_COMMIT #else -#define WEBCPP_CRYPTO_BEARSSL_COMMIT ae63032 +#define WEBCPP_CRYPTO_BEARSSL_COMMIT f8a2f3d #endif #ifdef WEBCPP_CRYPTO_SECP256K1_CANARY_COMMIT #define WEBCPP_CRYPTO_SECP256K1_COMMIT WEBCPP_CRYPTO_SECP256K1_CANARY_COMMIT diff --git a/test/constant_time/bearssl_verdicts.supp b/test/constant_time/bearssl_verdicts.supp index a38cb56..bd6b627 100644 --- a/test/constant_time/bearssl_verdicts.supp +++ b/test/constant_time/bearssl_verdicts.supp @@ -7,9 +7,9 @@ # Valgrind's suppressions for valgrind.mjs: BearSSL's own branches on a verdict, public by design, # in a function webcpp calls with a secret, where webcpp cannot mark the verdict public as it does # in its engines. The entry is a conditional jump whose innermost frame is that function, and the -# function's body branches on nothing else that is secret (BearSSL at webcpp's pin ae63032, -# upstream 7bea48e and the ECDSA nonce fix submitted upstream, which does not touch these -# functions; the lines given). Nothing here covers the nonce's decoding, br_ecdsa_i31_bits2int, +# function's body branches on nothing else that is secret (BearSSL at webcpp's pin f8a2f3d, +# upstream 7bea48e and the two fixes submitted upstream, the ECDSA nonce's and P-256's scalar +# check's, which do not touch these functions; the lines given). Nothing here covers the nonce's decoding, br_ecdsa_i31_bits2int, # whose shift runs over a public length at the pin. MemorySanitizer needs none: it # approximates a subtraction's shadow by its operands' without the carry (msan_test.cpp's head # comment), and each of these verdicts is the top bit of a word computed from BearSSL's 31-bit