Akirayasha/relbench_O2
RelBench-O2: Constant-Time Assembly at -O2 Overview This dataset collects the rel_bench constant-time programs, re-cut into one self-contained program per record, compiled with LLVM/Clang-17 at -O2 for three targets, and checked for constant-timeness with binsec -sse -checkct. Constant-time source code is not enough: the optimizer can reintroduce a secret-dependent branch or memory access that the -O0 build does not have, and it does so differently per target. The… See the full description on the dataset page: https://huggingface.co/datasets/Akirayasha/relbench_O2.
RelBench-O2: Constant-Time Assembly at -O2
Overview
This dataset collects the rel_bench constant-time programs, re-cut into one self-contained program per record, compiled with LLVM/Clang-17 at -O2 for three targets, and checked for constant-timeness with binsec -sse -checkct.
Constant-time source code is not enough: the optimizer can reintroduce a secret-dependent branch or memory access that the -O0 build does not have, and it does so differently per target. The intended tasks are transpilation (translate the assembly to another ISA) and classification/repair (decide whether a build leaks, and fix it if it does).
Dataset Structure
Statistics
- Total records: 36
The constant-time oracle
Each build is analysed by BinSec's checkct plugin:
binsec -sse -checkct -sse-script "libsym.ini,checkct.cfg" -sse-depth 50000 test_binlibsym.ini replaces the high_input_N markers with secret and the low_input_N markers with nondet (public), so BinSec knows which bytes are secret. It then reports:
secure-- no control flow or memory access depends on a secretinsecure-- at least one secret-dependent branch or address was foundunknown-- BinSec could not decide (path cut, depth limit, unresolved symbol)
The verdict is per build. The same program can be secure on one target and insecure on another, because the three backends make different branch/cmov/csel choices at -O2. That is why the verdict is not collapsed into one label: each target carries its own flag_* column, with the full analysis log in the matching binsec_output_* column -- that log names the control-flow and memory-access checks that failed and at which addresses, so an insecure verdict can be traced back to a specific instruction.
Usage
from datasets import load_dataset
ds = load_dataset("Akirayasha/relbench_O2", split="test")
record = ds[0]
src_asm = record["x86_64"] # source-side assembly
tgt_asm = record["riscv"] # reference target-side assembly
leaky = record["flag_riscv"] == "insecure" # per-target verdict
harness = record["test_c"] # rebuild + recheck a candidate against BinSec
why = record["binsec_output_riscv"] # the BinSec log behind flag_riscvCitation
Part of the CISC-to-RISC transpilation research project at MBZUAI.
