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

Gotta Hash 'Em All! 加速零知识证明应用中的哈希函数

Gotta Hash 'Em All! Speeding Up Hash Functions for Zero-Knowledge Proof Applications

Nojan Sheybani, Tengkai Gong, Anees Ahmed, Nges Brian Njungle, Michel Kinsy, Farinaz Koushanfar

AI总结:

针对零知识证明中哈希函数在CPU上效率低的问题,提出基于FPGA的硬件实现集合HashEmAll,针对三种ZK友好哈希提供优化,最高实现23倍加速并降低功耗,有效缓解大规模数据认证的哈希瓶颈。

摘要:

抗碰撞密码学哈希函数(CRHs)对安全性至关重要,特别是在零知识证明(ZKP)应用中的消息认证。然而,像 SHA-2 或 SHA-3 这样的传统 CRHs 虽然针对 CPU 进行了优化,却会生成大型电路,导致其在 ZK 领域效率低下。相反,ZK 友好型哈希专为电路效率设计,但在传统硬件上表现不佳,由于依赖昂贵的有限域算术,其速度通常比标准哈希慢几个数量级。为弥合这一性能差距,我们提出了 HashEmAll,这是一种针对三种著名 ZK 友好型哈希(Griffin、Rescue-Prime 和 Reinforced Concrete)的基于 FPGA 的新型实现集合。每种实现都提供独特的优化配置,同时提供面积优化和延迟优化变体,允许用户根据资源利用率和性能方面的特定应用限制来定制硬件选择。我们广泛的评估表明,延迟优化的 HashEmAll 设计比 CPU 实现至少快 10 倍,其中领先的设计实现了 23 倍的加速。这些增益伴随着更低的功耗以及与易获取的 FPGA 的兼容性。重要的是,HashEmAll 的高度并行和流水线架构通过缓解大型树的哈希瓶颈,在构建现实世界 ZKP 应用(如使用 Merkle Trees 的数据承诺)方面,实现了比基于 CPU 的方法显著更好的实际扩展性。这凸显了 HashEmAll 适用于涉及大规模数据认证的现实世界 ZKP 应用。我们还强调了将 HashEmAll 方法论转化为各种 ZK 友好型哈希函数和不同字段大小的能力。

英文摘要:

Collision-resistant cryptographic hash functions (CRHs) are crucial for security, particularly for message authentication in Zero-knowledge Proof (ZKP) applications. However, traditional CRHs like SHA-2 or SHA-3, while optimized for CPUs, generate large circuits, rendering them inefficient in the ZK domain. Conversely, ZK-friendly hashes are designed for circuit efficiency but struggle on conventional hardware, often orders of magnitude slower than standard hashes due to their reliance on expensive finite field arithmetic. To bridge this performance gap, we present HashEmAll, a novel collection of FPGA-based realizations for three prominent ZK-friendly hashes: Griffin, Rescue-Prime, and Reinforced Concrete. Each offers distinct optimization profiles, with both area-optimized and latency-optimized variants available, allowing users to tailor hardware selection to specific application constraints regarding resource utilization and performance. Our extensive evaluation shows that latency-optimized HashEmAll designs outperform CPU implementations by at least $10 \times$, with the leading design achieving a $23 \times$ speedup. These gains are coupled with lower power consumption and compatibility with accessible FPGAs. Importantly, the highly parallel and pipelined architecture of HashEmAll enables significantly better practical scaling than CPU-based approaches towards building real-world ZKP applications, such as data commitments with Merkle Trees, by mitigating the hashing bottleneck for large trees. This highlights the suitability of HashEmAll for real-world ZKP applications involving large-scale data authentication. We also highlight the ability to translate the HashEmAll methodology to various ZK-friendly hash functions and different field sizes.

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

↑