CryptOpt: Verified Compilation with Randomized Program Search for Cryptographic Primitives

Author:

Kuepper Joel1ORCID,Erbsen Andres2ORCID,Gross Jason2ORCID,Conoly Owen2ORCID,Sun Chuyue3ORCID,Tian Samuel2ORCID,Wu David1ORCID,Chlipala Adam2ORCID,Chuengsatiansup Chitchanok4ORCID,Genkin Daniel5ORCID,Wagner Markus6ORCID,Yarom Yuval7ORCID

Affiliation:

1. University of Adelaide, Australia

2. Massachusetts Institute of Technology, USA

3. Stanford University, USA

4. University of Melbourne, Australia

5. Georgia Institute of Technology, USA

6. Monash University, Australia

7. Ruhr University Bochum, Germany

Abstract

Most software domains rely on compilers to translate high-level code to multiple different machine languages, with performance not too much worse than what developers would have the patience to write directly in assembly language. However, cryptography has been an exception, where many performance-critical routines have been written directly in assembly (sometimes through metaprogramming layers). Some past work has shown how to do formal verification of that assembly, and other work has shown how to generate C code automatically along with formal proof, but with consequent performance penalties vs. the best- known assembly. We present CryptOpt, the first compilation pipeline that specializes high-level cryptographic functional programs into assembly code significantly faster than what GCC or Clang produce, with mechanized proof (in Coq) whose final theorem statement mentions little beyond the input functional program and the operational semantics of x86-64 assembly. On the optimization side, we apply randomized search through the space of assembly programs, with repeated automatic benchmarking on target CPUs. On the formal-verification side, we connect to the Fiat Cryptography framework (which translates functional programs into C-like IR code) and extend it with a new formally verified program-equivalence checker, incorporating a modest subset of known features of SMT solvers and symbolic-execution engines. The overall prototype is quite practical, e.g. producing new fastest-known implementations of finite-field arithmetic for both Curve25519 (part of the TLS standard) and the Bitcoin elliptic curve secp256k1 for the Intel 12𝑡ℎ and 13𝑡ℎ generations.

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference81 articles.

1. Alfred V. Aho , Ravi Sethi , and Jeffrey D . Ullman . 1986 . Compilers : Principles, Techniques, and Tools. Addison-Wesley . Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. 1986. Compilers: Principles, Techniques, and Tools. Addison-Wesley.

2. José Bacelar Almeida Manuel Barbosa Gilles Barthe François Dupressoir and Michael Emmi. 2016. Verifying Constant-Time Implementations. In USENIX Security. 53–70. https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/almeida José Bacelar Almeida Manuel Barbosa Gilles Barthe François Dupressoir and Michael Emmi. 2016. Verifying Constant-Time Implementations. In USENIX Security. 53–70. https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/almeida

3. Michaël Armand Germain Faure Benjamin Grégoire Chantal Keller Laurent Théry and Benjamin Werner. 2011. A Modular Integration of SAT/SMT Solvers to Coq through Proof Witnesses. In CPP. 135–150. Michaël Armand Germain Faure Benjamin Grégoire Chantal Keller Laurent Théry and Benjamin Werner. 2011. A Modular Integration of SAT/SMT Solvers to Coq through Proof Witnesses. In CPP. 135–150.

4. 2011. Theory of Randomized Search Heuristics: Foundations and Recent Developments Anne Auger and Benjamin Doerr (Eds.) (Series on Theoretical Computer Science Vol. 1). World Scientific. 2011. Theory of Randomized Search Heuristics: Foundations and Recent Developments Anne Auger and Benjamin Doerr (Eds.) (Series on Theoretical Computer Science Vol. 1). World Scientific.

5. Reza Azarderakhsh , Matthew Campagna , Craig Costello , Luca De Feo , Basil Hess, Amir Jalali, Brian Koziel, Brian LaMacchia, Patrick Longa, Michael Naehrig, Geovandro Pereira, Joost Renes, Vladimir Soukharev, and David Urbanik. 2019 . Supersingular Isogeny Key Encapsulation – Submission to the NIST Post-Quantum Standardization Project , round 2. https://sike.org Reza Azarderakhsh, Matthew Campagna, Craig Costello, Luca De Feo, Basil Hess, Amir Jalali, Brian Koziel, Brian LaMacchia, Patrick Longa, Michael Naehrig, Geovandro Pereira, Joost Renes, Vladimir Soukharev, and David Urbanik. 2019. Supersingular Isogeny Key Encapsulation – Submission to the NIST Post-Quantum Standardization Project, round 2. https://sike.org

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3