《Breaking Bad:编译器如何破坏恒定时间实现》
Breaking Bad: How Compilers Break Constant-Time Implementations
AI总结:
本文研究编译器优化如何破坏密码学库的高级恒定时间实现,并通过跨架构动态分析44,604个目标,首次在真实主流加固库中发现编译器引发的秘密依赖操作。
摘要:
大多数经过加固的密码学库的实现都采用防御性编程技术来抵抗侧信道攻击。这些技术通常以指南形式提供给开发者,说明应使用或避免的特定代码模式。例如,通过执行算术运算在两个变量之间进行选择,而不是执行依赖于秘密的分支。然而,这些技术只有在编译过程中得以保持时才有意义。本文研究现代编译器使用的优化如何破坏防御性编程技术所引入的保护,具体而言,即编译器如何破坏用于缓解计时侧信道攻击的高级恒定时间实现。我们开展了一项大规模实验,以考察此类由编译器引发的问题是否出现在最先进的密码学库中。我们开发了一款几乎可以对任何架构进行性能分析的工具,并利用它对44,604个不同目标运行基于轨迹的动态分析。我们尤其关注部署最广泛、旨在提供侧信道抵抗能力的密码学库。由此,我们能够评估它们的声明在多种CPU架构上是否成立,包括x86-64、x86-i386、armv7、aarch64、RISC-V和MIPS-32。大规模研究表明,在一些最受推崇的加固密码学库中,存在若干由编译器引发的依赖秘密的操作。据我们所知,这些发现首次证明此类问题在真实环境中被观察到。本文的关键结论之一是:当前用于侧信道抵抗的最先进防御性编程技术仍然不充分、不完整,并且在与编译器不断引入的优化配合时注定会失效。
英文摘要:
The implementations of most hardened cryptographic libraries use defensive programming techniques for side-channel resistance. These techniques are usually specified as guidelines to developers on specific code patterns to use or avoid. Examples include performing arithmetic operations to choose between two variables instead of executing a secret-dependent branch. However, such techniques are only meaningful if they persist across compilation. In this paper, we investigate how optimizations used by modern compilers break the protections introduced by defensive programming techniques. Specifically, how compilers break high-level constant-time implementations used to mitigate timing side-channel attacks. We run a large-scale experiment to see if such compiler-induced issues manifest in state-of-the-art cryptographic libraries. We develop a tool that can profile virtually any architecture, and we use it to run trace-based dynamic analysis on 44,604 different targets. Particularly, we focus on the most widely deployed cryptographic libraries, which aim to provide side-channel resistance. We are able to evaluate whether their claims hold across various CPU architectures, including x86-64, x86-i386, armv7, aarch64, RISC-V, and MIPS-32. Our large-scale study reveals that several compiler-induced secret-dependent operations occur within some of the most highly regarded hardened cryptographic libraries. To the best of our knowledge, such findings represent the first time these issues have been observed in the wild. One of the key takeaways of this paper is that the state-of-the-art defensive programming techniques employed for side-channel resistance are still inadequate, incomplete, and bound to fail when paired with the optimizations that compilers continuously introduce.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。