arXiv:2610.39572cs.CROct 2026

Manuscript Offprint

arXiv:2610.39572

RV2GC: Reconstructing the Garbling Boundary in a RISC-V Garbled Processor

Zixiao Feng, Xiaolin Li, Chenglu Jin, Wei Yan, Yong Zhang, Hongwei Liu, Yong Liu, Qinfen Hao

Zixiao Feng1,2,3^{1,2,3}, Xiaolin Li1,2,3^{1,2,3}, Chenglu Jin4^{4}, Wei Yan1,2,3^{1,2,3}, Yong Zhang3^{3}, Hongwei Liu1,2^{1,2}, Yong Liu3^{3}, Qinfen Hao1,2,3^{1,2,3}

1^{1}Institute of Computing Technology, Chinese Academy of Sciences

2^{2}University of Chinese Academy of Sciences

3^{3}Zhongguancun Laboratory

4^{4}Centrum Wiskunde & Informatica

{fengzixiao24z,lixiaolin19s,yanwei,liuhongwei,haoqinfen}@ict.ac.cn

chenglu.jin@cwi.nl; {zhangyong,liuyong}@zgclab.edu.cn

Abstract—Programmable garbled-circuit execution must balance the benefits of cross-program reuse against the cost of repeated work during secure execution. A complete garbled processor provides a fixed circuit for many programs, but its evaluator repeatedly visits processor-wide structures even when only a small part performs the current protected computation. We present RV2GC, which reconstructs the garbling boundary around a fixed library of RISC-V instruction circuits. Public scheduling and operand routing operate outside the circuit topologies; persistent label-encoded state connects independently invoked garbled instruction circuits and instruction-specific garbling-free paths through a common interface. A Conditional-execution Stack and protected commits support secret-dependent branches, bounded loops, and secret-indexed memory access under public scheduling, keeping instruction and memory-address sequences independent of private inputs. Across nine benchmarks, measured ARM2GC-to-RV2GC runtime ratios range from 12.81 to 4,043. In terms of circuit size, the largest listed instruction circuit has 3,386 gates, corresponding to 2.044% and 0.393% of the 256-byte and 4,096-byte Amber processors, respectively. Additional comparisons quantify schedule storage, communication, and the cost of secret-dependent execution.

Index Terms—Garbled circuit, secure computation, garbled processor, RISC-V.

I. INTRODUCTION

Garbled circuits (GCs) enable two parties to compute over private inputs while revealing the designated outputs [20]. Programmable execution must choose which structures remain reusable across programs and which are specialized. Complete garbled processors retain a fixed processor circuit across programs [15], [16]. Function-specific circuits and program-specialized instruction structures instead encode more of the application into the secure execution artifact [3], [12], [18], [19]. These choices affect preparation cost and repeated execution work.

ARM2GC illustrates the cost of a complete-processor boundary. Its SkipGate algorithm avoids cryptographic processing for gates that can be resolved from public information, but identifying those gates still visits the processor netlist [16]. Our profile of nine benchmarks shows that evaluator work other than protected-gate processing accounts for 71.3–93.2% of ARM2GC's measured runtime, including netlist traversal and associated management. The observation motivates a structural question: can a programmable GC system keep a fixed cross-program circuit substrate while invoking only the computation needed for the current operation?

RV2GC answers this question by reconstructing the garbling boundary. Public instruction scheduling and operand routing are separated from the instruction computations that require garbled evaluation. Register and memory state are stored outside the individual circuit topologies, with secret values retained as wire labels. A fixed library of RISC-V instruction circuits supplies the protected operations. Program changes within the supported ISA change the public schedule and initialization data, while the library topologies remain unchanged.

During execution, RV2GC connects instruction circuits and garbling-free paths through persistent label-encoded state to form a continuous execution. It targets oblivious programs whose public execution traces are independent of private inputs. The Conditional-execution Stack and protected commits allow secret-dependent choices to affect state updates under this public schedule.

Our two-party software implementation is evaluated against ARM2GC, Wang [18], VISA [19], and function-specific circuits. We examine runtime, communication, stateful execution, and program storage. We also use BINSEC [1] to check that control flow and memory addresses in the final benchmark binaries are independent of private inputs; Section IV presents the methods and results.

We make three technical contributions:

• Garbling-boundary reconstruction. We rethink which components of programmable execution should reside within the repeatedly traversed garbled-circuit topology. RV2GC separates public instruction scheduling and operand routing from garbled computation, decouples label-encoded architectural state from individual circuit topologies, and implements instruction operations requiring garbled evaluation through a fixed library of RISC-V instruction circuits. This reconstruction preserves cross-program reuse of circuit topologies while limiting online circuit traversal to the circuitry required by the scheduled operation.

  • Stateful instruction composition with garbling-free execution. We design a persistent state interface that composes separately invoked instruction circuits and garbling-free execution paths into continuous RV32 execution. Public register and memory values are maintained explicitly, while protected values persist as wire labels under a common two-party label-state invariant. Both execution paths preserve this invariant, allowing intermediate results to pass between instructions without decoding protected values. For eligible instruction cases, public computation, label-domain manipulation, preparation-time resolution, or direct state movement realizes the primary instruction semantics without encrypted garbled tables.

  • Secret-dependent execution under public scheduling. We design a Conditional-execution Stack and protected commits that support secret-dependent branches, bounded loops, and secret-indexed memory access under a public instruction and address schedule. The stack maintains effective protected predicates across nested conditional regions; commits use these predicates to select candidate state updates or preserve prior values. This interface carries secret-dependent choices through protected state while the public schedule remains independent of private inputs.

References (23)