arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.04290cs.CRcs.AR
收藏

Cassandra:高效强制执行加密程序的顺序执行(扩展版)

Cassandra: Efficient Enforcement of Sequential Execution for Cryptographic Programs (Extended Version)

Ali Hajiabadi, Trevor E. Carlson

AI总结:

针对现代处理器控制流误推测破坏恒时加密程序安全性的问题,提出软硬件协同机制Cassandra,通过禁用分支预测、压缩重放控制流,在保障安全的同时实现平均1.85%的性能提升。

摘要:

恒时编程是一种广泛应用的强化加密程序抵御侧信道攻击能力的方法。然而,现代处理器通常会瞬时执行程序的非预期路径,从而违反标准恒时策略的底层假设。尽管已有诸多解决方案被提出,但如何在不损失性能的前提下高效解决控制流误推测问题仍是一个开放难题。\n在本研究中,我们提出了Cassandra——一种新型软硬件协同机制,能够以极高的效率为恒时加密代码强制执行顺序执行。Cassandra采用了禁用分支预测器并记录-重放程序顺序控制流的激进设计思路。支撑我们设计的两个关键洞见是:(1)恒时程序的顺序控制流在不同运行过程中大多是静态的;(2)加密程序是循环密集型的,其控制流模式以高度可压缩的方式重复。这些洞见使我们能够执行前置分支分析,从而显著压缩控制流轨迹。我们在典型处理器设计中新增了一个小型组件——分支轨迹单元(Branch Trace Unit),用于存储压缩后的轨迹,并根据程序的顺序模型确定取指重定向方向。尽管提供了强安全保障,但与不安全的基准处理器相比,Cassandra反而实现了平均1.85%的速度提升,这主要得益于其实现了近乎完美的取指重定向。

英文摘要:

Constant-time programming is a widely deployed approach to harden cryptographic programs against side channel attacks. However, modern processors often violate the underlying assumptions of standard constant-time policies by transiently executing unintended paths of the program. Despite many solutions proposed, addressing control flow misspeculations in an efficient way without losing performance is an open problem. In this work, we propose Cassandra, a novel hardware/software mechanism to enforce sequential execution for constant-time cryptographic code in a highly efficient manner. Cassandra explores the radical design point of disabling the branch predictor and recording-and-replaying sequential control flow of the program. Two key insights that enable our design are that (1) the sequential control flow of a constant-time program is mostly static over different runs, and (2) cryptographic programs are loop-intensive and their control flow patterns repeat in a highly compressible way. These insights allow us to perform an upfront branch analysis that significantly compresses control flow traces. We add a small component to a typical processor design, the Branch Trace Unit, to store compressed traces and determine fetch redirections according to the sequential model of the program. Despite providing a strong security guarantee, Cassandra counterintuitively provides an average 1.85% speedup compared to an unsafe baseline processor, mainly due to enforcing near-perfect fetch redirections.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑