Dataset Viewer
Auto-converted to Parquet Duplicate
task_name
stringlengths
11
23
flag_x86_64
stringclasses
2 values
flag_aarch64_linux
stringclasses
2 values
flag_riscv
stringclasses
2 values
x86_64
stringlengths
9.22k
80.9k
aarch64_linux
stringlengths
10.8k
82.2k
riscv
stringlengths
8.02k
48.6k
test_c
stringlengths
438
1.17k
binsec_output_x86_64
stringlengths
1.19k
1.41k
binsec_output_aarch64_linux
stringlengths
1.19k
1.4k
binsec_output_riscv
stringlengths
1.19k
1.41k
ct_hacl_cmp_bytes
secure
secure
secure
"\t.text\n\t.intel_syntax noprefix\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/M(...TRUNCATED)
"\t.text\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/MBZUAI_Resources/Test_C_Cod(...TRUNCATED)
"\t.text\n\t.attribute\t4, 16\n\t.attribute\t5, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifence(...TRUNCATED)
"/*\n * Harness for ct_hacl_cmp_bytes/code.c (cmp_bytes.c upstream).\n *\n * Both 200-byte buffers a(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
ct_hacl_rotate32_left
secure
secure
secure
"\t.text\n\t.intel_syntax noprefix\n\t.file\t\"code.c\"\n\t.globl\trotate32_left #(...TRUNCATED)
"\t.text\n\t.file\t\"code.c\"\n\t.globl\trotate32_left // -- Begin function rotate(...TRUNCATED)
"\t.text\n\t.attribute\t4, 16\n\t.attribute\t5, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifence(...TRUNCATED)
"/*\n * Harness for ct_hacl_rotate32_left/code.c (upstream wrapper of the same name).\n *\n * Both t(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
ct_hacl_rotate32_right
secure
secure
secure
"\t.text\n\t.intel_syntax noprefix\n\t.file\t\"code.c\"\n\t.globl\trotate32_right #(...TRUNCATED)
"\t.text\n\t.file\t\"code.c\"\n\t.globl\trotate32_right // -- Begin function rotate(...TRUNCATED)
"\t.text\n\t.attribute\t4, 16\n\t.attribute\t5, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifence(...TRUNCATED)
"/*\n * Harness for ct_hacl_rotate32_right/code.c (upstream wrapper of the same name).\n *\n * Both (...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
ct_hacl_uint16_eq_mask
secure
secure
secure
"\t.text\n\t.intel_syntax noprefix\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/M(...TRUNCATED)
"\t.text\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/MBZUAI_Resources/Test_C_Cod(...TRUNCATED)
"\t.text\n\t.attribute\t4, 16\n\t.attribute\t5, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifence(...TRUNCATED)
"/*\n * Harness for ct_hacl_uint16_eq_mask/code.c (upstream wrapper of the same name).\n *\n * Both (...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
ct_hacl_uint16_gte_mask
secure
secure
secure
"\t.text\n\t.intel_syntax noprefix\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/M(...TRUNCATED)
"\t.text\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/MBZUAI_Resources/Test_C_Cod(...TRUNCATED)
"\t.text\n\t.attribute\t4, 16\n\t.attribute\t5, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifence(...TRUNCATED)
"/*\n * Harness for ct_hacl_uint16_gte_mask/code.c (upstream wrapper of the same name).\n *\n * Both(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
ct_hacl_uint32_eq_mask
secure
secure
secure
"\t.text\n\t.intel_syntax noprefix\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/M(...TRUNCATED)
"\t.text\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/MBZUAI_Resources/Test_C_Cod(...TRUNCATED)
"\t.text\n\t.attribute\t4, 16\n\t.attribute\t5, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifence(...TRUNCATED)
"/*\n * Harness for ct_hacl_uint32_eq_mask/code.c (uint32_eq_mask.c upstream).\n *\n * Both operands(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
ct_hacl_uint32_gte_mask
secure
secure
secure
"\t.text\n\t.intel_syntax noprefix\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/M(...TRUNCATED)
"\t.text\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/MBZUAI_Resources/Test_C_Cod(...TRUNCATED)
"\t.text\n\t.attribute\t4, 16\n\t.attribute\t5, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifence(...TRUNCATED)
"/*\n * Harness for ct_hacl_uint32_gte_mask/code.c (upstream wrapper of the same name).\n *\n * Both(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
ct_hacl_uint64_eq_mask
secure
secure
secure
"\t.text\n\t.intel_syntax noprefix\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/M(...TRUNCATED)
"\t.text\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/MBZUAI_Resources/Test_C_Cod(...TRUNCATED)
"\t.text\n\t.attribute\t4, 16\n\t.attribute\t5, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifence(...TRUNCATED)
"/*\n * Harness for ct_hacl_uint64_eq_mask/code.c (upstream wrapper of the same name).\n *\n * Both (...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
ct_hacl_uint64_gte_mask
secure
secure
secure
"\t.text\n\t.intel_syntax noprefix\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/M(...TRUNCATED)
"\t.text\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/MBZUAI_Resources/Test_C_Cod(...TRUNCATED)
"\t.text\n\t.attribute\t4, 16\n\t.attribute\t5, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifence(...TRUNCATED)
"/*\n * Harness for ct_hacl_uint64_gte_mask/code.c (upstream wrapper of the same name).\n *\n * Both(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
ct_hacl_uint8_eq_mask
secure
secure
secure
"\t.text\n\t.intel_syntax noprefix\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/M(...TRUNCATED)
"\t.text\n\t.file\t\"code.c\"\n\t.file\t0 \"/mnt/c/Users/lehai/Downloads/MBZUAI_Resources/Test_C_Cod(...TRUNCATED)
"\t.text\n\t.attribute\t4, 16\n\t.attribute\t5, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifence(...TRUNCATED)
"/*\n * Harness for ct_hacl_uint8_eq_mask/code.c (upstream wrapper of the same name).\n *\n * Both o(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
"[sse:info] Empty path worklist: halting ...\n[sse:info] SMT queries\n Preprocessing sim(...TRUNCATED)
End of preview. Expand in Data Studio

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

Column Description
task_name Sample identifier, e.g. ct_select_1
flag_x86_64 BinSec constant-time verdict for the x86-64 -O2 build: secure, insecure, or unknown
flag_aarch64_linux Same, for the AArch64 -O2 build
flag_riscv Same, for the RISC-V -O2 build
x86_64 x86-64 assembly at -O2 (Intel syntax, built with -masm=intel)
aarch64_linux AArch64 assembly at -O2
riscv RISC-V RV64 (rv64gc/lp64d) assembly at -O2
test_c C source of the BinSec harness (test.c) -- tags inputs secret/public through the high_input_N / low_input_N markers and calls the function under analysis
binsec_output_x86_64 Full binsec -checkct log for the x86-64 -O2 build -- the evidence flag_x86_64 was parsed from, including the leaking instruction addresses
binsec_output_aarch64_linux Same, for the AArch64 -O2 build
binsec_output_riscv Same, for the RISC-V -O2 build

Statistics

  • Total records: 36
column secure insecure unknown
flag_x86_64 31 5 0
flag_aarch64_linux 34 2 0
flag_riscv 29 7 0

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_bin

libsym.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 secret
  • insecure -- at least one secret-dependent branch or address was found
  • unknown -- 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_riscv

Citation

Part of the CISC-to-RISC transpilation research project at MBZUAI.

Downloads last month
66