Formal Verification of a Constant-Time Preserving C Compiler

被引:42
作者
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
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2020年 / 4卷
基金
欧洲研究理事会;
关键词
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
相关论文
共 59 条
[1]  
Abate Carmine, 2018, COMPUTER SECURITY FD
[2]   Lucky Microseconds: A Timing Attack on Amazon's s2n Implementation of TLS [J].
Albrecht, Martin R. ;
Paterson, Kenneth G. .
ADVANCES IN CRYPTOLOGY - EUROCRYPT 2016, PT I, 2016, 9665 :622-643
[3]   Lucky Thirteen: Breaking the TLS and DTLS Record Protocols [J].
AlFardan, Nadhem J. ;
Paterson, Kenneth G. .
2013 IEEE SYMPOSIUM ON SECURITY AND PRIVACY (SP), 2013, :526-540
[4]   Jasmin: High-Assurance and High-Speed Cryptography [J].
Almeida, Jose Bacelar ;
Barbosa, Manuel ;
Barthe, Gilles ;
Blot, Arthur ;
Gregoire, Benjamin ;
Laporte, Vincent ;
Oliveira, Tiago ;
Pacheco, Hugo ;
Schmidt, Benedikt ;
Strub, Pierre-Yves .
CCS'17: PROCEEDINGS OF THE 2017 ACM SIGSAC CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY, 2017, :1807-1823
[5]  
Almeida JB, 2016, PROCEEDINGS OF THE 25TH USENIX SECURITY SYMPOSIUM, P53
[6]  
Almeida Jose Bacelar, 2019, ABS190404606 CORR
[7]   Towards Verified, Constant-time Floating Point Operations [J].
Andrysco, Marc ;
Notzli, Andres ;
Brown, Fraser ;
Jhala, Ranjit ;
Stefan, Deian .
PROCEEDINGS OF THE 2018 ACM SIGSAC CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY (CCS'18), 2018, :1369-1382
[8]   On Subnormal Floating Point and Abnormal Timing [J].
Andrysco, Marc ;
Kohlbrenner, David ;
Mowery, Keaton ;
Jhala, Ranjit ;
Lerner, Sorin ;
Shacham, Hovav .
2015 IEEE SYMPOSIUM ON SECURITY AND PRIVACY SP 2015, 2015, :623-639
[9]  
[Anonymous], 1994, INT WORKSH FAST SOFT
[10]  
APPEL A, 2011, PROGRAMMING LANGUAGE, DOI DOI 10.1007/978-3-642-19718-5_1