Formal Verification of a Constant-Time Preserving C Compiler

被引:38
|
作者
Barthe, Gilles [1 ,2 ]
Blazy, Sandrine [3 ]
Gregoire, Benjamin [4 ]
Hutin, Remi [3 ]
Laporte, Vincent [4 ]
Pichardie, David [3 ]
Trieu, Alix [5 ]
机构
[1] MPI Secur & Privacy, Bochum, Germany
[2] IMDEA Software Inst, Madrid, Spain
[3] Univ Rennes, IRISA, CNRS, INRIA, Rennes, France
[4] INRIA, Sophia Antipolis, France
[5] Aarhus Univ, Aarhus, Denmark
基金
欧洲研究理事会;
关键词
verified compilation; CompCert compiler; timing side-channels; COMPILATION;
D O I
10.1145/3371075
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Timing side-channels are arguably one of the main sources of vulnerabilities in cryptographic implementations. One effective mitigation against timing side-channels is to write programs that do not perform secret-dependent branches and memory accesses. This mitigation, known as "cryptographic constant-time", is adopted by several popular cryptographic libraries. This paper focuses on compilation of cryptographic constant-time programs, and more specifically on the following question: is the code generated by a realistic compiler for a constant-time source program itself provably constant-time? Surprisingly, we answer the question positively for a mildly modified version of the CompCert compiler, a formally verified and moderately optimizing compiler for C. Concretely, we modify the CompCert compiler to eliminate sources of potential leakage. Then, we instrument the operational semantics of CompCert intermediate languages so as to be able to capture cryptographic constant-time. Finally, we prove that the modified CompCert compiler preserves constant-time. Our mechanization maximizes reuse of the CompCert correctness proof, through the use of new proof techniques for proving preservation of constant-time. These techniques achieve complementary trade-offs between generality and tractability of proof effort, and are of independent interest.
引用
下载
收藏
页数:30
相关论文
共 50 条
  • [1] Solver-Aided Constant-Time Hardware Verification
    Gleissenthall, Klaus, V
    Kici, Rami Gokhan
    Stefan, Deian
    Jhala, Ranjit
    CCS '21: PROCEEDINGS OF THE 2021 ACM SIGSAC CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY, 2021, : 429 - 444
  • [2] Formal verification of a C compiler front-end
    Blazy, Sandrine
    Dargaye, Zaynah
    Leroy, Xavier
    FM 2006: FORMAL METHODS, PROCEEDINGS, 2006, 4085 : 460 - 475
  • [3] Formal verification of an optimizing compiler
    Leroy, Xavier
    TERM REWRITING AND APPLICATIONS, PROCEEDINGS, 2007, 4533 : 1 - 1
  • [4] Formal verification of an optimizing compiler
    Leroy, Xavier
    MEMOCODE'07: FIFTH ACM & IEEE INTERNATIONAL CONFERENCE ON FORMAL METHODS AND MODELS FOR CO-DESIGN, PROCEEDINGS, 2007, : 25 - 25
  • [5] Formal Verification of a Realistic Compiler
    Leroy, Xavier
    COMMUNICATIONS OF THE ACM, 2009, 52 (07) : 107 - 115
  • [6] Constant-time sorting
    Brand, Michael
    INFORMATION AND COMPUTATION, 2014, 237 : 142 - 150
  • [7] Applying formal verification with protocol compiler
    Stangier, C
    Holtmann, U
    EUROMICRO SYMPOSIUM ON DIGITAL SYSTEMS DESIGN, PROCEEDINGS, 2001, : 165 - 169
  • [8] A Framework for Formal Verification of Compiler Optimizations
    Mansky, William
    Gunter, Elsa
    INTERACTIVE THEOREM PROVING, PROCEEDINGS, 2010, 6172 : 371 - 386
  • [9] Formal verification of compiler transformations for speculative real-time execution
    Younis, MF
    Tsai, G
    Marlowe, TJ
    Stoyen, AD
    AUTOMATICA, 1998, 34 (08) : 939 - 952
  • [10] Scalable RFID Systems: A Privacy-Preserving Protocol with Constant-Time Identification
    Alomair, Basel
    Clark, Andrew
    Cuellar, Jorge
    Poovendran, Radha
    IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, 2012, 23 (08) : 1536 - 1550