| --- |
| license: cc-by-4.0 |
| task_categories: |
| - text-classification |
| - graph-ml |
| language: |
| - en |
| tags: |
| - hardware |
| - verilog |
| - constant-time |
| - side-channel |
| - formal-verification |
| - security |
| - explainability |
| - reasoning-traces |
| - dependency-graph |
| pretty_name: "hw-verify-paths: witness paths for constant-time RTL" |
| size_categories: |
| - n<1K |
| configs: |
| - config_name: witness_paths |
| data_files: |
| - split: test |
| path: data/witness_paths.jsonl |
| default: true |
| --- |
| |
| # hw-verify-paths |
|
|
| [](https://creativecommons.org/licenses/by/4.0/) |
| [](data/witness_paths.jsonl) |
| [](https://github.com/nickharris808/ctbench) |
|
|
| > **▶ [Try the checker in your browser](https://huggingface.co/spaces/nickh007/hw-verify)** · [**Docs & overview**](https://huggingface.co/spaces/nickh007/hw-verify-site) |
|
|
| **Dependency graphs and witness paths for constant-time RTL analysis — the reasoning, |
| not just the label.** |
|
|
| The [companion dataset](https://huggingface.co/datasets/nickh007/hw-verify) records |
| *what* each design is: `CONSTANT_TIME` or `LEAKY`. This one records *why*. For every |
| fixture it carries the full signal dependency graph, and for every leaky one the |
| concrete chains of signals that carry a secret to the observation. |
|
|
| ## Why witness paths and not just verdicts |
|
|
| A verdict is a label. It is enough to measure a classifier and not enough to build |
| one that can be trusted, because the underlying analysis is a **syntactic |
| over-approximation**: it follows every dependency edge whether or not that path can |
| be taken at run time. Some `LEAKY` verdicts are therefore paths that never execute. |
|
|
| A user staring at a bare verdict has no way to tell a real finding from a false one, |
| and learns to distrust the tool. A user given `key → key_r → cmp_eq → running → done` |
| can look at four signal names and decide. So the path is not decoration — it is what |
| makes an over-approximate analysis usable by someone entitled to disagree with it. |
|
|
| That makes this a different artefact for a different purpose: **reasoning traces** |
| for training or evaluating models that must explain a hardware-security finding |
| rather than merely emit one. |
|
|
| ## Install |
|
|
| ```bash |
| pip install datasets |
| ``` |
|
|
| ## Quickstart |
|
|
| ```python |
| from datasets import load_dataset |
| import json |
| |
| ds = load_dataset("nickh007/hw-verify-paths", split="test") |
| |
| leaky = [r for r in ds if r["verdict"] == "LEAKY"] |
| r = leaky[0] |
| print(r["file"], "->", r["reaching_secrets"]) |
| |
| for p in json.loads(r["paths"]): |
| print(f" {p['secret']}: {' -> '.join(p['signals'])} ({p['length']} edges)") |
| ``` |
|
|
| `graph` and `paths` are JSON strings, because Arrow has no good column type for a |
| ragged adjacency map. `json.loads` them. |
|
|
| ## Worked example — what a record actually looks like |
|
|
| ```console |
| $ python -c " |
| from datasets import load_dataset; import json |
| ds = load_dataset('nickh007/hw-verify-paths', split='test') |
| r = [x for x in ds if x['verdict'] == 'LEAKY'][0] |
| print(r['file'], '->', r['reaching_secrets']) |
| for p in json.loads(r['paths'])[:1]: |
| print(' ', ' -> '.join(p['signals']), f\"({p['length']} edges)\")" |
| barrett_leaky.v -> ['a'] |
| a -> acc -> done (2 edges) |
| ``` |
|
|
| That is the whole point of this dataset: `barrett_leaky.v` is not merely labelled |
| `LEAKY`, it carries the chain — the secret `a` reaches `acc`, which reaches the |
| completion signal `done`. |
|
|
| ## Fields |
|
|
| | Field | Meaning | |
| |---|---| |
| | `file` | fixture name | |
| | `source` | the full Verilog source | |
| | `scored` / `expected` | whether it is part of the scored benchmark, and its label | |
| | `observation` / `secrets` | the completion signal, and the declared secret inputs | |
| | `verdict` | `CONSTANT_TIME`, `LEAKY`, `UNKNOWN`, or null when unscored | |
| | `refusal_reason` | why no verdict was reached; null unless `verdict` is `UNKNOWN` | |
| | `graph` | JSON: signal → the signals it depends on (assignments **and** guards) | |
| | `n_signals` / `n_edges` | size of that graph | |
| | `reaching_secrets` | the secrets found in the observation's fan-in | |
| | `cone_size` | signals in the fan-in cone | |
| | `paths` | JSON list of `{secret, observation, signals, length}` | |
| | `n_paths` / `shortest_path_length` | path statistics | |
| | `explanation` | the rendered human-readable explanation | |
| | `license` | per record — four fixtures are ISC, the rest CC-BY-4.0 | |
|
|
| ## Honest scope |
|
|
| - **`UNKNOWN` records carry no graph.** Three fixtures use constructs the analysis |
| cannot read, so there is nothing to trace. Their `graph` is null and their |
| `refusal_reason` says which construct stopped it. Emitting an empty graph would |
| make an unreadable design look like one with no dependencies. |
| - **Paths are capped at 8 per secret.** The number of paths through a dependency |
| graph is exponential; `n_paths` is a bounded sample, shortest first, not a total. |
| - **A path is syntactic.** It shows a route the value *could* take, not one it |
| necessarily does. That is the whole reason it is worth reading. |
| - **Verdicts cover completion timing** against the declared secrets — not power, EM, |
| cache, or microarchitectural channels. |
|
|
| ## Reproducing it |
|
|
| Every record is computed from [`ctbench`](https://github.com/nickharris808/ctbench) |
| at build time: |
|
|
| ```bash |
| pip install git+https://github.com/nickharris808/ctbench@main |
| python build.py --check # fails if the committed data differs from a fresh build |
| ``` |
|
|
| The data cannot drift from the code that produced it, because the check is a test. |
|
|
| ## Licence |
|
|
| Records are **CC-BY-4.0**, except four fixtures derived from |
| [picorv32](https://github.com/YosysHQ/picorv32) by Claire Wolf, which remain **ISC**. |
| The `license` field is per record rather than flattened, because flattening it would |
| misstate the terms on those four. |
|
|
| ## Part of the hw-verify toolkit |
|
|
| - [Live demo](https://huggingface.co/spaces/nickh007/hw-verify) — the checker in your browser |
| - [hw-verify dataset](https://huggingface.co/datasets/nickh007/hw-verify) — verdicts, masking probes, patch certificates |
| - [`ctbench`](https://github.com/nickharris808/ctbench) · [`ct-mask`](https://github.com/nickharris808/ct-mask) · [`patchproof`](https://github.com/nickharris808/patchproof) · [`patchproof-verify`](https://github.com/nickharris808/patchproof-verify) |
|
|
| ## Citation |
|
|
| Every record here is generated by [`ctbench`](https://github.com/nickharris808/ctbench); |
| cite that, using the `CITATION.cff` in its repository (GitHub renders a "Cite this |
| repository" button from it). |
|
|
| ## Contributing |
|
|
| The most valuable contribution is a **design whose witness path is wrong** — a |
| reported chain that is not a real dependency. See |
| [ctbench's CONTRIBUTING](https://github.com/nickharris808/ctbench/blob/main/CONTRIBUTING.md). |
|
|
| <!-- portfolio:start --> |
| ## Part of the hw-verify toolkit |
|
|
| | Project | What it does | |
| |---|---| |
| | **▶ [Live demo](https://huggingface.co/spaces/nickh007/hw-verify)** | Constant-time checker in your browser | |
| | [**Docs & overview**](https://huggingface.co/spaces/nickh007/hw-verify-site) | What the toolkit proves, and what it refuses | |
| | [`ctbench`](https://github.com/nickharris808/ctbench) | The checker that generated every record here | |
| | [`hw-verify`](https://github.com/nickharris808/hw-verify) | One install, all three checkers | |
| | [hw-verify dataset](https://huggingface.co/datasets/nickh007/hw-verify) | The companion: verdicts rather than reasoning | |
|
|
| **The commercial boundary.** Everything open analyses a design disclosed in full. |
| Proving a property to a third party who never receives the design is a different |
| problem and a commercial one. |
| <!-- portfolio:end --> |
|
|