From 9666cd801c7ed2b50ff349e2f35f46c2d1a4752c Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 09:05:38 -0300 Subject: [PATCH 01/13] tools/hash: the backends chapter lists which functions set DIT from the capability table, and hash's collect.py tests cover --timing --- tools/hash/doc_tables.py | 113 ++++++++++++++++++- tools/test/hash_collect_test.py | 173 ++++++++++++++++++++++++++--- tools/test/hash_doc_tables_test.py | 44 +++++++- 3 files changed, 315 insertions(+), 15 deletions(-) diff --git a/tools/hash/doc_tables.py b/tools/hash/doc_tables.py index 6cdd2c5d..2a4a54bb 100644 --- a/tools/hash/doc_tables.py +++ b/tools/hash/doc_tables.py @@ -33,7 +33,9 @@ - generated/measured.adoc: the includes of the data chapters, backends.adoc and measurements.adoc (this tool), performance.adoc (bench/collect.py) and allocation.adoc (bench/allocation_collect.py), each one that is there; -- backends.adoc: the capability table as the guide's data chapter shows it; +- backends.adoc: the capability table as the guide's data chapter shows it, with which functions + set DIT around their calls and which do not (design D1 to D6 of the change + data-independent-timing), from the table's chapters and kinds; - measurements.adoc: measurements.json's tables, labelled as the dated reference they are; - llms.txt: the guide's index for language models, installed beside the page. @@ -88,6 +90,27 @@ # function's default is of the same order (design D33). FAMILY_KINDS = ('digest', 'mac', 'kdf') FAMILY_DEFAULTS = ('hash2', 'xkcp', 'blake3', 'sodium') +# The chapters whose functions compute on a key, a password or a secret input, and so set DIT +# around each call: every row of them but a type, which is Boost.Hash2's by alias (the change +# data-independent-timing, design D1 and D3). The coverage tests read the same rule from the table. +KEYED_CHAPTERS = {'macs': 'MACs', 'kdfs': 'Key derivation', 'password_hashing': 'Password hashing'} +# How a call names a row of each kind: a tag through its family's template, a function by its +# name. +CALLED_AS = {'mac': 'mac<{}>', 'kdf': 'argon2<{}>', 'digest': 'digest_of<{}>'} +# The keyed calls of a row the keyed chapters do not hold, each with the row it is a call of: the +# keyed modes of a digest (design D1, engaged by the arguments, D4) and bcrypt's verification, +# which the table lists under bcrypt. +KEYED_CALLS = ( + ('digests::blake2b', '`digest_of` and `hasher` (`make`, ' + '`update`, `finish`) when the options carry a key'), + ('blake3', 'the `blake3` class in its keyed, key-derivation and seeded keyed modes (a ' + 'non-empty byte seed, a non-zero integer seed: BLAKE3\'s keyed hash): `keyed`, `derive_key`, ' + 'those constructors, and `update`, `result`, `squeeze` and `reset` of such an object'), + ('bcrypt', '`bcrypt_verify`'), +) +APPLE_DIT = ('https://developer.apple.com/documentation/xcode/' + 'writing-arm64-code-for-apple-platforms' + '#Enable-DIT-for-constant-time-cryptographic-operations') # The chapter each namespace's tags belong in: a tag of macs is listed with the MACs. NAMESPACE_CHAPTERS = {'digests::': 'digests', 'macs::': 'macs'} # The templates a family's tag is the first template argument of, by its kind, each declared in @@ -653,6 +676,11 @@ def llms_txt(data: Data) -> str: 'Primitives only: protocol steps (BIP39, hash160, EIP-55, Nostr ids, NIP-44) ' 'are what a domain library builds from these functions; the guide shows them as ' 'examples, never as this library\'s API.', '', + 'Timing: every MAC, key derivation and password hash, and BLAKE2b\'s and BLAKE3\'s ' + 'keyed modes, set 64-bit ARM\'s DIT (data-independent timing) around each call where ' + 'the CPU has it, on every backend, and leave the thread\'s DIT as they found it; ' + 'unkeyed digests and Boost.Hash2\'s hmac by alias do not, so an HMAC with DIT is ' + f'mac>. [Section]({page}#hash-backends-dit)', '', f'- [The guide]({page}): every chapter, example and table', f'- [Choose by use case]({page}#hash-choose): a decision table, need to ' 'function, backend and example', ''] @@ -694,6 +722,88 @@ def llms_txt(data: Data) -> str: return '\n'.join(lines) +def keyed_rows(data: Data) -> tuple[dict[str, list[str]], list[str]]: + """The rows that set DIT, by chapter, each as a call names it (a tag through its family), and + the types of the keyed chapters that do not (the aliases), in the table's order.""" + keyed: dict[str, list[str]] = {} + aliases: list[str] = [] + for algorithm in data.capabilities['algorithms']: + if algorithm['chapter'] not in KEYED_CHAPTERS: + continue + for function in algorithm['functions']: + if function['kind'] == 'type': + aliases.append(function['name']) + else: + called = CALLED_AS.get(function['kind'], '{}').format(function['name']) + keyed.setdefault(algorithm['chapter'], []).append(called) + return keyed, aliases + + +def dit_section(data: Data) -> list[str]: + """Which functions set DIT around their calls and which do not, and why: the keyed chapters' + rows from the table, the keyed calls of other rows, and the rest.""" + keyed, aliases = keyed_rows(data) + lines = [ + '[#hash-backends-dit]', '=== Data-independent timing (DIT)', '', + '64-bit ARM\'s DIT (data-independent timing) bit, PSTATE.DIT, makes the instructions Arm ' + 'lists take a time independent of their data, and Apple requires it of constant-time code ' + f'({link("Apple, enable DIT for constant-time cryptographic operations", APPLE_DIT)}). ' + 'None of the libraries hash calls sets it, so hash does: every function that computes on ' + 'a key, a password or a key derivation\'s secret input runs its whole body inside ' + '`detail::timing_guard`, on every backend, which on 64-bit ARM under macOS, iOS, Linux ' + 'and Android, where the CPU has FEAT_DIT (`hw.optional.arm.FEAT_DIT` on Apple\'s systems, ' + '`HWCAP_DIT` on Linux), sets DIT for the call and returns with the thread\'s DIT as it ' + 'found it: clear when it was clear, set when the program set it itself (Apple\'s ' + '`timingsafe_enable_if_supported`) or an outer call did. An error and an exception leave ' + 'it as found too, and DIT is a thread\'s own state, so a call never changes another ' + 'thread\'s. A program does nothing. Elsewhere the guard executes no instruction: on x86 ' + 'the counterpart, DOITM, is a register only the kernel writes; on WebAssembly the engine ' + 'decides; on Windows on ARM64 no documented way to ask whether the CPU has FEAT_DIT was ' + 'found, and DIT\'s instructions trap on a CPU without it.', '', + 'The functions that set DIT, on every backend of their cells:', ''] + for chapter, names in keyed.items(): + lines.append(f'* {KEYED_CHAPTERS[chapter]}: {listed([f"`{name}`" for name in names])}.') + calls = [text for row, text in KEYED_CALLS if row in data.functions] + if calls: + lines.append('* Keyed by their arguments: ' + '; '.join(calls) + '. Called without a ' + 'key, they hold a disengaged guard, which reads its flag and does nothing ' + 'else.') + lines += [ + '', 'The functions that do not:', '', + '* Unkeyed digests and extendable-output functions, through `digest_of`, `hasher` and ' + 'the types of Boost.Hash2\'s form (`keccak_256`, `blake3` in its plain mode): their input ' + 'is not a secret by their contract (a program that derives from a secret uses a MAC or a ' + 'key derivation, which set DIT); they are the streaming case, where a guard per `update` ' + 'of every checksum would cost a real fraction of a short chunk for no secret; and the ' + 'same algorithm is also Boost.Hash2\'s own type by alias, which hash cannot guard, so ' + 'that guarding one spelling would make the protection depend on the spelling.'] + if aliases: + lines.append( + '* Boost.Hash2\'s types by alias, ' + listed([f'`{name}`' for name in aliases]) + + ': they are Boost.Hash2\'s own classes, and a guard inside them would need a type of ' + 'hash\'s in place of the alias. An HMAC with DIT is `mac>`, which runs ' + 'the same Boost.Hash2 code on `backends::hash2` inside its guard; a program that ' + 'calls `hmac` directly sets DIT itself. HKDF and PBKDF2 on `backends::hash2` run ' + 'Boost.Hash2\'s `hmac` inside their own guard.') + lines += [ + '* The initiating functions of `async.hpp`: they check sizes and post, and the ' + 'synchronous function they call sets DIT on the thread that computes, a thread of the ' + 'work executor\'s pool for a heavy function, the caller\'s for a cheap one ' + '(<>). On `backends::webcrypto` the browser\'s JavaScript engine computes, ' + 'and nothing is added.', '', + 'A coverage test per backend (`test/timing_coverage__test.cpp`) reads this ' + 'table and fails when a keyed cell of its backend has no call, when a call enters no ' + 'guard, when the first guard it enters is not its own function\'s, or when it leaves DIT ' + 'otherwise than it found it; it checks that the unkeyed functions enter none. The guard ' + 'is hash\'s own copy of ' + 'webcpp::crypto\'s, which depends on hash: a change to one is a change to the other, and ' + 'crypto\'s test `timing_hash_interop_test` runs both nested, in either order.', ''] + if (data.library / 'doc' / 'performance.adoc').is_file(): + lines += ['What the guard adds to a call, measured from a release build, is in ' + '<>.', ''] + return lines + + def chapter_header(title: str, anchor: str, sources: str) -> list[str]: return [generated_header(sources), f'[#{anchor}]', f'== {title}', ''] @@ -737,6 +847,7 @@ def backends_chapter(data: Data) -> str: f'| {hmacs}', f'| {c["constant_time"]["value"]}', f'| {targets}'] lines += ['|===', ''] + lines += dit_section(data) lines += ['=== The default backends', '', 'The backend a call that names none uses, on every target, whatever the program ' 'links (<>):', '', diff --git a/tools/test/hash_collect_test.py b/tools/test/hash_collect_test.py index 326437be..d8372a96 100644 --- a/tools/test/hash_collect_test.py +++ b/tools/test/hash_collect_test.py @@ -5,15 +5,22 @@ # accompanying file LICENSE_1_0.txt or copy at # https://www.boost.org/LICENSE_1_0.txt) -"""Checks that libs/hash/bench/collect.py, which measures bench/pbkdf2_sha512 and renders -doc/performance.adoc, builds its table only from release builds: a program whose build directory, -b2's bench///..., names another variant, or does not say, is refused before -anything runs or is written; one at variant=release is taken (it gets as far as running); and -`--render-only` refuses data whose build is not variant=release, before it writes the page. Run -with the names of some cases to run only those.""" +"""Checks that libs/hash/bench/collect.py, which measures bench/pbkdf2_sha512 and bench/timing and +renders doc/performance.adoc, builds its page only from release builds: a program whose build +directory, b2's bench///..., names another variant, or does not say, is refused +before anything runs or is written, the guard's `--timing` program as the throughput's; one at +variant=release is taken (it gets as far as running); `--timing` alone stores the guard's cost +beside the data's throughput, which it keeps, with UTC's date, and the page renders it; +`--provisional` marks the guard's figures and the page says so, a measurement without it clears +the mark, and it is refused without `--timing`; `--timing` without data, a timing line that is not +the form collect.py reads and a "timing_guard" that is not the form it writes are refused with a +message, not a traceback, before anything is written; and `--render-only` refuses data whose +build, or whose guard's build, is not variant=release, before it writes the page, and renders the +committed data as the committed page. Run with the names of some cases to run only those.""" from __future__ import annotations +import datetime import json import subprocess import sys @@ -23,6 +30,10 @@ ROOT = Path(__file__).resolve().parents[2] COLLECT = ROOT / 'libs/hash/bench/collect.py' +DATA = ROOT / 'libs/hash/doc/measurements.throughput.json' +PAGE = ROOT / 'libs/hash/doc/performance.adoc' +# A stand-in's body that fails when run, after saying so. +FAILS = 'echo "the stand-in ran" >&2\nexit 3\n' def run(*args: str | Path) -> subprocess.CompletedProcess[str]: @@ -30,12 +41,14 @@ def run(*args: str | Path) -> subprocess.CompletedProcess[str]: capture_output=True, text=True, check=False, timeout=120) -def program(scratch: Path, variant: str) -> Path: - """A stand-in of bench/pbkdf2_sha512 where b2 builds it at variant, which fails when run.""" +def program(scratch: Path, variant: str, body: str = FAILS, + name: str = 'pbkdf2_sha512') -> Path: + """A stand-in of bench/ where b2 builds it at variant, which runs body (by default, it + fails).""" path = (scratch / 'bin/libs/hash/bench/clang-darwin-21' / variant - / 'cxxstd-20-iso/optimization-speed/pbkdf2_sha512') + / 'cxxstd-20-iso/optimization-speed' / name) path.parent.mkdir(parents=True) - path.write_text('#!/bin/sh\necho "the stand-in ran" >&2\nexit 3\n') + path.write_text('#!/bin/sh\n' + body) path.chmod(0o755) return path @@ -72,11 +85,132 @@ def test_a_program_built_at_variant_release_is_measured(scratch: Path) -> None: expect(done, 1, 'native: --list exit 3', 'the stand-in ran') +def test_a_timing_program_not_built_at_variant_release_is_refused(scratch: Path) -> None: + data, page = scratch / 'data.json', scratch / 'page.adoc' + data.write_text(DATA.read_text()) + for variant in ('debug', 'profile'): + exe = program(scratch / variant, variant, FAILS, 'timing') + done = run('--timing', exe, '--data', data, '--page', page) + expect(done, 1, f'timing={exe} was built at variant={variant}', + 'only from release builds') + if 'the stand-in ran' in done.stderr or page.exists(): + raise AssertionError(f'{variant}: the program ran or the page was written') + if data.read_text() != DATA.read_text(): + raise AssertionError(f'{variant}: the data was rewritten') + + +GUARD = {'dit': True, 'clear': 12.345, 'set': 0.678, 'disengaged': -0.04, + 'clear_fastest': 11.25, 'clear_slowest': 19.75, 'set_fastest': 0.25, 'set_slowest': 1.75, + 'disengaged_fastest': -0.25, 'disengaged_slowest': 0.375, 'iterations': 10000000, + 'runs': 5, 'target': 'native', 'compiler': 'clang'} + + +def timing_program(scratch: Path, line: str = json.dumps(GUARD)) -> Path: + """A stand-in of bench/timing at variant=release whose --measure prints line.""" + return program(scratch, 'release', 'if [ "$1" = --measure ]; then ' + f"echo '{line}'; else exit 3; fi\n", 'timing') + + +def test_the_guard_is_measured_kept_beside_the_throughput_and_rendered(scratch: Path) -> None: + data, page = scratch / 'data.json', scratch / 'page.adoc' + committed = json.loads(DATA.read_text()) + data.write_text(json.dumps(committed)) + before = datetime.datetime.now(datetime.timezone.utc).date().isoformat() + expect(run('--timing', timing_program(scratch), '--data', data, '--page', page), 0) + written = json.loads(data.read_text()) + guard = written['timing_guard'] + stored = {key: guard[f'{key}_ns'] for key in GUARD if isinstance(GUARD[key], float)} + if stored != {key: value for key, value in GUARD.items() if isinstance(value, float)} or \ + guard['dit'] is not True or guard['build'] != committed['build'] or \ + guard['provisional'] is not False: + raise AssertionError(f'the guard was not stored as measured: {guard}') + utc = {datetime.datetime.now(datetime.timezone.utc).date().isoformat(), before} + if guard['date'] not in utc: + raise AssertionError(f"the guard's date {guard['date']} is not UTC's {utc}") + if {key: value for key, value in written.items() if key != 'timing_guard'} != \ + {key: value for key, value in committed.items() if key != 'timing_guard'}: + raise AssertionError('the throughput was not kept') + text = page.read_text() + if 'provisional' in text: + raise AssertionError(f'the page says provisional without --provisional:\n{text}') + for expected in ('[#hash-performance-timing]', '<>', '| 12.3', '| 11.2', + '| 19.8', '| 0.7', '| 0.2', '| 1.8', '| 0.0', '| 0.4', + 'The guard sets DIT on this machine', '10,000,000 guards'): + if expected not in text: + raise AssertionError(f'{expected!r} is not on the page:\n{text}') + if text.index('[#hash-performance-pbkdf2]') > text.index('[#hash-performance-timing]'): + raise AssertionError('the guard is not rendered after the throughput') + + +def test_provisional_marks_the_guard_and_a_measurement_without_it_clears_it( + scratch: Path) -> None: + data, page = scratch / 'data.json', scratch / 'page.adoc' + data.write_text(DATA.read_text()) + exe = timing_program(scratch) + expect(run('--timing', exe, '--provisional', '--data', data, '--page', page), 0) + if json.loads(data.read_text())['timing_guard']['provisional'] is not True: + raise AssertionError('--provisional did not mark the guard') + text = page.read_text() + if text.count('NOTE: these figures are provisional') != 1 or \ + text.index('NOTE: these figures are provisional') < \ + text.index('[#hash-performance-timing]'): + raise AssertionError(f'the page does not mark the guard alone:\n{text}') + expect(run('--timing', exe, '--data', data, '--page', page), 0) + if json.loads(data.read_text())['timing_guard']['provisional'] is not False or \ + 'provisional' in page.read_text(): + raise AssertionError('a measurement without --provisional kept the mark') + before = data.read_text() + done = run('--render-only', '--provisional', '--data', data, '--page', scratch / 'other.adoc') + expect(done, 1, '--provisional marks the guard\'s figures: give it with --timing') + if data.read_text() != before or (scratch / 'other.adoc').exists(): + raise AssertionError('--provisional without --timing wrote a file') + + +def test_timing_alone_without_data_is_refused_with_a_message(scratch: Path) -> None: + exe = program(scratch, 'release', FAILS, 'timing') + data, page = scratch / 'missing.json', scratch / 'page.adoc' + done = run('--timing', exe, '--data', data, '--page', page) + expect(done, 1, f'collect.py: {data} does not exist') + if 'Traceback' in done.stderr or 'the stand-in ran' in done.stderr: + raise AssertionError(f'a traceback, or the program ran:\n{done.stderr}') + if data.exists() or page.exists(): + raise AssertionError('a file was written') + + +def test_a_timing_line_or_guard_of_another_form_is_refused_with_a_message(scratch: Path) -> None: + data, page = scratch / 'data.json', scratch / 'page.adoc' + lines = { + 'not json': 'line (not JSON)', + json.dumps({key: value for key, value in GUARD.items() if key != 'disengaged'}): + 'line.disengaged (missing)', + json.dumps({**GUARD, 'clear': 'fast'}): 'line.clear', + json.dumps({**GUARD, 'dit': 1}): 'line.dit', + } + for index, (line, named) in enumerate(lines.items()): + data.write_text(DATA.read_text()) + done = run('--timing', timing_program(scratch / str(index), line), '--data', data, + '--page', page) + expect(done, 1, 'not the form collect.py reads', named) + if 'Traceback' in done.stderr or page.exists() or data.read_text() != DATA.read_text(): + raise AssertionError(f'{line}: a traceback, or a file was written:\n{done.stderr}') + committed = json.loads(DATA.read_text()) + for change, named in ((lambda g: g.pop('set_ns'), 'data.timing_guard.set_ns (missing)'), + (lambda g: g.update(dit='yes'), 'data.timing_guard.dit'), + (lambda g: g.update(provisional=None), 'data.timing_guard.provisional')): + broken = json.loads(json.dumps(committed)) + change(broken['timing_guard']) + data.write_text(json.dumps(broken)) + done = run('--render-only', '--data', data, '--page', page) + expect(done, 1, 'not the data collect.py writes', named) + if 'Traceback' in done.stderr or page.exists(): + raise AssertionError(f'{named}: a traceback, or the page was written:\n{done.stderr}') + + def test_render_only_refuses_data_not_built_at_variant_release(scratch: Path) -> None: - committed = json.loads((ROOT / 'libs/hash/doc/measurements.throughput.json').read_text()) + committed = json.loads(DATA.read_text()) page = scratch / 'page.adoc' for build in ('variant=debug optimization=speed', None): - data = dict(committed) + data = json.loads(json.dumps(committed)) if build is None: del data['build'] else: @@ -87,16 +221,29 @@ def test_render_only_refuses_data_not_built_at_variant_release(scratch: Path) -> expect(done, 1, 'only from release builds') if page.exists(): raise AssertionError(f'{build}: the page was written') + data = json.loads(json.dumps(committed)) + data['timing_guard']['build'] = 'variant=debug' path = scratch / 'data.json' + path.write_text(json.dumps(data)) + done = run('--render-only', '--data', path, '--page', page) + expect(done, 1, "timing guard was measured with build variant=debug", + 'only from release builds') + if page.exists(): + raise AssertionError("the guard's debug build: the page was written") path.write_text(json.dumps(committed)) expect(run('--render-only', '--data', path, '--page', page), 0) - if page.read_text() != (ROOT / 'libs/hash/doc/performance.adoc').read_text(): + if page.read_text() != PAGE.read_text(): raise AssertionError('the committed data does not render the committed page') CASES: list[Callable[[Path], None]] = [ test_a_program_not_built_at_variant_release_is_refused, test_a_program_built_at_variant_release_is_measured, + test_a_timing_program_not_built_at_variant_release_is_refused, + test_the_guard_is_measured_kept_beside_the_throughput_and_rendered, + test_provisional_marks_the_guard_and_a_measurement_without_it_clears_it, + test_timing_alone_without_data_is_refused_with_a_message, + test_a_timing_line_or_guard_of_another_form_is_refused_with_a_message, test_render_only_refuses_data_not_built_at_variant_release, ] diff --git a/tools/test/hash_doc_tables_test.py b/tools/test/hash_doc_tables_test.py index cdbe6868..af331731 100644 --- a/tools/test/hash_doc_tables_test.py +++ b/tools/test/hash_doc_tables_test.py @@ -21,7 +21,11 @@ sits in its namespace's chapter. A backend of the asynchronous family alone (backends::webcrypto) is named so in every table, with its targets as the guide spells them, and is never a default; a row of an unknown kind fails. Each backend's constant-time statements are one bullet. llms.txt's -defaults are the capability table's, not a text written once. +defaults are the capability table's, not a text written once. The data chapter's section on DIT +lists every row of the keyed chapters (MACs, key derivation, password hashing) but a type, as a +call names it, among the functions that set DIT, and their types among Boost.Hash2's aliases that +do not, so that a row the table gains is said; it names the guard's measured cost only where +performance.adoc is, and llms.txt points to it. Without doc/measurements.json the tables say so, carry no measured column and render no measurements.adoc; with it (a fixture in its shape) they carry the throughput and the size, and measurements.adoc renders it as the dated reference that decides nothing; a hand edit of the @@ -512,6 +516,43 @@ def test_each_backend_s_constant_time_sources_are_together(scratch: Path) -> Non expect(len(bullets) == len(set(bullets)), f'{name}: {bullets}') +def test_the_dit_section_follows_the_table(scratch: Path) -> None: + library = scratch_library(scratch) + files = write_ok(library) + chapter = files['backends.adoc'] + section = chapter.split('[#hash-backends-dit]')[1].split('=== The default backends')[0] + sets, rest = section.split('The functions that do not:') + for named in ('`mac>`', '`mac`', '`hkdf`', + '`blake2b_subkey`', '`x963kdf`', '`argon2`', '`bcrypt_pbkdf`', + '`digest_of`', 'the `blake3` class', '`bcrypt_verify`'): + expect(named in sets, f'{named} is not among the functions that set DIT:\n{sets}') + for named in ('`hmac_sha2_256`', '`siphash_64`', '`hmac`,'): + expect(named in rest and named not in sets, f'{named} is not among the aliases:\n{rest}') + expect('`mac>`' in rest, 'the aliases do not name the guarded call') + expect('<>' not in section, 'the cost named without its chapter') + expect('#hash-backends-dit)' in files['llms.txt'], 'llms.txt does not point to the section') + # A row the table gains in a keyed chapter is said: a function among those that set DIT, a + # type among the aliases; and the measured cost is named once its chapter is there. + table = json.loads((library / 'doc/capabilities.json').read_text(encoding='utf-8')) + macs = next(a for a in table['algorithms'] if a['chapter'] == 'macs') + tag = next(f for f in macs['functions'] if f['kind'] == 'mac') + alias = next(f for f in macs['functions'] if f['kind'] == 'type') + macs['functions'] += [{**tag, 'name': 'macs::fixture_mac'}, {**alias, 'name': 'fixture_alias'}] + (library / 'doc/capabilities.json').write_text(json.dumps(table), encoding='utf-8') + guide = json.loads((library / 'doc/guide.json').read_text(encoding='utf-8')) + guide['functions']['macs::fixture_mac'] = guide['functions'][tag['name']] + guide['functions']['fixture_alias'] = guide['functions'][alias['name']] + (library / 'doc/guide.json').write_text(json.dumps(guide), encoding='utf-8') + (library / 'doc/performance.adoc').write_text('x\n', encoding='utf-8') + section = write_ok(library)['backends.adoc'].split('[#hash-backends-dit]')[1] + sets, rest = section.split('The functions that do not:') + expect('`mac`' in sets, f'a new MAC is not said:\n{sets}') + expect('`fixture_alias`' in rest.split('=== The default backends')[0], + f'a new alias is not said:\n{rest}') + expect('<>' in rest.split('=== The default backends')[0], + 'the measured cost is not named') + + def test_an_asynchronous_backend_is_said(scratch: Path) -> None: # backends::webcrypto serves the asynchronous family alone (its "asynchronous_only" field): # every table names it with that note, and a synchronous call never names it. @@ -692,6 +733,7 @@ def test_the_real_library_s_files_are_its_data_s(scratch: Path) -> None: test_a_function_without_a_backend_of_the_order_has_no_default, test_a_function_s_default_is_of_the_order, test_each_backend_s_constant_time_sources_are_together, + test_the_dit_section_follows_the_table, test_an_asynchronous_backend_is_said, test_an_exceptions_only_backend_is_said, test_without_measurements_the_tables_say_so, From 9598a77558aba3c9c1ef126a519a2f1b16a64ad9 Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 09:05:38 -0300 Subject: [PATCH 02/13] guidelines: hash's keyed functions hold its copy of crypto's timing guard, and crypto's DIT rule points to it --- CODING-GUIDELINES.md | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/CODING-GUIDELINES.md b/CODING-GUIDELINES.md index be764eeb..92fa5710 100644 --- a/CODING-GUIDELINES.md +++ b/CODING-GUIDELINES.md @@ -7044,10 +7044,13 @@ and not built is in chapter 17. constant time on Apple silicon; a program does nothing. The guard's cost is measured from a release build by `bench/collect.py --timing` and published beside the throughput, and the constant-time lane sets no DIT of its own: it - measures what a program gets. + measures what a program gets. webcpp::hash's keyed functions hold hash's own + copy of the guard, a change to either copy is a change to both, and + `test/timing_hash_interop_test.cpp` runs the two together (chapter 17, hash). Source: `libraries/crypto/openspec/changes/data-independent-timing/design.md` D1 to D7 (proposals); `include/webcpp/crypto/detail/timing.hpp`, - `test/timing_coverage__test.cpp` (libs/crypto). + `test/timing_coverage__test.cpp`, + `test/timing_hash_interop_test.cpp` (libs/crypto). - **`` is reached only through `detail/windows.hpp`, which defines `NOMINMAX` and `WIN32_LEAN_AND_MEAN` only when absent and undefines only what it defined, and every header writes `(max)()`, `(min)()` and @@ -9492,6 +9495,35 @@ and G4); the proposal, with the specification, the design and the plan, is in link's (`.gc`), each defined once. Source: `libraries/hash/openspec/changes/genesis/reference/spec.md` section 5 (proposals). +- **Every function that computes on a key, a password or a key derivation's + secret input holds `detail::timing_guard` as its first statement, on every + backend: `mac`, the key derivations, the password hashes (`bcrypt_verify` + included), and the keyed modes of BLAKE2b (`digest_of` and `hasher` when the + options carry a key) and of the `blake3` class, which construct it with + whether the call is keyed (a disengaged guard does nothing). Unkeyed digests + and Boost.Hash2's types by alias (`hmac`, the `hmac_*` aliases, + `siphash_32`, `siphash_64`) hold none, and the asynchronous family's + initiating functions hold none: the synchronous function they call holds it + on the thread that computes.** A digest's input is not a secret by its + contract, a guard per `update` would cost every checksum for no secret, and + the same algorithm is also Boost.Hash2's type by alias, which hash cannot + guard (design D2); a guard inside an alias would need a wrapper type in + place of Boost.Hash2's own (design D3), so the documentation names + `mac>` instead. A coverage test per backend + (`test/timing_coverage__test.cpp`) reads `doc/capabilities.json` + and fails when a keyed cell has no call, when a call's first guard is not + its own function's, or when an unkeyed function enters one: a new keyed + function or cell holds the guard and gets its call. The guard is a copy of + webcpp::crypto's (`include/webcpp/hash/detail/timing.hpp`; crypto depends on + hash, so hash cannot include crypto's), with the engaged flag added; a change + to either copy is made to both, and crypto's + `test/timing_hash_interop_test.cpp` runs the two nested in either order. Its + cost is measured from a release build by `bench/collect.py --timing` and + published in `doc/performance.adoc`. + Source: `libraries/hash/openspec/changes/data-independent-timing/design.md` + D1 to D9 (proposals); `include/webcpp/hash/detail/timing.hpp`, + `test/timing_coverage__test.cpp` (libs/hash); + `test/timing_hash_interop_test.cpp` (libs/crypto). - **Seven increments, each usable alone.** The first, built, is Hash2 by alias, `keccak_256`, `blake3`, HKDF, PBKDF2, Argon2id, scrypt, the default backend and the measured table; the second, built, is the families and libsodium's From a59acf50f7847aa4424e7b5c0fcb784044034e03 Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 09:13:18 -0300 Subject: [PATCH 03/13] tools/hash: the DIT section lists bcrypt_verify with the password hashes, not as keyed by its arguments, and names the built platforms; hash's collect.py tests cover --exe alone --- tools/hash/doc_tables.py | 41 ++++++++++++++----------- tools/test/hash_collect_test.py | 49 +++++++++++++++++++++++++----- tools/test/hash_doc_tables_test.py | 7 +++++ 3 files changed, 72 insertions(+), 25 deletions(-) diff --git a/tools/hash/doc_tables.py b/tools/hash/doc_tables.py index 2a4a54bb..1b5d4df6 100644 --- a/tools/hash/doc_tables.py +++ b/tools/hash/doc_tables.py @@ -97,16 +97,17 @@ # How a call names a row of each kind: a tag through its family's template, a function by its # name. CALLED_AS = {'mac': 'mac<{}>', 'kdf': 'argon2<{}>', 'digest': 'digest_of<{}>'} +# The functions a keyed row's cell also holds, which the table lists under that row: bcrypt's +# verification, always keyed, listed after bcrypt. +ALSO_KEYED = {'bcrypt': 'bcrypt_verify'} # The keyed calls of a row the keyed chapters do not hold, each with the row it is a call of: the -# keyed modes of a digest (design D1, engaged by the arguments, D4) and bcrypt's verification, -# which the table lists under bcrypt. +# keyed modes of a digest (design D1), keyed by their arguments (D4). KEYED_CALLS = ( ('digests::blake2b', '`digest_of` and `hasher` (`make`, ' '`update`, `finish`) when the options carry a key'), ('blake3', 'the `blake3` class in its keyed, key-derivation and seeded keyed modes (a ' 'non-empty byte seed, a non-zero integer seed: BLAKE3\'s keyed hash): `keyed`, `derive_key`, ' 'those constructors, and `update`, `result`, `squeeze` and `reset` of such an object'), - ('bcrypt', '`bcrypt_verify`'), ) APPLE_DIT = ('https://developer.apple.com/documentation/xcode/' 'writing-arm64-code-for-apple-platforms' @@ -677,8 +678,9 @@ def llms_txt(data: Data) -> str: 'are what a domain library builds from these functions; the guide shows them as ' 'examples, never as this library\'s API.', '', 'Timing: every MAC, key derivation and password hash, and BLAKE2b\'s and BLAKE3\'s ' - 'keyed modes, set 64-bit ARM\'s DIT (data-independent timing) around each call where ' - 'the CPU has it, on every backend, and leave the thread\'s DIT as they found it; ' + 'keyed modes, set DIT (data-independent timing) around each call on 64-bit ARM under ' + 'Apple\'s systems and Linux where the CPU has FEAT_DIT, on every synchronous backend, ' + 'and leave the thread\'s DIT as they found it; ' 'unkeyed digests and Boost.Hash2\'s hmac by alias do not, so an HMAC with DIT is ' f'mac>. [Section]({page}#hash-backends-dit)', '', f'- [The guide]({page}): every chapter, example and table', @@ -736,6 +738,8 @@ def keyed_rows(data: Data) -> tuple[dict[str, list[str]], list[str]]: else: called = CALLED_AS.get(function['kind'], '{}').format(function['name']) keyed.setdefault(algorithm['chapter'], []).append(called) + if function['name'] in ALSO_KEYED: + keyed[algorithm['chapter']].append(ALSO_KEYED[function['name']]) return keyed, aliases @@ -748,19 +752,20 @@ def dit_section(data: Data) -> list[str]: '64-bit ARM\'s DIT (data-independent timing) bit, PSTATE.DIT, makes the instructions Arm ' 'lists take a time independent of their data, and Apple requires it of constant-time code ' f'({link("Apple, enable DIT for constant-time cryptographic operations", APPLE_DIT)}). ' - 'None of the libraries hash calls sets it, so hash does: every function that computes on ' - 'a key, a password or a key derivation\'s secret input runs its whole body inside ' - '`detail::timing_guard`, on every backend, which on 64-bit ARM under macOS, iOS, Linux ' - 'and Android, where the CPU has FEAT_DIT (`hw.optional.arm.FEAT_DIT` on Apple\'s systems, ' - '`HWCAP_DIT` on Linux), sets DIT for the call and returns with the thread\'s DIT as it ' - 'found it: clear when it was clear, set when the program set it itself (Apple\'s ' - '`timingsafe_enable_if_supported`) or an outer call did. An error and an exception leave ' - 'it as found too, and DIT is a thread\'s own state, so a call never changes another ' - 'thread\'s. A program does nothing. Elsewhere the guard executes no instruction: on x86 ' - 'the counterpart, DOITM, is a register only the kernel writes; on WebAssembly the engine ' - 'decides; on Windows on ARM64 no documented way to ask whether the CPU has FEAT_DIT was ' - 'found, and DIT\'s instructions trap on a CPU without it.', '', - 'The functions that set DIT, on every backend of their cells:', ''] + 'None of the libraries hash calls sets it, so hash does: every function that computes ' + 'on a key, a password or a key derivation\'s secret input runs its whole body inside ' + '`detail::timing_guard`, on every synchronous backend, which on 64-bit ARM under ' + 'macOS, iOS, Linux and Android, where the CPU has FEAT_DIT (`hw.optional.arm.FEAT_DIT` ' + 'on Apple\'s systems, `HWCAP_DIT` on Linux), sets DIT for the call and returns with ' + 'the thread\'s DIT as it found it: clear when it was clear, set when the program set ' + 'it itself (Apple\'s `timingsafe_enable_if_supported`) or an outer call did. An error ' + 'and an exception leave it as found too, and DIT is a thread\'s own state, so a call ' + 'never changes another thread\'s. A program does nothing. Elsewhere the guard executes ' + 'no instruction: on x86 the counterpart, DOITM, is a register only the kernel writes; ' + 'on WebAssembly the engine decides; on Windows on ARM64 no documented way to ask ' + 'whether the CPU has FEAT_DIT was found, and DIT\'s instructions trap on a CPU without ' + 'it.', '', + 'The functions that set DIT, on every synchronous backend of their cells:', ''] for chapter, names in keyed.items(): lines.append(f'* {KEYED_CHAPTERS[chapter]}: {listed([f"`{name}`" for name in names])}.') calls = [text for row, text in KEYED_CALLS if row in data.functions] diff --git a/tools/test/hash_collect_test.py b/tools/test/hash_collect_test.py index d8372a96..59eadaa9 100644 --- a/tools/test/hash_collect_test.py +++ b/tools/test/hash_collect_test.py @@ -10,13 +10,14 @@ directory, b2's bench///..., names another variant, or does not say, is refused before anything runs or is written, the guard's `--timing` program as the throughput's; one at variant=release is taken (it gets as far as running); `--timing` alone stores the guard's cost -beside the data's throughput, which it keeps, with UTC's date, and the page renders it; -`--provisional` marks the guard's figures and the page says so, a measurement without it clears -the mark, and it is refused without `--timing`; `--timing` without data, a timing line that is not -the form collect.py reads and a "timing_guard" that is not the form it writes are refused with a -message, not a traceback, before anything is written; and `--render-only` refuses data whose -build, or whose guard's build, is not variant=release, before it writes the page, and renders the -committed data as the committed page. Run with the names of some cases to run only those.""" +beside the data's throughput, which it keeps, with UTC's date, and the page renders it; `--exe` +alone keeps the data's guard, and replaces data it cannot keep, saying so, with UTC's date; +`--provisional` marks the guard's figures and the page says so, a measurement without it clears the +mark, and it is refused without `--timing`; `--timing` without data, a timing line that is not the +form collect.py reads and a "timing_guard" that is not the form it writes are refused with a +message, not a traceback, before anything is written; and `--render-only` refuses data whose build, +or whose guard's build, is not variant=release, before it writes the page, and renders the committed +data as the committed page. Run with the names of some cases to run only those.""" from __future__ import annotations @@ -142,6 +143,39 @@ def test_the_guard_is_measured_kept_beside_the_throughput_and_rendered(scratch: raise AssertionError('the guard is not rendered after the throughput') +def throughput_program(scratch: Path) -> Path: + """A stand-in of bench/pbkdf2_sha512 at variant=release with one variant, hash2, whose key is + right.""" + line = json.dumps({'key_correct': True, 'median_ms': 900.0, 'runs_ms': [899.0, 901.0], + 'compiler': 'clang', 'iterations': 1000000}) + return program(scratch, 'release', 'if [ "$1" = --list ]; then echo hash2; ' + f"else echo '{line}'; fi\n") + + +def test_the_throughput_alone_keeps_the_guard_or_replaces_bad_data(scratch: Path) -> None: + data, page = scratch / 'data.json', scratch / 'page.adoc' + committed = json.loads(DATA.read_text()) + data.write_text(json.dumps(committed)) + exe = throughput_program(scratch) + utc = {datetime.datetime.now(datetime.timezone.utc).date().isoformat()} + expect(run('--exe', f'native={exe}', '--invocations', '1', '--data', data, '--page', page), 0) + written = json.loads(data.read_text()) + if written['timing_guard'] != committed['timing_guard']: + raise AssertionError("a measurement of the throughput alone did not keep the guard") + utc.add(datetime.datetime.now(datetime.timezone.utc).date().isoformat()) + if written['date'] not in utc or [c['median_ms'] for c in written['cases']] != [900.0]: + raise AssertionError(f'the throughput was not stored as measured, with UTC\'s date: ' + f'{written["date"]}, {written["cases"]}') + # Data it cannot keep, of another build or not JSON, is replaced, and the message says so. + for bad in (json.dumps({**committed, 'build': 'variant=debug'}), 'not json'): + data.write_text(bad) + done = run('--exe', f'native={exe}', '--invocations', '1', '--data', data, '--page', + page) + expect(done, 0, 'the guard is not kept') + if 'timing_guard' in json.loads(data.read_text()) or 'Traceback' in done.stderr: + raise AssertionError(f'bad data was not replaced cleanly:\n{done.stderr}') + + def test_provisional_marks_the_guard_and_a_measurement_without_it_clears_it( scratch: Path) -> None: data, page = scratch / 'data.json', scratch / 'page.adoc' @@ -240,6 +274,7 @@ def test_render_only_refuses_data_not_built_at_variant_release(scratch: Path) -> test_a_program_not_built_at_variant_release_is_refused, test_a_program_built_at_variant_release_is_measured, test_a_timing_program_not_built_at_variant_release_is_refused, + test_the_throughput_alone_keeps_the_guard_or_replaces_bad_data, test_the_guard_is_measured_kept_beside_the_throughput_and_rendered, test_provisional_marks_the_guard_and_a_measurement_without_it_clears_it, test_timing_alone_without_data_is_refused_with_a_message, diff --git a/tools/test/hash_doc_tables_test.py b/tools/test/hash_doc_tables_test.py index af331731..3e9e0294 100644 --- a/tools/test/hash_doc_tables_test.py +++ b/tools/test/hash_doc_tables_test.py @@ -526,6 +526,13 @@ def test_the_dit_section_follows_the_table(scratch: Path) -> None: '`blake2b_subkey`', '`x963kdf`', '`argon2`', '`bcrypt_pbkdf`', '`digest_of`', 'the `blake3` class', '`bcrypt_verify`'): expect(named in sets, f'{named} is not among the functions that set DIT:\n{sets}') + # bcrypt_verify always holds an engaged guard: it is a password function, never one keyed by + # its arguments, whose unkeyed calls hold a disengaged guard. + password = next(line for line in sets.splitlines() if line.startswith('* Password hashing:')) + by_arguments = next(line for line in sets.splitlines() + if line.startswith('* Keyed by their arguments:')) + expect('`bcrypt`, `bcrypt_verify`' in password, f'bcrypt_verify is not after bcrypt:\n{sets}') + expect('bcrypt_verify' not in by_arguments, f'bcrypt_verify is said disengaged:\n{sets}') for named in ('`hmac_sha2_256`', '`siphash_64`', '`hmac`,'): expect(named in rest and named not in sets, f'{named} is not among the aliases:\n{rest}') expect('`mac>`' in rest, 'the aliases do not name the guarded call') From 606d636f158e5cc8e7216c0b03ba1996f3a69a66 Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 09:39:59 -0300 Subject: [PATCH 04/13] tools/hash: the DIT section names mac for the SipHash aliases, the coverage tests' pass from DIT set and timing_during --- tools/hash/doc_tables.py | 10 +++++++--- tools/test/hash_doc_tables_test.py | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/hash/doc_tables.py b/tools/hash/doc_tables.py index 1b5d4df6..c41618aa 100644 --- a/tools/hash/doc_tables.py +++ b/tools/hash/doc_tables.py @@ -787,8 +787,9 @@ def dit_section(data: Data) -> list[str]: '* Boost.Hash2\'s types by alias, ' + listed([f'`{name}`' for name in aliases]) + ': they are Boost.Hash2\'s own classes, and a guard inside them would need a type of ' 'hash\'s in place of the alias. An HMAC with DIT is `mac>`, which runs ' - 'the same Boost.Hash2 code on `backends::hash2` inside its guard; a program that ' - 'calls `hmac` directly sets DIT itself. HKDF and PBKDF2 on `backends::hash2` run ' + 'the same Boost.Hash2 code on `backends::hash2` inside its guard, and a SipHash with ' + 'DIT is `mac`; a program that calls `hmac` or `siphash_64` ' + 'directly sets DIT itself. HKDF and PBKDF2 on `backends::hash2` run ' 'Boost.Hash2\'s `hmac` inside their own guard.') lines += [ '* The initiating functions of `async.hpp`: they check sizes and post, and the ' @@ -799,7 +800,10 @@ def dit_section(data: Data) -> list[str]: 'A coverage test per backend (`test/timing_coverage__test.cpp`) reads this ' 'table and fails when a keyed cell of its backend has no call, when a call enters no ' 'guard, when the first guard it enters is not its own function\'s, or when it leaves DIT ' - 'otherwise than it found it; it checks that the unkeyed functions enter none. The guard ' + 'otherwise than it found it, from a thread with DIT clear and from one that set it; it ' + 'checks that the unkeyed functions enter none. `test/timing_during_test.cpp` reads DIT ' + 'while HKDF, PBKDF2 and `mac` compute, through a hash that records it at each update, ' + 'on the calling thread and on an `async_pbkdf2` pool\'s. The guard ' 'is hash\'s own copy of ' 'webcpp::crypto\'s, which depends on hash: a change to one is a change to the other, and ' 'crypto\'s test `timing_hash_interop_test` runs both nested, in either order.', ''] diff --git a/tools/test/hash_doc_tables_test.py b/tools/test/hash_doc_tables_test.py index 3e9e0294..46ab5f1f 100644 --- a/tools/test/hash_doc_tables_test.py +++ b/tools/test/hash_doc_tables_test.py @@ -536,6 +536,7 @@ def test_the_dit_section_follows_the_table(scratch: Path) -> None: for named in ('`hmac_sha2_256`', '`siphash_64`', '`hmac`,'): expect(named in rest and named not in sets, f'{named} is not among the aliases:\n{rest}') expect('`mac>`' in rest, 'the aliases do not name the guarded call') + expect('`mac`' in rest, 'the SipHash aliases do not name the guarded call') expect('<>' not in section, 'the cost named without its chapter') expect('#hash-backends-dit)' in files['llms.txt'], 'llms.txt does not point to the section') # A row the table gains in a keyed chapter is said: a function among those that set DIT, a From 3c235020dd3202e94824504140426fbc85c5801b Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 09:45:52 -0300 Subject: [PATCH 05/13] libs/hash, libs/crypto: hash's keyed functions set arm64's DIT around each call, and crypto's test proves the two guards nest (gitlinks e519946, 243c765) --- libs/crypto | 2 +- libs/hash | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/crypto b/libs/crypto index e8c07402..243c7657 160000 --- a/libs/crypto +++ b/libs/crypto @@ -1 +1 @@ -Subproject commit e8c07402626921badcc3e0133576caaa478870d1 +Subproject commit 243c7657a17d863d48a41df09fa479ef507da636 diff --git a/libs/hash b/libs/hash index 24f2d63a..e519946a 160000 --- a/libs/hash +++ b/libs/hash @@ -1 +1 @@ -Subproject commit 24f2d63a5c0473e5360cb5fcc524f1f2e7d39d28 +Subproject commit e519946a3c2bff778a6d2e506212a0e2707ccbfe From afc9ac88af69c4bf50611d3a8a0c2a09d835100b Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 10:31:25 -0300 Subject: [PATCH 06/13] libs/hash, libs/crypto: the timing tests pass clang-tidy and the Jam comment width (gitlinks af15c40, 30a9681) --- libs/crypto | 2 +- libs/hash | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/crypto b/libs/crypto index 243c7657..30a96816 160000 --- a/libs/crypto +++ b/libs/crypto @@ -1 +1 @@ -Subproject commit 243c7657a17d863d48a41df09fa479ef507da636 +Subproject commit 30a968161062b5109b8f7c3f960797af8373b972 diff --git a/libs/hash b/libs/hash index e519946a..af15c408 160000 --- a/libs/hash +++ b/libs/hash @@ -1 +1 @@ -Subproject commit e519946a3c2bff778a6d2e506212a0e2707ccbfe +Subproject commit af15c408888e55990a1fcc61b38551c4a11e8508 From cab03be271ec73f95802e3c5383a108e54f99add Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 11:23:24 -0300 Subject: [PATCH 07/13] libs/crypto: the interop test compiles on MSVC, its seed no global that ed25519.hpp's parameter hides (gitlink a200e69) --- libs/crypto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/crypto b/libs/crypto index 30a96816..a200e69c 160000 --- a/libs/crypto +++ b/libs/crypto @@ -1 +1 @@ -Subproject commit 30a968161062b5109b8f7c3f960797af8373b972 +Subproject commit a200e69c2a0494cdf99758f9d1e12403fdacac22 From 5ddb55abab331e5f3acb762ac8469585c9b4e6a8 Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 12:28:51 -0300 Subject: [PATCH 08/13] libs/hash: the timing tests compile on MSVC, no file-scope name hidden by a library parameter (gitlink 051336d) --- libs/hash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hash b/libs/hash index af15c408..051336d2 160000 --- a/libs/hash +++ b/libs/hash @@ -1 +1 @@ -Subproject commit af15c408888e55990a1fcc61b38551c4a11e8508 +Subproject commit 051336d26e8529ab6b00bfa33371268c06d5c27d From d8167da09d6f9a88c798c552cf7ec1909dcf4c0a Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 14:05:29 -0300 Subject: [PATCH 09/13] libs/hash: async_heavy_test's cancellation race is deterministic (gitlink 8c10341) --- libs/hash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hash b/libs/hash index 051336d2..8c10341a 160000 --- a/libs/hash +++ b/libs/hash @@ -1 +1 @@ -Subproject commit 051336d26e8529ab6b00bfa33371268c06d5c27d +Subproject commit 8c10341a3548c7ef211a127dc356fa926262e2c9 From 13fda85fde85797b5ce9cdb8c3c54bccd8469557 Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 14:14:33 -0300 Subject: [PATCH 10/13] libs/hash: the timing tests pass readability-trailing-comma (gitlink 8f6b7cc) --- libs/hash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hash b/libs/hash index 8c10341a..8f6b7cc0 160000 --- a/libs/hash +++ b/libs/hash @@ -1 +1 @@ -Subproject commit 8c10341a3548c7ef211a127dc356fa926262e2c9 +Subproject commit 8f6b7cc016fda7417f301016b1b0f32cbbc07a30 From 9d1eeff8ad8cae4f327a40fcb05b82c8bec46790 Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 14:59:23 -0300 Subject: [PATCH 11/13] libs/hash: the timing tests' byte arrays pass readability-trailing-comma (gitlink b386ca7) --- libs/hash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hash b/libs/hash index 8f6b7cc0..b386ca75 160000 --- a/libs/hash +++ b/libs/hash @@ -1 +1 @@ -Subproject commit 8f6b7cc016fda7417f301016b1b0f32cbbc07a30 +Subproject commit b386ca75f2f16f7cdcd9212b7a5f9145d810dcd5 From 8f2b1aee534b5191b111dc7191c75b6989e7fcc5 Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 16:00:44 -0300 Subject: [PATCH 12/13] libs/hash: a reference that includes hash reads only the backends its build links (gitlink 58b4512) --- libs/hash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hash b/libs/hash index b386ca75..58b4512c 160000 --- a/libs/hash +++ b/libs/hash @@ -1 +1 @@ -Subproject commit b386ca75f2f16f7cdcd9212b7a5f9145d810dcd5 +Subproject commit 58b4512cbe680f68d156a5776f41b7f87af4c82f From 45ac9d474b17aacd751272d2c0a8aefe3c3129e5 Mon Sep 17 00:00:00 2001 From: R Date: Sun, 22 Nov 2026 16:02:54 -0300 Subject: [PATCH 13/13] libs/hash, libs/crypto: the gitlinks at the merges of hash's data-independent timing and crypto's interop test (3af42a2, 185c1e0) --- libs/crypto | 2 +- libs/hash | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/crypto b/libs/crypto index 2a898757..185c1e04 160000 --- a/libs/crypto +++ b/libs/crypto @@ -1 +1 @@ -Subproject commit 2a89875734c78a1a4cc005387df52c9244198195 +Subproject commit 185c1e049be95acbcef29cbac0c1d19989659ffe diff --git a/libs/hash b/libs/hash index 58b4512c..3af42a2a 160000 --- a/libs/hash +++ b/libs/hash @@ -1 +1 @@ -Subproject commit 58b4512cbe680f68d156a5776f41b7f87af4c82f +Subproject commit 3af42a2a9abb617524d7c38e0c53beaa46ff3b66