Repository navigation
Merged
Conversation
…nner GitHub hosts prints dudect's |t| without judging it The CI's x86-64 runs of the lane constant-time failed dudect_bearssl: equal at |t| 21 to 25 and once ChaCha20-Poly1305's seal at 10.7. clang 18's x86-64 code of equal and of BearSSL's SSE2 ChaCha20 and ctmulq Poly1305 has no branch or index on a secret, and memcheck passed on it. The cause was the harness: choose copied class 0's input from the fixed array and class 1's from bytes just drawn, still in the store buffer, and the measured call inherited that difference whatever it computed. Measured on GitHub's runners (2026-11-20): equal at |t| 31 to 56 on an Intel Xeon 6975P-C and the seal at 28 to 85 on AMD EPYC 9V45 and 9V74 with that copy; through a blend that reads both sources and writes the secret with the same instructions for either class, 23 runs of 24 below 4.4 on the Xeon, an EPYC 9V74 and an EPYC 7763, idle and with every processor busy. The 24th read 69.8 on a case below 4.4 everywhere else: a hosted runner is a shared virtual machine whose processor changes from run to run, and a verdict there would pass or fail with the machine drawn. There the Jamfile defines WEBCPP_TEST_DUDECT_UNJUDGED (RUNNER_ENVIRONMENT is github-hosted), and dudect_bearssl, dudect_sodium and dudect_secp256k1 print their |t| and pass; memcheck, MemorySanitizer and dudect_planted stay judged, and dudect is judged on any other machine. The constant-time section and the page's checker name say so.
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.
Fixes the
dudect_bearsslfailure of main's final CI (run 44690336353, job "Own lane (crypto, constant-time, native)":equal 21.31,chacha seal 10.68).Cause
The cause was the harness, not the code.
equal(straight-line loads, XOR, OR, no branch) and of BearSSL's SSE2 ChaCha20 with ctmulq Poly1305 (branches on the length and the public encrypt flag only, the final reduction throughsete/cmov) has no branch or index on a secret. memcheck and MemorySanitizer passed on the same build.choosecopied class 0's input from the fixed array, and class 1's from bytes it had just drawn, which were still in the store buffer. The measured call then took on that difference, whatever it computed.equalread |t| 31 to 56 on an Intel Xeon 6975P-C, with everyequalvariant affected alike: equal or unequal inputs, zero or 0x5a.Ruling
choosenow blends through a mask read from a volatile. It is branchless on x86-64, and its instructions are the same for either class.RUNNER_ENVIRONMENTisgithub-hosted, the Jamfile definesWEBCPP_TEST_DUDECT_UNJUDGED.dudect_bearssl,dudect_sodiumanddudect_secp256k1then print their |t| and pass.dudect_plantedstay judged on hosted runners. dudect is judged on any other machine.dudect.hpp(choose,judged), indoc/backends.adoc, indoc/testing.adoc, and incrypto.json's checker name, which the generated tables carry.Verification
dudect_plantedstill finds its leak (|t| 44). They were also run withRUNNER_ENVIRONMENT=github-hosted, which prints "printed, not judged".constant-timepasses.generate.pyandgenerate_test.pypass.🤖 Generated with Claude Code