Abstract
This paper investigates the impact of modular reduction backends on the security–performance trade-offs of the CKKS approximate homomorphic encryption scheme. Specifically, we compare a standard Residue Number System–Chinese Remainder Theorem (RNS-CRT) implementation with a Barrett reduction–based backend across representative parameter sets , spanning approximately 80–256-bit security levels as recommended by the Homomorphic Encryption Standard. We evaluate typical CKKS workloads—including encoding, encryption, homomorphic multiplication with the Number Theoretic Transform (NTT), rescaling, relinearization, and decryption—by measuring execution time and peak memory usage on a uniform experimental platform. Our results indicate that the parameter pair primarily determines both security level and computational cost, while the choice of backend significantly influences the trade-offs between performance and memory efficiency. In particular, the Barrett-based backend is competitive and slightly more memory-efficient at lower security levels, whereas the CRT-based approach achieves lower latency at higher security levels. However, Barrett reduction provides notable memory savings at the cost of a 2–4× increase in runtime. Based on these findings, we derive practical guidelines for selecting CKKS parameters and modular reduction backends under varying constraints on security, latency, and memory.
1. Introduction
Modern cryptography provides mathematically grounded tools to ensure data confidentiality, integrity, and authenticity in adversarial environments [1]. As digital health systems and connected medical devices proliferate, healthcare providers increasingly rely on cryptography to protect sensitive clinical records, diagnostic data, and treatment histories while still enabling data-driven decision making [2]. Lattice-based, post-quantum cryptography offers strong security guarantees against both classical and quantum adversaries and forms the foundation for advanced primitives such as homomorphic encryption (HE) [3].
HE enables computation directly on encrypted data and is therefore well suited to privacy-preserving health management, where raw medical data (e.g., lab results, imaging features, or wearable sensor streams) cannot be exposed to cloud or third-party analytics systems. In this context, HE supports tasks such as secure risk scoring, encrypted model inference, and collaborative analysis across institutions without revealing individual patient records. Among existing schemes, the Cheon–Kim–Kim–Song (CKKS) scheme for approximate arithmetic is particularly attractive for healthcare workloads because many clinical and predictive models operate on real-valued vectors and can tolerate small numerical approximation errors [4]. CKKS encodes real or complex-valued health features into ring elements and performs approximate fixed-point arithmetic over ciphertexts, enabling deeper encrypted computations than exact-integer schemes at comparable parameter sizes [4].
The practical deployment of CKKS in health management systems depends critically on parameter settings and implementation choices. In particular, the ring degree N and ciphertext modulus q largely determine security level, numerical precision, and circuit depth, while the choice of arithmetic backend, i.e., modular reduction method, directly impacts runtime and memory usage [5,6].
CRT-based residue number systems and Barrett-based techniques are probably the two most widely used modular reduction methods in cryptographic implementations, like in CKKS [7,8]. To the best of our knowledge, there is still no comprehensive evaluation of these two backends within a unified homomorphic encryption environment. Most prior studies analyze modular reduction approaches independently or across different software frameworks and parameter settings, making direct and fair comparisons challenging.
In this work, we bridge this gap by evaluating CRT and Barrett backends within the same HE framework, focusing on how different configurations and CRT versus Barrett implementations affect performance by measuring their effects on computational overhead, memory utilization, and ciphertext-level performance under standard security levels. The goal is to provide experimentally grounded guidelines for designing CKKS-based health management pipelines that respect strict privacy requirements while remaining practical on real-world computing platforms [9,10,11].
The main contributions of this work include (1) A systematic study of CKKS parameters, highlighting the impact of ring degree N and ciphertext modulus size on security, depth, runtime, and memory usage. (2) A comparison of two CKKS modular reduction backends: conventional RNS–CRT and Barrett-based modular reduction. (3) Practical guidelines for parameter and backend selection under different security and application requirements for CPU-based privacy-preserving analytics and machine-learning workloads.
To enhance readability, a list of acronyms and abbreviations is provided at the end of the paper.
2. Math Preliminaries
2.1. Cyclotomic Polynomial Ring
CKKS and many RLWE-based schemes work over a cyclotomic polynomial ring
where N is a power of two and is the cyclotomic polynomial [3,12]. For a modulus q, coefficients are reduced to obtain
An element of is a polynomial
with addition and multiplication performed modulo and q. The choice in Equation (1), where N is a power of two, ensures Cooley–Tukey FFT-style efficient computation for Number Theoretic Transform (NTT) and supports packing of complex or real vectors via the canonical embedding, which is essential for CKKS throughput [3,4].
2.2. Ring Learning with Errors (RLWE)
The security of CKKS relies on the Ring Learning With Errors problem, which lifts the LWE hardness assumption from vectors over to polynomials in .
A typical RLWE cryptosystem can be briefly outlined as follows. For the uniformly sampled polynomial and the sampled small polynomial , compute from
where is a small “error” polynomial. Then the public key is the pair , and the secret key is . Given many such noisy equations, recovering is believed to be as hard as solving certain worst-case problems on ideal lattices in the underlying cyclotomic field [13].
For the plaintext message , encode it into a polynomial in . Obtain the small polynomials through sampling and compute
Then, the ciphertext can be given as
The decryption requires the computation of
So that can be recovered from .
When instantiated as an encryption scheme, RLWE yields compact public keys and ciphertexts: the public key encodes one noisy relation of the form (2), and encryption masks the plaintext polynomial with additional small noise polynomials (3). Decryption subtracts the secret-dependent part and recovers as long as the accumulated noise remains below a modulus-dependent threshold (4). This structure is inherited directly by CKKS, which augments RLWE encryption with approximate fixed-point encoding and rescaling operations [4,14].
2.3. Residue Number System and CRT in
To support large ciphertext moduli efficiently, CKKS uses a residue number system based on CRT. A large integer modulus
with pairwise coprime primes , is represented by its residues
CRT implies the ring isomorphism
so additions and multiplications modulo q can be performed independently in each limb.
This idea extends naturally to the polynomial ring , yielding the so-called “double-CRT” representation
A ciphertext polynomial in is stored as its components in each , and all homomorphic operations are carried out limb-wise. Full-RNS CKKS variants operate entirely in this representation and are now standard in efficient implementations [5,6,9].
2.4. Barrett Modular Reduction
Modular reduction by the small primes is a core operation in NTT butterflies, pointwise multiplications, and rescaling steps. Direct division by is expensive, so CKKS implementations typically employ Barrett modular reduction, which replaces division by precomputed constants and multiplications [15,16].
For a fixed modulus q and an integer k with , Barrett’s method precomputes
Given an input x with , an approximate quotient is obtained by
and the intermediate remainder is
One can show that , so a final conditional subtraction yields . In the RNS setting, the same idea is applied independently to each limb , using precomputed for each modulus. Compared to division-based reduction, Barrett’s method significantly reduces latency and is competitive with Montgomery-style techniques in HE workloads [16,17,18].
3. Homomorphic Encryption Schemes and CKKS
Since its introduction, HE has evolved from supporting a single operation on ciphertexts to enabling practical evaluation of complex functions over encrypted data. Early schemes were either additively or multiplicatively homomorphic, while later constructions combined both operations and ultimately achieved fully homomorphic encryption (FHE) with support for arbitrary circuits [19]. This evolution has been driven by lattice-based cryptography and noise-management techniques, which improved efficiency enough for HE to be applied in privacy-sensitive domains such as healthcare analytics and clinical decision support [20].
3.1. From PHE and SHE to FHE
Let and denote encryption and decryption of a message m and ciphertext c, and let ⊕ and ⊗ denote homomorphic addition and multiplication. A partially homomorphic encryption (PHE) scheme supports only one operation, for example
for additively homomorphic schemes such as Paillier, or
for multiplicatively homomorphic constructions such as textbook RSA without padding.
Somewhat homomorphic encryption (SHE) schemes support both addition (6) and multiplication (7) but only up to a bounded depth because each operation increases ciphertext noise, and decryption fails once the noise exceeds a threshold [21]. Fully homomorphic encryption (FHE) removes this depth limitation by periodically refreshing ciphertexts via bootstrapping, allowing the evaluation of arbitrary polynomial-size circuits
for any circuit C [19].
3.2. Generations of HE Schemes
First-generation FHE schemes, starting from Gentry’s original ideal-lattice construction, established feasibility but were orders of magnitude too slow for practice [19]. Second-generation schemes such as BGV and BFV moved to RLWE-based polynomial rings and introduced techniques such as modulus switching, key switching, and SIMD batching, enabling leveled FHE without frequent bootstrapping [14,22]. Third-generation schemes (GSW, FHEW, TFHE) optimized binary gate evaluation and made bootstrapping fast enough for real-time logic on encrypted bits [23,24,25]. A fourth generation focuses on approximate arithmetic, where many applications—including health management—operate on real-valued features and tolerate small numerical errors. In this space, the CKKS scheme is now a de facto standard, enabling efficient encrypted computation over vectors of real or complex numbers with floating-point-like semantics [4].
3.3. CKKS Scheme
CKKS is an RLWE-based homomorphic encryption scheme tailored to approximate arithmetic on real and complex vectors [4]. It operates over the cyclotomic ring
where N is a power of two, and q is the ciphertext modulus, often factored into smaller RNS primes. Plaintexts encode vectors in using a packing technique based on the canonical embedding, and each ciphertext carries a scale parameter that tracks fixed-point precision [4,26].
3.3.1. Encoding and Approximate Arithmetic
CKKS assumes that user data are a vector of complex numbers . The encoding maps the vector into the values of a polynomial at special points (roots of unity), then reconstructs the polynomial via an inverse transform.
Let be a primitive -th root of unity, . So we construct such that through
after embeds m into the cyclotomic field via the canonical embedding, then CKKS applies a scaling factor :
where reconstructs a Hermitian-symmetric vector from the slots [26]. The coordinates of w in a fixed lattice basis are rounded to integers and used as coefficients of the plaintext polynomial
Decoding inverts this process: after decryption, the polynomial is mapped back through the canonical embedding and divided by , yielding an approximation of the original slot vector. The choice of , modulus chain, and N determines the achievable precision and depth for a given health-management workload.
3.3.2. Encryption and Decryption
The secret key is a small polynomial
and the public key is constructed as a noisy RLWE sample encrypting zero [4]. Given an encoded plaintext , encryption samples fresh small polynomials and outputs the ciphertext
so that .
Decryption uses the linear form in the secret key
which equals plus a bounded noise polynomial. After decoding and division by , the slots approximate the original real or complex inputs [27].
3.3.3. Homomorphic Addition and Multiplication
Let ciphertexts from (8) and (9), and encrypt plaintexts and at the same level. Homomorphic addition is defined component-wise:
and decryption yields
Plaintext–ciphertext multiplication by a plaintext polynomial is given by
with
Ciphertext–ciphertext multiplication takes two ciphertexts and and forms a 3-component ciphertext
so that
3.3.4. Relinearization
Relinearization maps the 3-component product back to a standard 2-component ciphertext under the same secret key [28]. Using an evaluation key that encrypts under s, relinearization computes
and the resulting ciphertext
again decrypts with the standard rule .
3.3.5. Rescaling and Multiplication Pipeline
After multiplication, both the scale and modulus grow. CKKS controls this growth with a rescaling step that simultaneously reduces the modulus and divides the ciphertext by the scale [6,29]. If c lives at level ℓ with modulus , rescaling to level is defined as
which approximately divides both the message and noise by the scale and drops one modulus from the chain.
Combining these steps, the CKKS multiplication pipeline is
where is a 2-component ciphertext at the next lower level with restored scale and controlled noise, ready for further homomorphic operations.
4. Parameter Selection, Simulation and Recommendations
4.1. CKKS Parameters Used in This Work
In the proposed implementation, the CKKS scheme is instantiated with a tuple of parameters that jointly determine security, precision, and performance. All experiments use the same parameter sets for both the CRT-based baseline and the Barrett-based variant, so that any performance differences arise purely from the modular arithmetic backend and not from changes in cryptographic strength.
4.1.1. Ring Degree N
The ring degree N is chosen as a power of two (in the range – in this work). It defines the polynomial ring , the RLWE lattice dimension, and the number of SIMD slots () [4,6]. Larger N improves security and packing capacity but increases ciphertext and key sizes, and raises the cost of NTT-based operations roughly as .
4.1.2. Ciphertext Modulus q
The ciphertext modulus q is represented in RNS form as
where each is a 30–60-bit prime so that arithmetic in each limb fits in an 80-bit word. This modulus chain is consumed by homomorphic multiplication and rescaling: every multiplication increases noise and effective scale, and each rescale step drops one and divides by the scaling factor [4,5]. The total size must be large enough to sustain the required multiplicative depth and precision; too small a causes decryption failures, whereas too large a adds limbs and slows all operations without increasing security [6,30].
4.1.3. Scaling Factor
The scaling factor is chosen as a power of two (e.g., –). It is applied during encoding to map real or complex health features into fixed-point integers by multiplying by and rounding [30]. A larger improves numerical precision but consumes more modulus bits per multiplication and may require a longer modulus chain; a smaller saves modulus but may reduce application-level accuracy for clinical workloads.
4.1.4. Noise Distribution Parameter
The parameter controls the discrete Gaussian (or similar) distribution used for RLWE noise in encryption and key-dependent operations [6]. Typical choices (e.g., ) provide sufficient initial noise for security while keeping it small enough to be tracked within the available modulus. In this work, are selected according to standard CKKS guidelines [6,30] and then fixed across all implementations.
4.2. Parameters Versus CKKS Security Levels L
The pair is the dominant driver of both security and performance in CKKS. Security is based on the hardness of Ring-LWE in the cyclotomic ring , so N and define the underlying lattice dimension and modulus [6]. In practice, the security level (L, in bits) is estimated via the cost of the best known lattice attacks (typically BKZ-based), which depends primarily on the ring dimension N and the modulus-to-noise ratio (captured through and the error distribution) [31,32,33].
4.2.1. Dependence of Security Level L on N
For RLWE instances with fixed modulus and noise parameters, increasing the polynomial modulus degree N (equivalent to the lattice dimension) increases hardness.
The complexity of the best known attacks (e.g., BKZ with block size ) scales as:
where itself depends on N and the ratio (the standard noise deviation is usually set as ).
Heuristically, for fixed , increasing N increases the required block size , and hence the attack cost.
The implication is that security increases with N, but sublinearly in terms of security bits. For example, doubling N does not double L; instead, it typically yields a moderate increase depending on the modulus size. This behavior is consistent with modern lattice cost models and empirical estimates from tools such as the LWE Estimator.
4.2.2. Dependence of Security Level L on
The modulus q directly affects the distinguishability of RLWE samples.
Increasing q (for fixed noise standard deviation ) increases the ratio , making the problem easier. A common heuristic from LWE/RLWE analysis relates the root-Hermite factor to:
which implies that larger q leads to smaller required , hence easier lattice reduction.
Since attack cost depends exponentially on lattice reduction quality, one may write:
As a result, security decreases as increases. However, the dependence is not linear; rather, it appears inside a logarithm within an exponential model. Thus, increasing reduces security in a nonlinear and attenuated manner.
4.2.3. Combined Dependence and Practical CKKS Parameter Selection
Combining the above effects yields a commonly used first-order heuristic:
This expression captures the fundamental trade-off:
- Increasing N improves security;
- Increasing q degrades security;
- The relationship is ratio-based and nonlinear.
However, this is only an approximation. In CKKS, the modulus q grows with multiplicative depth, so parameter selection must respect a security budget constraint:
- N and cannot be scaled independently;
- For a fixed target security level (e.g., 128 bits), increasing requires increasing N.
This explains the structure of parameter tables in implementations such as Microsoft SEAL [34], where larger N permits larger total modulus , but the scaling is sublinear rather than proportional.
For fixed , increasing N raises the cost of lattice reduction; for fixed N, increasing generally weakens the instance and may require a larger N to restore the same security level [6]. The Homomorphic Encryption Standard therefore provides recommended curves for 80–128-bit security, which we follow when selecting parameter sets [6].
From a performance perspective, nearly all CKKS operations (NTT/INTT, ciphertext multiplication, key switching, and rotations) scale with N and with the number of RNS primes in q [9,11,35]. Larger N increases latency and memory but also provides more slots (), improving amortized cost per health record or feature vector. Adding primes to q increases depth and precision but enlarges ciphertexts and evaluation keys and raises time and memory. Consequently, both N and are kept as small as possible while meeting target security and accuracy for the health-management workloads considered.
4.3. Algorithmic Choices: RNS–CRT and Barrett Reduction
Efficient polynomial arithmetic in is essential to make these parameter choices meaningful. All implementations in this work use the same RNS/CRT representation: the large modulus q is split into pairwise coprime primes , and each polynomial coefficient is stored as its residues [5]. This “double-CRT” representation enables limb-wise parallelism and efficient rescaling in Full-RNS CKKS [5,36].
The only algorithmic difference between the two backends lies in how modular reduction is performed at each limb. The baseline uses a conventional CRT-centric modular reduction, while the proposed variant replaces division by Barrett reduction, using precomputed reciprocals for each modulus [16,37]. In both cases, the RNS structure and CKKS parameters are identical; the experiments therefore isolate how the choice between RNS-CRT (or CRT in short form) and Barrett affects runtime and peak memory across and security levels, for representative health-management workloads.
4.4. Simulation Settings
The experiments are run on an AMD Ryzen 7 7700X (8 cores, 16 threads, 4.49 GHz, fabricated by TSMC in Taiwan), 64 GB DDR5-5200 RAM (manufactured by SK Hynix in South Korea), Ubuntu 22.04, and Python 3.12. The CRT baseline is a forked py-fhe implementation; the Barrett backend is our CKKS-Barrette code. Both use the same CKKS parameters and RNS structure, so that differences reflect only the modular reduction backend. For each parameter set , we measure end-to-end execution time (seconds) and peak memory (MB) for a representative CKKS workload that includes at least one ciphertext–ciphertext multiplication with rescaling and relinearization.
4.5. Simulation Results and Recommendations
Simulations were conducted for selected parameter pairs at security levels of 80, 100, 110, 128, 192, and 256 bits. The corresponding results are summarized in Table 1, Table 2, Table 3, Table 4, Table 5 and Table 6, respectively. The parameter sets chosen for the 128-, 192-, and 256-bit security levels follow the recommendations of the Homomorphic Encryption Standard [6].
Table 1.
Experimental results for 80-bit security level.
Table 2.
Experimental results for 100-bit security level.
Table 3.
Experimental results for 110-bit security level.
Table 4.
Experimental results for 128-bit security level.
Table 5.
Experimental results for 192-bit security level.
Table 6.
Experimental results for 256-bit security level.
4.5.1. The 80-Bit Security
An 80-bit security level, commonly regarded as ultra-lightweight security, corresponds to legacy cryptographic systems such as 1024-bit RSA and Triple DES. It remains relevant in legacy communication infrastructures and resource-constrained embedded devices where lightweight security is sufficient.
For , CRT is slightly faster than Barrett, whereas Barrett achieves significantly lower memory usage. For the remaining parameter sets, CRT substantially outperforms Barrett in execution time, while Barrett consistently requires less memory.
With a fixed security level, e.g., 80 bits, the selection of depends on the requirements of the target application. Further discussion is provided at the end of this section.
4.5.2. The 100 and 110-Bit Security Levels
Security levels of 100 and 110 bits are generally considered lightweight and are suitable for IoT devices, RFID systems, sensor networks, edge computing platforms, and embedded applications.
Even when higher security levels are desired, lower-security configurations are often explored for latency-sensitive applications and intermediate deployment scenarios.
At 100-bit security with , CRT achieves lower execution time but requires more memory. For , CRT is more than twice as fast as Barrett, whereas Barrett reduces memory usage to approximately 95% of that required by CRT. For , CRT is nearly three times faster, while Barrett reduces memory consumption by about 2%.
At 110-bit security, CRT is approximately twice as fast as Barrett for and , although it requires slightly more memory. For , CRT is nearly three times faster, while Barrett reduces memory usage by approximately 1.5%. For (16,384, 550), CRT is about 4.5 times faster, whereas Barrett provides only a marginal memory reduction of roughly 1%.
4.5.3. The 128-Bit Security
A 128-bit security level is widely regarded as the standard baseline for modern cryptographic applications, offering a practical balance between efficiency and long-term protection against classical adversaries.
In CKKS-based homomorphic encryption, 128-bit security is commonly adopted for privacy-preserving machine learning, encrypted database queries, and secure outsourced computation. It is also the default recommendation in standards such as NIST SP 800-57 for protecting sensitive personal, commercial, and institutional data over medium- to long-term periods.
For high-security settings (128 bits or above), large parameter sets such as N = 16,384 with large moduli are generally required. Although both backends incur substantial runtime and memory overhead, CRT consistently achieves lower execution time, whereas Barrett provides slightly lower memory consumption.
4.5.4. The 192-Bit Security
A 192-bit security level is less commonly deployed but is suitable for applications requiring stronger protection against highly capable adversaries or longer data retention periods. Typical use cases include government, defense, and high-assurance-secure communication systems.
In homomorphic encryption and secure multi-party computation, 192-bit security may be preferred when 256-bit security is considered excessively costly, while additional assurance beyond 128-bit security is still desired.
At the 192-bit security level, CRT consistently achieves lower execution time, whereas Barrett provides slightly lower memory usage. For large ring degrees, such as or , the memory advantage of Barrett becomes marginal compared to the substantial runtime advantage of CRT.
4.5.5. The 256-Bit Security
A 256-bit security level targets applications requiring maximum resilience against future threats, including large-scale quantum adversaries and long-term archival attacks. Typical applications include national security systems, critical infrastructure, and highly sensitive financial systems.
In post-quantum and high-assurance cloud-computing applications, 256-bit security provides a conservative security margin for data requiring decades of confidentiality. Although it significantly increases parameter sizes and computational cost in homomorphic encryption systems, such overhead may be justified for highly sensitive long-term data.
At the 256-bit security level, CRT is approximately 2.2–3.4 times faster than Barrett, while Barrett reduces memory usage by roughly 1–2% compared to CRT.
In summary, we acknowledge that the superior performance of the CRT-based method over the Barrett-based method arises primarily from the use of reduced-size moduli obtained via the factorization of q. This decomposition enables computations to be carried out over smaller integers, significantly lowering arithmetic complexity. In addition, the inherent parallelism of the CRT approach—where operations across different moduli are independent—aligns well with modern multi-core architectures, further enhancing performance. This advantage becomes more pronounced for larger values of q, or equivalently, for larger polynomial degrees N that support a larger modulus.
In terms of memory usage, however, the CRT-based method typically incurs higher overhead, as it must maintain multiple residues corresponding to the factorization of q, leading to increased storage and data movement compared to the Barrett-based approach.
4.6. Application Considerations on Selection of
In CKKS, once the target security level is fixed, the polynomial modulus degree N and the total modulus size are primarily driven by circuit depth D, required numerical precision, and the SIMD vector size.
The circuit depth determines the length of the modulus chain: each multiplication (followed by rescaling) consumes one level, so a deeper circuit requires a larger total to accommodate the cumulative modulus drops.
The required precision dictates the size of the scaling factor and the tolerance to noise growth; higher precision necessitates larger intermediate moduli and therefore increases as well.
The vector size (i.e., the number of packed slots) is bounded by , so larger batch sizes require larger N. However, increasing at a fixed security level typically forces an increase in N to maintain hardness of the underlying RLWE instance.
Consequently, D and precision directly inflate , while vector size directly sets a lower bound on N; together they interact so that more demanding depth or precision indirectly pushes N upward to preserve the desired security level. Two practical workload patterns require special attention:
- Large batches of input data:
Increasing N increases the number of CKKS slots and thus the batch size. For throughput-oriented workloads (e.g., batched inference), larger N (8192 or 16,384) is recommended even at lower security levels. CRT is preferable when minimizing latency per batch is critical; Barrett becomes attractive when many batches run concurrently, and aggregate memory usage limits the number of parallel sessions.
- High-resolution input data:
Increasing allows larger scaling factors and higher fixed-point precision, but increases runtime and memory. For high-precision workloads (e.g., finance or scientific computing), medium-to-large moduli (220–260 at , or 300–350 at N = 16,384) are recommended. In these cases, CRT should be chosen when speed is paramount, while Barrett offers a memory-optimized alternative when infrastructure cost or device RAM is the bottleneck.
- Suggested practical guidelines:
Our results suggest the following criteria for choosing between CRT and Barrett for practical users:
- For memory-constrained IoT devices with limited RAM and moderate security requirements (e.g., 80-bit security), Barrett is preferable due to its lower memory usage, even though it may be slower.
- For cloud servers or high-performance environments requiring high security (e.g., 128-bit or above), CRT is preferable because it provides significantly better time efficiency at these security levels, and memory is less constrained.
- For applications where both memory and time are critical, the choice depends on the target security level: Barrett is competitive at low-to-moderate security, while CRT becomes more advantageous as security level increases.
The above guidelines can also be summarized into a table as shown in Table 7.
Table 7.
Practical guidelines for choosing CRT and Barrett.
5. Conclusions
5.1. Summary of Contributions
The proposed research work investigated parameter selection and modular arithmetic design choices for the CKKS homomorphic encryption scheme, with a particular focus on how these choices shape the security–performance trade-off in practice. The core contributions are:
- A systematic experimental study of CKKS parameters, emphasizing the dominant role of the ring degree N and the ciphertext modulus size in determining security, depth, runtime, and memory usage [6,9].
- A controlled comparison of two modular reduction backends within CKKS: a conventional RNS–CRT-centric implementation and an alternative implementation that integrates Barrett modular reduction into performance-critical arithmetic routines [16].
- Practical recommendations for parameter and backend selection under different security and application scenarios, targeting CPU-based deployments of privacy-preserving analytics and machine-learning workloads.
5.2. Significance and Limitations of the Research
The significance of the results lies in their systems-level implications for homomorphic encryption. CKKS is increasingly used in applications such as privacy-preserving machine learning and secure data analytics, where performance and memory usage often determine feasibility [9,38]. In such settings, asymptotic complexity alone is insufficient to guide design choices.
The experiments show that even when two implementations share the same cryptographic foundations, low-level arithmetic decisions can meaningfully alter practical behavior. In particular, they indicate that Barrett reduction, while typically slower than CRT-based arithmetic in terms of raw execution time at higher security levels, can reduce peak memory usage in several important regimes. This trade-off is especially relevant for cloud and multi-tenant environments, where memory constraints often limit the number of concurrent encrypted workloads more severely than compute throughput [39,40]. The results also reinforce that there is no universally optimal CKKS configuration: parameter and backend choices must be aligned with application requirements such as acceptable latency, available memory, and target security level [38].
- Discussion relating to SEAL/Palisade:
These findings have direct implications for widely used homomorphic encryption libraries such as Microsoft SEAL and Palisade. In SEAL, modular reduction is implemented as part of the core arithmetic, and the choice of backend can significantly affect performance for CKKS-based workloads. Our results suggest that, for SEAL deployments targeting low-security, memory-constrained scenarios, a Barrett-based modular reduction backend could reduce memory pressure and enable operation on devices with limited RAM. Conversely, for high-security server-side deployments, a CRT-based backend is likely to provide better throughput and lower latency. Similarly, in Palisade, where multiple modular reduction strategies can be configured, our results indicate that CRT should be preferred for high-security parameter sets, while Barrett may be advantageous for lower-security configurations where memory is the primary bottleneck. Practitioners using these libraries can use our decision table and examples to guide parameter and backend selection based on their target deployment environment.
- Limitations of this work:
Several limitations should be acknowledged. First, the experimental evaluation is based on Python implementations, which do not fully exploit low-level optimizations available in production-grade C/C++ libraries such as SEAL or OpenFHE [9]. In this sense, the results are intended to guide backend selection and parameter tuning within CKKS, while a native C/C++ re-implementation is left to future work. Second, the study evaluates performance only on a CPU platform and does not consider GPU or FPGA accelerators, where the relative behavior of CRT and Barrett might differ [39]. Finally, the analysis focuses on execution time and peak memory; other important metrics, such as energy consumption and end-to-end numerical accuracy in concrete applications, are outside the scope of the presented work in this paper [9].
5.3. Directions for Possible Future Work
The findings suggest several avenues for future research.
An immediate direction is to extend the evaluation to optimized C/C++ CKKS libraries, integrating Barrett-based modular reduction into mature frameworks such as SEAL or OpenFHE. This would clarify whether the memory advantages observed here persist when aggressive compiler optimizations, vectorization, and hand-tuned arithmetic are applied [6].
Another direction is to explore hardware-accelerated implementations on GPUs and FPGAs, where multiplication-heavy algorithms such as Barrett reduction may benefit disproportionately from parallelism [39,40]. A comparative study across CPU, GPU, and hybrid architectures could yield new insights into backend selection for large-scale deployments.
Finally, the methodology developed in this work could be generalized to other homomorphic encryption schemes, such as BFV or TFHE, to assess whether similar trade-offs between modular arithmetic backends arise beyond CKKS [6,38].
Author Contributions
Conceptualization, H.G.; Methodology, H.G.; Validation, H.G.; Formal analysis, H.G.; Writing—original draft, H.G.; Writing—review and editing, H.W.; Supervision, H.W.; Project administration, H.W. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Data Availability Statement
The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.
Conflicts of Interest
The authors declare no conflicts of interest.
Abbreviations
| Acronym | Meaning |
| BFV | Brakerski/Fan–Vercauteren |
| BGV | Brakerski–Gentry–Vaikuntanathan |
| BKZ | Block Korkine–Zolotarev |
| CKKS | Cheon–Kim–Kim–Song Scheme |
| CRT | Chinese Remainder Theorem |
| FHE | Fully Homomorphic Encryption |
| FHEW | Fast Fully Homomorphic Encryption over the Torus |
| GSW | Gentry–Sahai–Waters |
| HE | Homomorphic Encryption |
| NTT (INTT) | (Inverse) Number Theoretical Transform |
| RLWE | Ring Learning with Errors |
| RNS | Residue Number System |
| SHE | Somewhat Homomorphic Encryption |
| SIMD | Single Instruction Multiple Data |
| TFHE | Fast Fully Homomorphic Encryption over the Torus |
References
- Katz, J.; Lindell, Y. Introduction to Modern Cryptography, 3rd ed.; CRC Press: Boca Raton, FL, USA, 2020. [Google Scholar]
- Bernstein, D.J.; Buchmann, J.; Dahmen, E. Post-Quantum Cryptography; Springer: Berlin/Heidelberg, Germany, 2009. [Google Scholar]
- Lin, C. Ring-LWE: Enhanced Foundations and Applications; Columbia University: New York, NY, USA, 2023. [Google Scholar]
- Cheon, J.H.; Kim, A.; Kim, M.; Song, Y. Homomorphic encryption for arithmetic of approximate numbers. In Proceedings of the ASIACRYPT 2017; LNCS; Springer: Berlin/Heidelberg, Germany, 2017; Volume 10624, pp. 409–437. [Google Scholar]
- Cheon, J.H.; Han, K.; Kim, A.; Kim, M.; Song, Y. A full RNS variant of approximate homomorphic encryption. In Proceedings of the International Conference on Selected Areas in Cryptography; Springer: Berlin/Heidelberg, Germany, 2018; pp. 347–368. [Google Scholar]
- Albrecht, M.; Chase, M.; Chen, H.; Ding, J.; Goldwasser, S.; Gorbunov, S.; Halevi, S.; Hoffstein, J.; Laine, K.; Lauter, K.; et al. Homomorphic encryption standard. In Protecting Privacy Through Homomorphic Encryption; Springer: Berlin/Heidelberg, Germany, 2022; pp. 31–62. [Google Scholar]
- Lee, C.; Lee, H.; Satriawan, A.; Lee, H. Configurable arithmetic core architecture for RNS-CKKS homomorphic encryption. IEEE Access 2024, 12, 147220–147234. [Google Scholar] [CrossRef] [Scilit]
- Mareta, R.; Lee, H. Compact 2 17 NTT architecture for fully homomorphic encryption. In Proceedings of the 2024 IEEE International Symposium on Circuits and Systems (ISCAS); IEEE: New York, NY, USA, 2024; pp. 1–5. [Google Scholar]
- Gharibyar, M.; Krüger, C.; Schoop, D. Towards Efficient Cloud Data Processing: A Comprehensive Guide to CKKS Parameter Selection. In Proceedings of the 11th International Conference on Information Systems Security and Privacy-Volume 2: ICISSP; INSTICC: Lisboa, Portugal; SciTePress: Setúbal, Portugal, 2025; pp. 502–509. [Google Scholar] [CrossRef] [Scilit]
- Al Mamun, A.; Yates, K.; Rakotondrafara, A.; Chowdhury, M.; Cartor, R.; Gao, S. Experimental evaluation of post-quantum homomorphic encryption for privacy-preserving v2x communication. arXiv 2025, arXiv:2508.02461. [Google Scholar]
- Samardzic, N. Making Computation on Encrypted Data Practical Through Hardware Acceleration of Fully Homomorphic Encryption. Ph.D. Thesis, Massachusetts Institute of Technology, Cambridge, MA, USA, 2022. [Google Scholar]
- Mukherjee, T. Cyclotomic Polynomials in Ring-LWE Homomorphic Encryption Schemes. Master’s Thesis, Rochester Institute of Technology, Rochester, NY, USA, 2016. [Google Scholar]
- Lyubashevsky, V.; Peikert, C.; Regev, O. On ideal lattices and learning with errors over rings. In Proceedings of the EUROCRYPT 2010; Springer: Berlin/Heidelberg, Germany, 2010; pp. 1–23. [Google Scholar]
- Fan, J.; Vercauteren, F. Somewhat Practical Fully Homomorphic Encryption. Technical Report 2012/144; IACR Cryptology ePrint Archive. 2012. Available online: https://eprint.iacr.org/2012/144.pdf (accessed on 27 May 2026).
- Barrett, P. Implementing the Rivest Shamir and Adleman public key encryption algorithm on a standard digital signal processor. In Advances in Cryptology—CRYPTO’86; Springer: Berlin/Heidelberg, Germany, 1986; pp. 311–323. [Google Scholar]
- Satriawan, A.; Mareta, R.; Lee, H. Integer modular multiplication with Barrett reduction and its variants for homomorphic encryption applications: A comprehensive review and an empirical study. IEEE Access 2024, 12, 147283–147300. [Google Scholar] [CrossRef] [Scilit]
- Halevi, S.; Shoup, V. Design and implementation of a homomorphic-encryption library. IBM J. Res. Dev. 2018, 62, 1–42. [Google Scholar]
- Shivdikar, K.; Jonatan, G.; Mora, E.; Livesay, N.; Agrawal, R.; Joshi, A.; Abellán, J.L.; Kim, J.; Kaeli, D. Accelerating polynomial multiplication for homomorphic encryption on GPUs. In Proceedings of the 2022 IEEE International Symposium on Secure and Private Execution Environment Design (SEED); IEEE: New York, NY, USA, 2022; pp. 61–72. [Google Scholar]
- Gentry, C. A Fully Homomorphic Encryption Scheme. Ph.D. Thesis, Stanford University, Stanford, CA, USA, 2009. [Google Scholar]
- Munjal, K.; Bhatia, R. A systematic review of homomorphic encryption and its contributions in healthcare industry. Complex Intell. Syst. 2022, 9, 3759–3786. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- van Dijk, M.; Gentry, C.; Halevi, S.; Vaikuntanathan, V. Fully Homomorphic Encryption over the Integers. In Proceedings of the Advances in Cryptology-EUROCRYPT 2010; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2010; Volume 6110, pp. 24–43. [Google Scholar] [CrossRef] [Scilit]
- Brakerski, Z.; Gentry, C.; Vaikuntanathan, V. (Leveled) Fully Homomorphic Encryption Without Bootstrapping. In Proceedings of the 3rd Innovations in Theoretical Computer Science Conference (ITCS); Association for Computing Machinery: New York, NY, USA, 2012. [Google Scholar] [CrossRef] [Scilit]
- Gentry, C.; Sahai, A.; Waters, B. Homomorphic Encryption from Learning with Errors: Conceptually-Simpler, Asymptotically-Faster, Attribute-Based. In Proceedings of the CRYPTO 2013; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2013. [Google Scholar] [CrossRef] [Scilit]
- Lepoint, T.; Naehrig, M. FHEW: Bootstrapping Homomorphic Encryption in Less Than a Second. In Proceedings of the EUROCRYPT 2015; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2015. [Google Scholar] [CrossRef] [Scilit]
- Chillotti, I.; Gama, N.; Georgieva, M.; Izabachène, M. TFHE: Fast Fully Homomorphic Encryption over the Torus. J. Cryptol. 2019, 33, 34–91. [Google Scholar] [CrossRef] [Scilit]
- Huynh, D. CKKS Explained, Part 2: Full Encoding and Decoding. 2025. Available online: https://openmined.org/blog/ckks-explained-part-2-ckks-encoding-and-decoding/ (accessed on 23 May 2025).
- Huynh, D. CKKS Explained, Part 3: Encryption and Decryption. 2025. Available online: https://openmined.org/blog/ckks-explained-part-3-encryption-and-decryption/ (accessed on 23 May 2025).
- Huynh, D. CKKS Explained, Part 4: Multiplication and Relinearization. 2025. Available online: https://openmined.org/blog/ckks-explained-part-4-multiplication-and-relinearization/ (accessed on 23 May 2025).
- Huynh, D. CKKS Explained, Part 5: Rescaling. 2025. Available online: https://openmined.org/blog/ckks-explained-part-5-rescaling/ (accessed on 23 May 2025).
- Microsoft SEAL Team. Microsoft SEAL Homomorphic Encryption Library. Microsoft Research. Parameter Selection and Security Levels. 2023. Available online: https://github.com/Microsoft/SEAL (accessed on 1 January 2026).
- Regev, O. On lattices, learning with errors, random linear codes, and cryptography. J. ACM (JACM) 2009, 56, 1–40. [Google Scholar] [CrossRef] [Scilit]
- Albrecht, M.R.; Player, R.; Scott, S. On the concrete hardness of learning with errors. J. Math. Cryptol. 2015, 9, 169–203. [Google Scholar] [CrossRef] [Scilit]
- Chen, Y.; Nguyen, P.Q. BKZ 2.0: Better lattice security estimates. In Proceedings of the International Conference on the Theory and Application of Cryptology and Information Security; Springer: Berlin/Heidelberg, Germany, 2011; pp. 1–20. [Google Scholar]
- Microsoft SEAL (Release 3.5), Microsoft Research: Redmond, WA, USA, 2020. Available online: https://github.com/Microsoft/SEAL (accessed on 1 January 2026).
- Hati, I.N.K. A brief summary of the full RNS variant of some homomorphic encryptions. J. Mod. Technol. Eng. 2023, 8, 112–118. [Google Scholar]
- Duong, P.N.; Lee, H. Pipelined key switching accelerator architecture for CKKS-based fully homomorphic encryption. Sensors 2023, 23, 4594. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Roma, C.A. Hardware Implementation of Barrett Reduction Exploiting Constant Multiplication. Ph.D. Thesis, University of Waterloo, Waterloo, ON, Canada, 2019. [Google Scholar]
- Cabrero-Holgueras, J.; Pastrana, S. Towards automated homomorphic encryption parameter selection with fuzzy logic and linear programming. Expert Syst. Appl. 2023, 233, 120941. [Google Scholar] [CrossRef] [Scilit]
- Fan, S.; Deng, X.; Tian, Z.; Hu, Z.; Chang, L.; Hou, R.; Meng, D.; Zhang, M. Taiyi: A High-Performance CKKS Accelerator for Practical Applications. arXiv 2024, arXiv:2403.10188. [Google Scholar]
- Li, Q.; Zong, R. A GPU-Accelerated FHE Framework with Its Application to High-Throughput CKKS Bootstrapping. arXiv 2025, arXiv:2503.22227. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.