Leuvenshtein:基于全同态加密的高效编辑距离计算,实现单次引导每单元
Leuvenshtein: Efficient FHE-based Edit Distance Computation with Single Bootstrap per Cell
August 20, 2025
作者: Wouter Legiest, Jan-Pieter D'Anvers, Bojan Spasic, Nam-Luc Tran, Ingrid Verbauwhede
cs.AI
摘要
本文提出了一种在完全同态加密(FHE)框架下计算莱文斯坦(编辑)距离的新方法,特别针对第三代方案如TFHE。编辑距离计算在金融和基因组学等领域的应用中至关重要,例如DNA序列比对。我们引入了一种名为Leuvenshtein的优化算法,显著降低了编辑距离计算成本。该算法特别减少了每个计算单元所需的可编程自举(PBS)操作次数,从传统Wagner-Fisher算法所需的约94次操作降至仅1次。此外,我们提出了一种高效的字符相等性检查方法,将ASCII字符比较减少到仅需2次PBS操作。最后,我们探讨了在其中一个输入字符串未加密时,通过预处理进一步优化性能的潜力。我们的Leuvenshtein算法相比现有最佳TFHE实现提速高达278倍,比优化后的Wagner-Fisher算法快39倍。此外,当服务器端存在一个未加密输入,可进行离线预处理时,还能额外获得3倍的加速效果。
English
This paper presents a novel approach to calculating the Levenshtein (edit)
distance within the framework of Fully Homomorphic Encryption (FHE),
specifically targeting third-generation schemes like TFHE. Edit distance
computations are essential in applications across finance and genomics, such as
DNA sequence alignment. We introduce an optimised algorithm that significantly
reduces the cost of edit distance calculations called Leuvenshtein. This
algorithm specifically reduces the number of programmable bootstraps (PBS)
needed per cell of the calculation, lowering it from approximately 94
operations -- required by the conventional Wagner-Fisher algorithm -- to just
1. Additionally, we propose an efficient method for performing equality checks
on characters, reducing ASCII character comparisons to only 2 PBS operations.
Finally, we explore the potential for further performance improvements by
utilising preprocessing when one of the input strings is unencrypted. Our
Leuvenshtein achieves up to 278times faster performance compared to the best
available TFHE implementation and up to 39times faster than an optimised
implementation of the Wagner-Fisher algorithm. Moreover, when offline
preprocessing is possible due to the presence of one unencrypted input on the
server side, an additional 3times speedup can be achieved.