Skip to main content
QUICK REVIEW

[论文解读] The Last Mile: High-Assurance and High-Speed Cryptographic Implementations

Almeida, José Bacelar, Manuel Barbosa|arXiv (Cornell University)|Apr 9, 2019
Security and Verification in Computing参考文献 38被引用 41
一句话总结

本文提出了一种新颖的框架,结合Jasmin与EasyCrypt,生成高保障、高效率的汇编语言加密实现,通过“游戏跳跃”验证实现功能正确性与侧信道攻击防护。作者实现了形式化验证的向量化ChaCha20-Poly1305实现,其性能优于最快的非验证版本,证明了形式化验证无需以性能为代价。

ABSTRACT

We develop a new approach for building cryptographic implementations. Our approach goes the last mile and delivers assembly code that is provably functionally correct, protected against side-channels, and as efficient as hand-written assembly. We illustrate ur approach using ChaCha20-Poly1305, one of the mandatory ciphersuites in TLS 1.3, and deliver formally verified vectorized implementations which outperform the fastest non-verified code. We realize our approach by combining the Jasmin framework, which offers in a single language features of high-level and low-level programming, and the EasyCrypt proof assistant, which offers a versatile verification infrastructure that supports proofs of functional correctness and equivalence checking. Neither of these tools had been used for functional correctness before. Taken together, these infrastructures empower programmers to develop efficient and verified implementations by "game hopping", starting from reference implementations that are proved functionally correct against a specification, and gradually introducing program optimizations that are proved correct by equivalence checking. We also make several contributions of independent interest, including a new and extensible verified compiler for Jasmin, with a richer memory model and support for vectorized instructions, and a new embedding of Jasmin in EasyCrypt.

研究动机与目标

  • 通过在汇编级别支持形式化验证,弥合高保障加密实现与高性能手工优化代码之间的差距。
  • 通过在单一工作流中整合优化与验证,克服先前方法在效率、信任度或开发者采纳性方面的局限。
  • 使密码工程人员能够使用基于功能正确性与等价性证明的实用、渐进式方法,开发优化的、形式化验证的实现。
  • 提供一个经验证的、可扩展的Jasmin编译器,支持向量指令与更丰富的内存模型,确保汇编代码生成的可预测性与正确性。
  • 在EasyCrypt中建立Jasmin的新嵌入,以支持自动化证明功能等价性与常量时间安全性。

提出的方法

  • 使用Jasmin语言编写可读的参考实现,结合高级与低级编程特性,支持‘心中汇编’的开发方式。
  • 应用‘游戏跳跃’技术,逐步将参考实现优化为向量化、平台特定的版本,同时证明每步转换均保持功能正确性。
  • 利用EasyCrypt的关联程序逻辑,形式化验证参考实现与优化实现之间的功能等价性。
  • 引入Jasmin在EasyCrypt中的新嵌入,支持功能正确性与常量时间安全性的证明,包括控制流与内存访问对秘密数据的独立性。
  • 在Coq中验证Jasmin编译器,确保从Jasmin到汇编的转换正确,并保留所有保证。
  • 在验证过程中使用静态分析与简化语义以确保安全性,最终在密码学常量时间模型下证明常量时间行为。

实验结果

研究问题

  • RQ1能否设计一种形式化验证框架,支持高保障与高性能的加密实现,而无需牺牲效率?
  • RQ2‘游戏跳跃’技术能否有效从密码学证明适配到加密实现中低级代码优化的验证?
  • RQ3能否在保持形式化保证的功能正确性与侧信道防护的前提下,实现与手工优化的非验证汇编代码相当或更优的性能?
  • RQ4如何将形式化验证的高保障语言Jasmin的编译器扩展,以支持向量指令与复杂内存模型?
  • RQ5能否在EasyCrypt中构建统一的证明基础设施,以支持低级加密代码的功能正确性与常量时间安全性证明?

主要发现

  • 作者交付了使用Jasmin实现的、经形式化验证的向量化ChaCha20与Poly1305,其性能优于最快的非验证汇编实现,包括OpenSSL与HACL*中的实现。
  • 经AVX2优化的验证版ChaCha20实现,对大消息的性能达到每字节低于1.5个周期,超越使用CompCert编译的HACL*与非验证的OpenSSL代码。
  • 使用AVX2指令的验证版Poly1305实现,对大消息的性能达到每字节低于1.2个周期,显著优于非验证与已验证的替代方案。
  • 该框架支持对优化代码的功能正确性与常量时间行为的验证,参考版本与优化版本之间的等价性证明通过通用引理进行分解。
  • 新扩展的Jasmin编译器支持向量指令与更丰富的内存模型,且在Coq中形式化验证,确保从源码到汇编的正确性。
  • Jasmin在EasyCrypt中的嵌入支持功能等价性与常量时间安全性的自动化证明,使性能关键代码的可扩展验证成为可能。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。