arXiv:2608.00965cs.CRcs.AI2026-08

AI自动生成加密库的可验证证明,提升代码可靠性

An AI Approach to Verified Production Cryptographic Libraries

  • 用AI从API契约自动推导内部规格与验证证明
  • 11.4小时完成curve25519-dalek独立验证,成本466.99美元
  • 适合安全敏感系统开发者,如信号、Shadowsocks等

加密代码是关键基础设施,必须确保正确性,但对生产级库的正式验证仍具挑战。现有语言模型证明系统仅能处理已知前提下的孤立证明义务,无法解决生产库验证问题。我们提出CryptoProver,一个基于AI的系统,能够从高层API契约中合成内部规格与Verus验证的证明,无需修改可执行代码。该系统成功为curve25519-dalek构建了独立验证,并在符合RFC 8439规范的前提下验证了RustCrypto未验证的chacha20实现。这些加密算法支撑着包括Signal和Shadowsocks在内的部署系统,其中Signal全球下载量估计达2.18亿次。独立的curve25519-dalek验证由五名主要贡献者历时八个月公开完成。给定API契约及一组可信基础库(含域规格、算术事实、公理和vstd),CryptoProver在11.4小时内完成规格与证明生成,记录的API费用为466.99美元。系统遵循信任优先原则:机械门控阻止规格弱化、虚构公理及跨模块破坏;隔离机制阻断引用证明检索,包括git历史。

原文摘要 · Abstract (English)

Cryptographic code is critical infrastructure that must be correct, yet formally verifying production libraries remains difficult. Existing language-model proof systems solve isolated obligations with specifications and premises already given, leaving production-library verification unresolved. We present CryptoProver, an AI-based system that synthesizes internal specifications and Verus-checked proofs from high-level API contracts. Without changing executable code, CryptoProver constructs a new independent proof of curve25519-dalek and verifies RustCrypto's previously unverified chacha20 implementation against an RFC 8439 specification. These cryptographic lineages underpin deployed systems including Signal and Shadowsocks; Signal has an estimated 218M global downloads. The independent, human-led curve25519-dalek verification was developed publicly over eight months by five main contributors. Given the API contracts and a fixed trusted library of field specifications, arithmetic facts, axioms, and vstd, CryptoProver synthesizes the internal specifications and proofs in 11.4 hours with USD 466.99 in recorded API cost. CryptoProver follows a trust-first design principle: mechanical gates reject specification weakening, invented axioms, and cross-module breakage, while isolation blocks reference proof retrieval, including from git history.

加密验证AI辅助证明形式化验证

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。