[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-84867-en":3,"doc-seo-84867-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":13,"seo_description":14,"update_tm":28,"read_time":29},84867,8796095461564,"Liam","https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d",8,"Research & Report","LibFHE: 一款基于 Numba 的 CUDA-Python 库，用于在 GPU 上实现非 RNS CKKS-BGV 全同态加密","A decade after the CKKS scheme’s proposal, no clear fifth-generation successor has emerged, while GPU acceleration research has expanded to improve homomorphic computation efficiency. This paper introduces LibFHE, a high-performance GPU-accelerated framework using CUDA-Python bindings to balance high-level programmability with near bare-metal execution. Rather than focusing on the dominant RNS-CKKS variant, it revisits the non-RNS CKKS-BGV framework and develops GPU implementations with targeted optimizations. Experiments show performance comparable to optimized CPU Non-RNS C++ libraries with lower implementation complexity.","LibFHE: A Numba-Based CUDA-Python Library for Non-RNS CKKS-BGV Fully Homomorphic Encryption on GPUs  \nJohn Chiang  \n[john.chiang.smith@gmail.com](john.chiang.smith@gmail.com)  \narXiv :2607 .05920v 3 [ cs .CR] 11 Jul 2026  \nAbstract  \nIt has been a decade since the fourth-generation FHE framework, CKKS, was proposed; yet, there is still no indicator pointing toward a fifth-generation successor; and in recent years, numerous studies have explored GPU acceleration to improve the efficiency of homomorphic computations. In this paper, we propose LibFHE, a high-performance GPU-accelerated framework that features CUDAPython bindings to achieve both high-level programmability and bare-metal GPU performance for homomorphic workloads. A large majority of state-of-the-art implementations adopt the RNS-CKKS variant. In contrast, this work deliberately revisits the original (nonRNS) CKKS-BGV framework, and develops a GPU-based implementation along with corresponding optimizations. Experimental results demonstrate that optimized CUDA-Python implementations can achieve performance comparable to highly optimized CPUbased Non-RNS C++ FHE libraries, while significantly reducing implementation complexity and improving programmability.  \nKeywords  \nFully Homomorphic Encryption, Double-CRT, GPU Execution Model, Number Theoretic Transformation, Residue Number System  \n1 Introduction  \n1.1 Background  \nThe widespread adoption of cloud services has triggered an exponential surge in sensitive user data collection, positioning Homomorphic Encryption (HE [4])—particularly Fully Homomorphic Encryption (FHE [14]) with bootstrapping (BTS)—as a critical paradigm for secure, private cloud computation. Among various FHE variants, the CKKS scheme [8] has emerged as the mainstream choice for privacy-preserving machine learning due to its highthroughput approximate arithmetic [3, 17] . However, FHE inherently suffers from severe computational overhead [22] . While prior works have extensively explored GPU acceleration to exploit FHE’s massive parallelism [11, 13, 21], shifting execution from CPUs to GPUs (e.g., accelerating ResNet-20 inference by 386× [11, 30]), substantial optimization headroom remains unexploited due to architectural mismatches.  \nThe primary performance bottleneck stems from the residue number system (RNS) word size. To satisfy stringent security bounds, mainstream FHE libraries [2, 6] predominantly rely on 64-bit primes for RNS decomposition. This design choice forces GPUs—which are natively optimized for 32-bit integer arithmetic—to inefficiently emulate 64-bit operations over 32-bit datapaths, incurring severe hardware performance penalties.  \nTo bridge this gap, recent studies have pioneered 32-bit RNS variants (e.g., via rational rescaling [7, 38]) to enable equivalent security under smaller primes. Nevertheless, existing solutions fail  \nto align seamlessly with GPU architectural characteristics. They either impose prohibitive memory footprints by introducing auxiliary public keys [38] or degrade SIMT parallel efficiency through severe control divergence [7], leaving efficient 32-bit RNS acceleration on GPUs an unresolved challenge.  \nHistorically, high-performance FHE acceleration libraries have been exclusively confined to C++ due to the necessity of low-level hardware control, which severely restricted developer productivity and ecosystem integration. This paradigm, however, has been fundamentally reshaped by recent breakthroughs in the GPU programming ecosystem. At GTC 2025, NVIDIA announced native Python support for the CUDA platform, elevating Python to a first-class citizen in high-performance computing. Rather than relying on fragile, high-overhead wrappers, this new ecosystem offers direct, pythonic access to the CUDA driver and runtime APIs, complete with built-in device primitives and advanced cooperative algorithms (e.g., [cuda.coop](cuda.coop)) tailored for Numba.  \nSeizing this technological shift, we present A Numba-Based","cbCairCyeMnaF5aG","https://ap.wps.com/l/cbCairCyeMnaF5aG","pdf",702313,2,1,16,"English","en",105,"# Introduction\n## Background\n## Related Work","[{\"question\":\"LibFHE 主要解决了什么问题？\",\"answer\":\"LibFHE 面向同态加密（尤其是 CKKS-BGV）在 GPU 上运行效率不足的问题，重点利用 CUDA-Python 与 Numba 机制在保持可编程性的同时实现高性能同态运算。\"},{\"question\":\"本文为什么强调“非 RNS”路线而不是主流 RNS-CKKS？\",\"answer\":\"主流 RNS-CKKS 依赖 64-bit 素数分解，使 GPU 需要在 32-bit 数据通路上模拟 64-bit 运算，带来明显硬件性能损失；本文则回到非 RNS CKKS-BGV 并通过对应优化提升匹配度。\"},{\"question\":\"实验结果表明 LibFHE 的性能达到什么水平？\",\"answer\":\"实验显示，经过优化的 CUDA-Python 实现可达到与高度优化的 CPU 端 Non-RNS C++ 同态库相当的性能，同时显著降低实现复杂度并提升可编程性。\"}]",1784198916,40,{"code":4,"msg":31,"data":32},"ok",{"site_id":25,"language":24,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"libfhe-a-numba-based-cuda-python-library-for-non-rns-ckks-bgv-fully-homomorphic-encryption-on-gpus","",{"@graph":36,"@context":85},[37,53,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,47,50],{"item":41,"name":42,"@type":43,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":20},"https://docshare.wps.com/document/","Document",{"item":48,"name":12,"@type":43,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":43,"position":52},"https://docshare.wps.com/document/libfhe-a-numba-based-cuda-python-library-for-non-rns-ckks-bgv-fully-homomorphic-encryption-on-gpus/84867/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":24,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-23","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"LibFHE 主要解决了什么问题？","Question",{"text":75,"@type":76},"LibFHE 面向同态加密（尤其是 CKKS-BGV）在 GPU 上运行效率不足的问题，重点利用 CUDA-Python 与 Numba 机制在保持可编程性的同时实现高性能同态运算。","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"本文为什么强调“非 RNS”路线而不是主流 RNS-CKKS？",{"text":80,"@type":76},"主流 RNS-CKKS 依赖 64-bit 素数分解，使 GPU 需要在 32-bit 数据通路上模拟 64-bit 运算，带来明显硬件性能损失；本文则回到非 RNS CKKS-BGV 并通过对应优化提升匹配度。",{"name":82,"@type":73,"acceptedAnswer":83},"实验结果表明 LibFHE 的性能达到什么水平？",{"text":84,"@type":76},"实验显示，经过优化的 CUDA-Python 实现可达到与高度优化的 CPU 端 Non-RNS C++ 同态库相当的性能，同时显著降低实现复杂度并提升可编程性。","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,119,122,127,130,134],{"id":21,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":20,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":29,"slug":118},7,"Healthcare","healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":120,"slug":121},30,"research-report",{"id":123,"doc_module":4,"doc_module_name":46,"category_name":124,"show_sort_weight":125,"slug":126},9,"Religion & Spirituality",20,"religion-spirituality",{"id":125,"doc_module":4,"doc_module_name":46,"category_name":128,"show_sort_weight":125,"slug":129},"World Cup","world-cup",{"id":131,"doc_module":4,"doc_module_name":46,"category_name":132,"show_sort_weight":131,"slug":133},10,"Lifestyle","lifestyle",{"id":135,"doc_module":4,"doc_module_name":46,"category_name":136,"show_sort_weight":106,"slug":137},19,"General","general"]