Crux:面向 Rust 及其他语言的精确验证器
Crux, a Precise Verifier for Rust and Other Languages
AI总结:
本文介绍跨语言验证工具 Crux,重点说明其 Rust 后端 Crux-MIR 如何通过位精确建模、符号单元测试与组合推理验证 SHA1、SHA2 等实现。
摘要:
我们提出 Crux,这是一种面向 Rust 和 C/LLVM 的跨语言验证工具。Crux 针对的是人类难以正确处理的有界且复杂的代码片段:例如加密模块以及序列化器/反序列化器对。Crux 构建于成熟的 SAW-Cryptol 工具链所使用的同一框架之上,但 Crux 提供了一种将证明表述为符号单元测试的接口。Crux 专为生产环境设计,并且已经在工业界得到使用。在本文中,我们重点介绍 Crux-MIR,即我们用于 Rust 的验证工具。Crux-MIR 提供了安全 Rust 与 unsafe Rust 的位精确模型,可用于检查关于 Rust 代码的内联性质,以及检查其与用 Cryptol 或 Rust 的 hacspec 方言编写的可执行规范之间的外延相等性。值得注意的是,Crux-MIR 支持组合推理,这对于扩展到即使是中等复杂度的证明也是必要的。我们通过依据既有功能规范验证 Ring 库中 SHA1 和 SHA2 的实现来展示 Crux-MIR。Crux 可在 https://crux.galois.com 获取。
英文摘要:
We present Crux, a cross-language verification tool for Rust and C/LLVM. Crux targets bounded, intricate pieces of code that are difficult for humans to get right: for example, cryptographic modules and serializer / deserializer pairs. Crux builds on the same framework as the mature SAW-Cryptol toolchain, but Crux provides an interface where proofs are phrased as symbolic unit tests. Crux is designed for use in production environments, and has already seen use in industry. In this paper, we focus on Crux-MIR, our verification tool for Rust. Crux-MIR provides a bit-precise model of safe and unsafe Rust which can be used to check both inline properties about Rust code, and extensional equality to executable specifications written in Cryptol or in the hacspec dialect of Rust. Notably, Crux-MIR supports compositional reasoning, which is necessary to scale to even moderately complex proofs. We demonstrate Crux-MIR by verifying the Ring library implementations of SHA1 and SHA2 against pre-existing functional specifications. Crux is available at https://crux.galois.com.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。