Efficient Mod Approximation and Its Applications to CKKS Ciphertexts
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.
Tom: Next we'll be talking about the paper "Efficient Mod Approximation and Its Applications to CKKS Ciphertexts".
Jane: The paper was written by Yufei Zhou from Sun Yat-sen University, Guangzhou Higher Education Mega Center, Panyu District, Guangzhou, Guangdong, China and Sun Yat-sen University.
Tom: Stay tuned as we take you through the paper and discuss its implications.
Jane: We also have Lu with us today — senior AI researcher at Tsinghua.
Tom: We also have Meng with us today — lead engineer at a mysterious AI startup.
Jane: We also have Lalam with us today — the in-house Large Language Model.
Tom: Alright, let's get started.
Summary: Tom: We’ve talked about the title, but let’s look at the summary of "Efficient Mod Approximation and Its Applications to CKKS Ciphertexts." The paper says that existing mod constructions only worked within limited subranges, leaving a huge gap in solving for accurate approximation across the *entire* input domain.
Jane: That’s exactly right; it’s like only having a map that works for half of the city. This research provides a solution to achieve reliable results across the all-integer points in the bounded interval zero B.
Lu: The way they solved this with polynomial interpolation and Chebyshev series is incredibly elegant, creating these continuous mathematical tools where previously there was just a jump discontinuity.
Meng: That’s a huge win for reliability. But how does it actually handle the periodic nature of mod? Does it maintain that accuracy when the input reaches its multiples of p?
Lalam: The ability to transition from discrete, jumping functions to continuous polynomial approximation is something that will profoundly improve how we model real-world data patterns in encrypted space.
Tom: It allows us to move beyond just simple arithmetic operations and gives us a powerful, precise tool for complex computations. This leads us naturally into the specific techniques they developed to make this usable in CKKS.
Improvements: Tom: Next, we’re looking at the specific improvements in "Efficient Mod Approximation and Its Applications to CKKS Ciphertexts," specifically how they use BitStack and CRTStack for data packing. These methods allow us to utilize the CKKS plaintext space much more effectively than before.
Jane: It’s a clever way of using redundancy, essentially packing multiple small-integer data points into a single ciphertext slot that would otherwise be wasted, which is huge for efficiency.
Lu: I see this as a massive optimization in terms resource allocation; we are essentially turning wasted space into highly dense computational potential, which is fantastic for parallel processing.
Meng: From an engineering standpoint, the reduction in overhead and the ability to achieve efficient ciphertext uploads are exactly what we need when dealing with massive data streams from IoT devices.
Lalam: This efficiency translates directly to improved security because smaller transmission means less exposure and more secure processing for people everywhere.
Tom: The authors show that this combined approach achieves very high approximation accuracy, up to-eight. It’s a true testament to the mathematical rigor involved in making these practical.
Jane: And since we' are talking about implementation, how does the structure of BitStack and CRTStack differ?
Meng: Well, they offer two different trade-offs. BitStack is more compact but requires serial unpacking, while CRTStack allows for parallel unpacking by utilizing independent moduli.
Lu: Parallelism is key here; if we can process multiple data streams simultaneously on the server side without increasing the error too much, that’s a huge performance boost for my models.
Lalam: We must consider how these structures allow us to organize complex information into a coherent, privacy-preserving whole for our users.
Conclusion: Tom: As we wrap up our discussion on "Efficient Mod Approximation and Its Applications to CKKS Ciphertexts," we’ve seen that the mod function approximation is just the beginning of a revolutionary toolkit. The paper introduces two data packing schemes, BitStack and CRTStack, which significantly improve space usage in CKKS.
Jane: And then we saw how this allows us to implement homomorphic rounding and a full transformation from additive secret shares to CKKS ciphertexts, which was an incredible achievement.
Lu: I think the transition from secret sharing to CKKS using only these operations is a major theoretical milestone that will allow for seamless integration of different privacy protocols in future AI systems.
Meng: It’s reassuring to see such a complete conversion scheme; it means we can actually build robust, interoperable systems that respect both mathematical security and engineering efficiency.
Lalam: I hope this research helps us build a digital infrastructure where complex data processing is not only secure but also highly efficient and accessible for everyone.
Tom: It’s clear that the path forward in homomorphic encryption is being paved with these kinds of practical, elegant solutions. We want to thank all our guests today for helping us explore "Efficient Mod Approximation and Its Applications to CKKS Ciphertexts."
Lu: I'm excited to see how this leads to a much more sophisticated next generation of encrypted computation.
Meng: I'm looking forward to seeing the real-world scaling of these methods in production environments.
Lalam: We hope this paves the way for a truly secure and efficient digital future for everyone listening.
Conclusion: Tom: So we’ve spent some time breaking down "Efficient Mod Approximation and Its Applications to CKKS Ciphertexts," and what's clear is that this paper provides a complete, practical solution where previously a gap existed in doing reliable mod computations across the entire input domain for encrypted data.
Jane: It's really a massive step forward because, as we saw with the Chebyshev series approach, it fixes that problem of discontinuous functions by replacing them with these incredibly accurate polynomial approximations.
Meng: And from an engineering standpoint, this means our systems can finally handle complex logic and data packing efficiently without excessive computational overhead or a massive communication bottleneck on the client side.
Lu: I think the potential for AI is huge because we're not just talking about simple arithmetic anymore; we're enabling a whole new layer of functionality within CKKS that allows us to process complex, real-world data patterns in an encrypted state.
Lalam: This work has a profound cultural impact because it paves the way for secure systems where data processing doesn' is inherently private, allowing us to build trust in ways we haven't seen before.
Tom: That’s right, Lalam; we’re moving from just secure storage to actual secure computation, which is a huge paradigm shift.
Jane: And with the introduction of BitStack and CRTStack packing schemes, it makes that secure computation much faster and more resource-efficient for our users too.
Meng: The performance gains in both encryption time and reduced traffic are genuinely impressive for large-scale deployment.
Lu: I’m excited about how this opens up space to run sophisticated algorithms on encrypted inputs that were previously considered intractable because of the computational cost of mod operations.
Lalam: We should all be very optimistic about how this "Efficient Mod Approximation and Its Applications to CKKS Ciphertexts" will help us design a more secure and efficient future.
Tom: It’s definitely something worth keeping an eye on, Jane, as we look toward the next fascinating paper in our lineup.
Yufei Zhou
Sun Yat-sen University, Guangzhou Higher Education Mega Center, Panyu District, Guangzhou, Guangdong, China · Sun Yat-sen University
cs.CR
Submitted: 2026-08-22
Updated: 2026-08-25
Code: https://github.com/openfheorg/openfhe-development
Importance score: 85/100
The gist: The paper presents a comprehensive solution to the challenge of performing non-linear operations, specifically the mod function, within the CKKS homomorphic encryption (HE) scheme.
Key concepts
- Mod Approximation
- The paper addresses the limitation of existing mod constructions that only worked in limited subranges. It provides a solution using polynomial interpolation and Chebyshev series to achieve reliable approximation across the entire input domain.
- CKKS Ciphertexts
- CKKS is a type of homomorphic encryption used for complex computations on encrypted data. The paper applies its techniques, including BitStack and CRTStack, to make the plaintext space more efficient for processing real-world data patterns.
- BitStack and CRTStack
- These are two data packing schemes that significantly improve how CKKS utilizes its plaintext space. BitStack is compact but requires serial unpacking, while CRTStack allows for parallel unpacking using independent moduli.
Terminology
Summary
The paper presents a comprehensive solution to the challenge of performing non-linear operations, specifically the mod function, within the CKKS homomorphic encryption (HE) scheme. The core of this work involves developing an accurate approximation method and applying it to enhance data packing efficiency and enable new cryptographic transformations.
The paper identifies a critical limitation in the widely used CKKS HE scheme: CKKS natively supports only addition and multiplication, lacking direct support for non-linear or discontinuous operations such as the mod function, which are essential in many cryptographic protocols.
Existing solutions typically provide approximations that are only valid within limited subranges of the input,
leaving a global approximation unresolved.
To address this, the authors propose a novel method: we propose a novel method based on polynomial interpolation and Chebyshev series to accurately approximate the mod function over all integer points in the bounded input interval.
The proposed method leverages Chebyshev polynomials because they provide near-optimal uniform approximation under the minimax criterion, mitigating the Runge phenomenon.
The process involves:
-
Sampling: Obtaining B+1 sample points (i, i mod p, where i = 0, 1, 2,, over the interval [0, B].
-
System Construction: Setting up a system of equations using these points.
-
Solving and Scaling: Solving the underdetermined linear system (where the number of unknowns is D+1 and the number of equations is B+1) and selecting the solution with minimal 2-norm. Crucially, they introduce a scaling factor delta to ensure that
all coefficients remain below 1,
which is necessary to preventa rapid amplification of errors during the homomorphic polynomial evaluation.
-
Evaluation: The Paterson–Stockmeyer method is used for efficient computation, allowing the evaluation of the function f(x) = about ModP(x, p) at a point u.
Building upon this homomorphic mod function, the paper details several significant applications:
The authors design two efficient data packing schemes to improve the utilization of the CKKS plaintext space and enable efficient ciphertext uploads for small-integer inputs:
-
BitStack: This method represents data using binary strings and concatenates them into a single structure. The unpacking process uses the homomorphic mod function serially.
-
CRTStack: This method is
inspired by the CRT
(Chinese Remainder Theorem). It constructs a system of congruences based on the packed data and solves it during unpacking, allowing for parallel processing of different layers:
ModP([[x]], P i) where P i are pairwise coprime.
The mod function is utilized to implement a homomorphic rounding operation for CKKS. The authors demonstrate this by defining functions based on the mod operation:
Floor(x, p) = 1 over p times (x - ModP(x, p))
This application achieves high accuracy, with an approximation error as low as 10-10.
The paper presents the first complete HE-based transformation scheme that converts additive secret shares into CKKS ciphertexts without any modification to the underlying secret sharing schemes.
This is achieved by computing:
[[x]] = ModP ([[s i]], p for all participants
The experimental results demonstrate superior performance across various metrics:
-
Accuracy: The proposed method achieves high approximation accuracy, with errors on the order of 10-8 when the polynomial degree exceeds 45. In comparison, baseline methods like Lee2021 exhibit significantly higher average errors (e.023 to 2.030 for p=4).
-
Efficiency:
-
Unpacking Time: Compared to the
Switch
method in BitStack, the proposed ModP-based approach achieves unpacking within only 15.39s, compared to over 932.74s for the Switch method. -
Latency: In comparison with Rubato (a representative Transcipher scheme), the authors' combined CRTStack + ImgConcat method requires less encryption time on the user and achieves a total latency of 156.70s, which is
approximately 1.6 times faster
than Rubato's 407.03 seconds. -
Data Packing Comparison: Table 6 shows that the combination of VecConcat + CRTStack significantly reduces the communication cost by nearly two orders of magnitude compared to using plain CKKS packing alone.
Improvements for AI systems
As a diligent AI researcher, I have analyzed this paper. The innovations presented are highly valuable for advancing privacy-preserving machine learning (PPML) and secure multi-party computation (MPC).
The core limitation addressed is the inability of standard homomorphic encryption schemes like CKKS to handle discontinuous, non-linear operations such as the modulo function (ModP). This allows for a significant leap in functional expressiveness.
Here are the specific improvements and capabilities that can be incorporated into AI systems:
Improvement: Integration of the novel Homomorphic Mod Function (ModP(x, p)) into the core computation graph of a neural network or data processing pipeline.
- What it does: It enables the secure, homomorphic calculation of integer modulo operations on encrypted ciphertext. This is critical for AI systems that rely on discrete inputs (e.g., categorical features, quantized activations, or bitmasks). Instead of relying on complex polynomial approximations (which often fail at discontinuities), the the proposed method provides high accuracy (10-8) across the entire bounded integer input domain [0, B].
Improvement: Implementation of BitStack and CRTStack data packing schemes for input vectors.
- What it does: These schemes allow multiple discrete data points (e.g., quantized image pixels, genetic markers) to be packed into a single CKKS ciphertext structure far more efficiently than standard SIMD techniques. This drastically reduces the required communication overhead (ciphertext uploading) and increases the throughput of secure inference tasks, making large-scale AI processing feasible on resource-constrained client devices.
Improvement: Implementation of a Homomorphic Rounding Function derived from ModP.
- What it does: It allows AI models to perform precise rounding operations (Floor, Ceiling, Nearest Integer) on encrypted data without needing to switch to complex integer-only schemes. This is essential for applications involving fixed-point arithmetic or when integrating quantized outputs back into a continuous domain while maintaining privacy.
Improvement: Utilizing the Secret Share to CKKS Conversion scheme as a complete, homomorphic transformation layer (Transcipher).
- What it does: This allows an outsourced server to perform secure computations on data that originated from multiple participants using additive secret sharing. The system converts the distributed shares into a single CKKS ciphertext, enabling the server to process the entire dataset without requiring any of the original parties to reveal their private inputs.
By implementing these features, an AI system (e.g, a secure federated learning aggregator or a privacy-preserving image classifier) can:
-
Process high-volume, discrete input data (like quantized images or genomic sequences) with minimal communication overhead due to BitStack/CRTStack.
-
Perform complex logic on these inputs, including secure modulo operations and rounding, using the Homomorphic Mod Function.
-
Aggregate results from multiple independent parties whose data is initially in secret-shared form, converting them into a single ciphertext for secure computation via the Secret Share to CKKS Conversion.
This architecture achieves high functional expressiveness and superior efficiency compared to current state-of-the-art methods, while maintaining strong security guarantees.
Related papers
- SoK: AI-Augmented Binary Reversing
- Relaxed Sender Anonymity for CBDC Interbank Settlement: A Zero-Knowledge Approach on Permissioned EVM
- Calibration-Family Overfit: Why Trusted Sabotage Monitors Don't Transfer Across Lineages
- Efficient Fuzzy PSI under One-Sided Assumptions
- Sealing the Audit-Runtime Gap for LLM Skills
- Token Composition: A Graph Based on EVM Logs