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 条
  • [21] Constant-time thresholding on reconfigurable mesh
    Chung, KL
    REAL-TIME IMAGING, 1999, 5 (02) : 77 - 81
  • [22] PROPAGATION FUNCTION - CONSTANT-TIME ALGORITHMS
    SCHMITT, M
    JOURNAL OF MICROSCOPY-OXFORD, 1995, 178 : 272 - 281
  • [23] Constant-time multidimensional electrophoretic NMR
    Li, EC
    He, QH
    JOURNAL OF MAGNETIC RESONANCE, 2002, 156 (02) : 181 - 186
  • [24] Towards the formal verification of a C0 compiler: Code generation and implementation correctness
    Leinenbach, D
    Paul, W
    Petrova, E
    SEFM 2005: THIRD IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING AND FORMAL METHODS, PROCEEDINGS, 2005, : 2 - 11
  • [25] Constant-Time Local Computation Algorithms
    Mansour, Yishay
    Patt-Shamir, Boaz
    Vardi, Shai
    APPROXIMATION AND ONLINE ALGORITHMS, WAOA 2015, 2015, 9499 : 110 - 121
  • [26] Constant-Time Dynamic (Δ+1)-Coloring
    Henzinger, Monika
    Peng, Pan
    37TH INTERNATIONAL SYMPOSIUM ON THEORETICAL ASPECTS OF COMPUTER SCIENCE (STACS 2020), 2020, 154
  • [27] CONSTANT-TIME SORTING ON RECONFIGURABLE MESHES
    CHEN, YC
    CHEN, WT
    IEEE TRANSACTIONS ON COMPUTERS, 1994, 43 (06) : 749 - 751
  • [28] CONSTANT-TIME MAINTAINABILITY - A GENERALIZATION OF INDEPENDENCE
    WANG, KE
    GRAHAM, MH
    ACM TRANSACTIONS ON DATABASE SYSTEMS, 1992, 17 (02): : 201 - 246
  • [29] Constant-Time Algorithms for Sparsity Matroids
    Ito, Hiro
    Tanigawa, Shin-Ichi
    Yoshida, Yuichi
    AUTOMATA, LANGUAGES, AND PROGRAMMING, ICALP 2012 PT I, 2012, 7391 : 498 - 509
  • [30] Constant-Time Local Computation Algorithms
    Mansour, Yishay
    Patt-Shamir, Boaz
    Vardi, Shai
    THEORY OF COMPUTING SYSTEMS, 2018, 62 (02) : 249 - 267