Paper 2021/797

LLVM-based Circuit Compilation for Practical Secure Computation

Tim Heldmann, Thomas Schneider, Oleksandr Tkachenko, Christian Weinert, and Hossein Yalame


Multi-party computation (MPC) allows two or more parties to jointly and securely compute functions over private inputs. Cryptographic protocols that realize MPC require functions to be expressed as Boolean or arithmetic circuits. Deriving such circuits is either done manually, or with hardware synthesis tools and specialized MPC compilers. Unfortunately, such existing tools compile only from a single front-end language and neglect decades of research for optimizing regular compilers. In this paper, we make MPC practical for developers by automating circuit compilation based on the compiler toolchain LLVM. For this, we develop an LLVM optimizer suite consisting of multiple transform passes that operate on the LLVM intermediate representation (IR) and gradually lower functions to circuit level. Our approach supports various front-end languages (currently C, C++, and Fortran) and takes advantage of powerful source code optimizations built into LLVM. We furthermore make sure to produce circuits that are optimized for MPC, and even offer fully automated post-processing for efficient post-quantum MPC. We empirically measure the quality of our compilation results and compare them to the state-of-the-art specialized MPC compiler HyCC (Büscher et al., CCS'2018). For all benchmarked HyCC example applications (e.g., biomatch and linear equation solving), our highly generalizable approach achieves similar quality in terms of gate count and composition.

Available format(s)
Cryptographic protocols
Publication info
Published elsewhere. Minor revision. ACNS 2021
MPCCircuit CompilationLLVMHardware Synthesis
Contact author(s)
schneider @ encrypto cs tu-darmstadt de
tkachenko @ encrypto cs tu-darmstadt de
weinert @ encrypto cs tu-darmstadt de
yalame @ encrypto cs tu-darmstadt de
2021-06-14: received
Short URL
Creative Commons Attribution


      author = {Tim Heldmann and Thomas Schneider and Oleksandr Tkachenko and Christian Weinert and Hossein Yalame},
      title = {LLVM-based Circuit Compilation for Practical Secure Computation},
      howpublished = {Cryptology ePrint Archive, Paper 2021/797},
      year = {2021},
      doi = {10.1007/978-3-030-78375-4_5},
      note = {\url{}},
      url = {}
Note: In order to protect the privacy of readers, does not use cookies or embedded third party content.