ChatPaper.aiChatPaper

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

摘要

本文提出了一種新穎的方法,用於在全同態加密(Fully Homomorphic Encryption, FHE)框架內計算萊文斯坦(編輯)距離,特別針對如TFHE等第三代方案。編輯距離計算在金融和基因組學等領域的應用中至關重要,例如DNA序列比對。我們引入了一種名為Leuvenshtein的優化算法,該算法顯著降低了編輯距離計算的成本。該算法特別減少了每個計算單元所需的可編程自舉(Programmable Bootstraps, 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.
PDF12August 21, 2025