Repository navigation
crypto: every guard, wipe, erase, comparison, secret and declassify on webcpp::secure, no alias - #19
Merged
Merged
Conversation
added 17 commits
November 25, 2026 05:11
…nd erase_secret, constant_time_equal, secret<N>, the wipe and declassify are secure's, with no alias
…pace alias is left (lint fix)
…ong the targets where it executes nothing (collect.py --render-only)
…, which owns secret<N>; its fix leaves crypto's messages page (doc/tables/generate.py)
…s it counts crypto's guards, and llms.txt no longer names secure's comparison and erasure as crypto's (doc/tables/generate.py)
…ecret, which crypto itself uses, and define no wipe of their own
…ult's operator-> holds the cipher's name on MSVC; user_globals says where MSVC warns in templates
…ing, and after the catch what Windows on ARM64 leaves Windows on ARM64 clears DIT when it resumes a thread after any catch, guard or no guard (secure's guard page, "Exceptions"), so a program's DIT set before a throw is clear after its catch there. throws_bad_alloc now records DIT during the unwinding, after the call's guards, where it must be as before (ruling R6), checks that after the catch DIT is what a throw and catch that cross no guard leave, and then sets DIT as the unwinding left it, as a program that wants it after a catch must do there.
…hich hid the agreement's (MSVC's C4456); report_case writes to a stream, as secure's, so that dudect_harness needs no freopen or fopen (C4996)
…t now reads it again at its end (secure's guard, after Windows on ARM64's catch)
…in place of one that ended the process, which MSVC 14.3 x64 release warned never returns (C4722, an error under /WX in 22 programs)
…s with a bounds-checked loop in place of string_view::substr, which may throw from a noexcept function (clang-tidy's bugprone-exception-escape)
…here it was set (a guard engaged only then; Windows on ARM64 clears DIT after a catch and OpenSSL goes on), checked by timing_adapter
…t unwinds the call, and that Windows on ARM64 clears it after the catch
…0 ns, set 1.2 ns); the guard's provisional mark goes
This was referenced Nov 26, 2026
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.
crypto on webcpp::secure: every public operation holds
secure::timing_guard(the 185 sites of 25 headers unchanged; the two ofconstant_time_equalwent with it to secure), every wipe issecure::erase_secret(56 sites, the same bytes), the 12 verdicts callsecure::declassifyon the same values, anderase_secret,constant_time_equal,secret<N>,detail/timing.hpp,detail/wipe.hppanddetail/declassify.hppare deleted with no alias; a program still naming the old names fails with a message naming secure's. crypto keeps its own seam recorder, DIT helper and checkers' marks in its tests (owner's decision O1).Also:
timing_nested_hash(crypto's guard around a guarded hash call, Ed25519ph unkeyed included) replacestiming_hash_interop; dudect and benches onsecure::cpu_has_dit(); the examples erase their secrets withsecure::erase_secret; OpenSSL's malloc/free adapter keeps DIT across its catch on Windows on ARM64 (timing_adapter);sodium_entropy_wipeholds on Emscripten release (the optimiser had shrunk its padding and split the control's stores);openssl_memory's resource builds under MSVC release (C4722);dudect_sodiumbuilds on MSVC; the guard's rows measured again on an idle machine.Verified locally before merge on every lane with secure and hash (clang, gcc-15, wasip2, wasip3, Emscripten, release builds, the constant-time lane on Linux and macOS and its wasip2 half, macOS and Linux lint, MSVC 14.3 and 14.5 x64 debug, MSVC 14.5 arm64 debug for the timing tests, dudect_sodium on Windows ARM64 release). Depends on webcpporg/secure#1 and webcpporg/hash#15 (merged).
🤖 Generated with Claude Code