CBMC-GC: An ANSI C Compiler for Secure Two-Party Computations

  • Martin Franz
  • Andreas Holzer
  • Stefan Katzenbeisser
  • Christian Schallhart
  • Helmut Veith
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8409)


Secure two-party computation (STC) is a computer security paradigm where two parties can jointly evaluate a program with sensitive input data, provided in parts from both parties. By the security guarantees of STC, neither party can learn any information on the other party’s input while performing the STC task. For a long time thought to be impractical, until recently, STC has only been implemented with domain-specific languages or hand-crafted Boolean circuits for specific computations. Our open-source compiler CBMC-GC is the first ANSI C compiler for STC. It turns C programs into Boolean circuits that fit the requirements of garbled circuits, a generic STC approach based on circuits. Here, the size of the resulting circuits plays a crucial role since each STC step involves encryption and network transfer and is therefore extremely slow when compared to computations performed on modern hardware architectures. We report on newly implemented circuit optimization techniques that substantially reduce the circuit sizes compared to the original release of CBMC-GC.


Secure Computations Privacy Compilers Circuit Optimization 


  1. 1.
    Berkeley Logic Synthesis and Verification Group, ABC: A System for Sequential Synthesis and Verification, Release 30916,
  2. 2.
    Bogetoft, P., Damgård, I.B., Jakobsen, T., Nielsen, K., Pagter, J.I., Toft, T.: A Practical Implementation of Secure Auctions Based on Multiparty Integer Computation. In: Di Crescenzo, G., Rubin, A. (eds.) FC 2006. LNCS, vol. 4107, pp. 142–147. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  3. 3.
    Clarke, E., Kroning, D., Lerda, F.: A Tool for Checking ANSI-C Programs. In: Jensen, K., Podelski, A. (eds.) TACAS 2004. LNCS, vol. 2988, pp. 168–176. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  4. 4.
    Erkin, Z., Franz, M., Guajardo, J., Katzenbeisser, S., Lagendijk, I., Toft, T.: Privacy-Preserving Face Recognition. In: Goldberg, I., Atallah, M.J. (eds.) PETS 2009. LNCS, vol. 5672, pp. 235–253. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  5. 5.
    Goethals, B., Laur, S., Lipmaa, H., Mielikainen, T.: On secure scalar product computation for privacy-preserving data mining. In: ICISC 2004 (2004)Google Scholar
  6. 6.
    Holzer, A., Franz, M., Katzenbeisser, S., Veith, H.: Secure Two-Party Computations in ANSI C. In: CCS 2012 (2012)Google Scholar
  7. 7.
    Huang, Y., Evans, D., Katz, J., Malka, L.: Faster Secure Two-Party Computation Using Garbled Circuits. In: USENIX 2011 (2011)Google Scholar
  8. 8.
    Jagannathan, G., Wright, R.N.: Privacy-preserving distributed k-means clustering over arbitrarily partitioned data. In: KDD 2005 (2005)Google Scholar
  9. 9.
    Kolesnikov, V., Sadeghi, A.-R., Schneider, T.: Improved Garbled Circuit Building Blocks and Applications to Auctions and Computing Minima. In: Garay, J.A., Miyaji, A., Otsuka, A. (eds.) CANS 2009. LNCS, vol. 5888, pp. 1–20. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  10. 10.
    Kolesnikov, V., Schneider, T.: Improved Garbled Circuit: Free XOR Gates and Applications. In: Aceto, L., Damgård, I., Goldberg, L.A., Halldórsson, M.M., Ingólfsdóttir, A., Walukiewicz, I. (eds.) ICALP 2008, Part II. LNCS, vol. 5126, pp. 486–498. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  11. 11.
    Kuehlmann, A.: Dynamic transition relation simplification for bounded property checking. In: ICCAD 2004 (2004)Google Scholar
  12. 12.
    Lindell, Y., Pinkas, B.: A Proof of Security of Yao’s Protocol for Two-Party Computation. Journal of Cryptology 22, 161–188 (2009)CrossRefzbMATHMathSciNetGoogle Scholar
  13. 13.
    Malkhi, D., Nisan, N., Pinkas, B., Sella, Y.: Fairplay — A Secure Two-Party Computation System. In: SSYM 2004 (2004)Google Scholar
  14. 14.
    Mishchenko, A., Chatterjee, S., Brayton, R.: FRAIGs: A Unifying Representation for Logic Synthesis and Verification. Technical report (2005)Google Scholar
  15. 15.
    Pinkas, B., Schneider, T., Smart, N.P., Williams, S.C.: Secure Two-Party Computation Is Practical. In: Matsui, M. (ed.) ASIACRYPT 2009. LNCS, vol. 5912, pp. 250–267. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  16. 16.
    Rabin, M.O.: How To Exchange Secrets with Oblivious Transfer. IACR Cryptology ePrint Archive 2005, 187 (2005)Google Scholar
  17. 17.
    Smaragdis, P., Shashanka, M.V.S.: A framework for secure speech recognition. IEEE Transactions on Audio, Speech & Language Processing 15(4), 1404–1413 (2007)CrossRefGoogle Scholar
  18. 18.
    Yao, A.C.-C.: Protocols for Secure Computations (Extended Abstract). In: FOCS 1982 (1982)Google Scholar
  19. 19.
    Yao, A.C.-C.: How to Generate and Exchange Secrets. In: FOCS 1986 (1986)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2014

Authors and Affiliations

  • Martin Franz
    • 1
  • Andreas Holzer
    • 2
  • Stefan Katzenbeisser
    • 3
  • Christian Schallhart
    • 4
  • Helmut Veith
    • 2
  1. 1.Deutsche BankGermany
  2. 2.TU WienAustria
  3. 3.TU Darmstadt & CASEDGermany
  4. 4.Oxford UniversityUK

Personalised recommendations