Table of Contents
Fetching ...

Efficient Mod Approximation and Its Applications to CKKS Ciphertexts

Yufei Zhou

TL;DR

This paper tackles the challenge of performing mod operations under CKKS by introducing a full-range, polynomial-approximation of $\operatorname{ModP}(x,p)$ using Chebyshev series and interpolation. It provides two data packing schemes, BitStack and CRTStack, to maximize CKKS plaintext space for small integers, and demonstrates applications to homomorphic rounding and a complete secret-share-to-CKKS conversion. Experimental results show high approximation accuracy up to $\sim10^{-8}$ and substantial gains in data packing throughput and upload efficiency, with favorable comparisons to Transcipher-based approaches. Overall, the work extends CKKS functionality to modular operations, enabling broader privacy-preserving computations on encrypted data in resource-constrained settings.

Abstract

The mod function plays a critical role in numerous data encoding and cryptographic primitives. However, the widely used CKKS homomorphic encryption (HE) scheme supports only arithmetic operations, making it difficult to perform mod computations on encrypted data. Approximating the mod function with polynomials has therefore become an important yet challenging problem. The discontinuous and periodic characteristics of the mod function make it particularly difficult to approximate accurately under HE. Existing homomorphic mod constructions provide accurate results only within limited subranges of the input range, leaving the problem of achieving accurate approximation across the full input range unresolved. In this work, we propose a novel method based on polynomial interpolation and Chebyshev series to accurately approximate the mod function. Building upon this, we design two efficient data packing schemes, BitStack and CRTStack, tailored for small-integer inputs in CKKS. These schemes significantly improve the utilization of the CKKS plaintext space and enable efficient ciphertext uploads. Furthermore, we apply the proposed HE mod function to implement a homomorphic rounding operation and a general transformation from additive secret sharing to CKKS ciphertexts, achieving accurate ciphertext rounding and complete secret-share-to-CKKS conversion. Experimental results demonstrate that our approach achieves high approximation accuracy (up to 1e-8). Overall, our work provides a practical and general solution for performing mod operations under CKKS, extending its applicability to a broader range of privacy-preserving computations.

Efficient Mod Approximation and Its Applications to CKKS Ciphertexts

TL;DR

This paper tackles the challenge of performing mod operations under CKKS by introducing a full-range, polynomial-approximation of using Chebyshev series and interpolation. It provides two data packing schemes, BitStack and CRTStack, to maximize CKKS plaintext space for small integers, and demonstrates applications to homomorphic rounding and a complete secret-share-to-CKKS conversion. Experimental results show high approximation accuracy up to and substantial gains in data packing throughput and upload efficiency, with favorable comparisons to Transcipher-based approaches. Overall, the work extends CKKS functionality to modular operations, enabling broader privacy-preserving computations on encrypted data in resource-constrained settings.

Abstract

The mod function plays a critical role in numerous data encoding and cryptographic primitives. However, the widely used CKKS homomorphic encryption (HE) scheme supports only arithmetic operations, making it difficult to perform mod computations on encrypted data. Approximating the mod function with polynomials has therefore become an important yet challenging problem. The discontinuous and periodic characteristics of the mod function make it particularly difficult to approximate accurately under HE. Existing homomorphic mod constructions provide accurate results only within limited subranges of the input range, leaving the problem of achieving accurate approximation across the full input range unresolved. In this work, we propose a novel method based on polynomial interpolation and Chebyshev series to accurately approximate the mod function. Building upon this, we design two efficient data packing schemes, BitStack and CRTStack, tailored for small-integer inputs in CKKS. These schemes significantly improve the utilization of the CKKS plaintext space and enable efficient ciphertext uploads. Furthermore, we apply the proposed HE mod function to implement a homomorphic rounding operation and a general transformation from additive secret sharing to CKKS ciphertexts, achieving accurate ciphertext rounding and complete secret-share-to-CKKS conversion. Experimental results demonstrate that our approach achieves high approximation accuracy (up to 1e-8). Overall, our work provides a practical and general solution for performing mod operations under CKKS, extending its applicability to a broader range of privacy-preserving computations.
Paper Structure (32 sections, 34 equations, 5 figures, 10 tables)

This paper contains 32 sections, 34 equations, 5 figures, 10 tables.

Figures (5)

  • Figure 1: Example of approximated $\operatorname{ModP}(x,9)$ over $[-18, 18]$. The polynomial degree of Ours is $80$.
  • Figure 2: Examples of combinations. Use VecConcat to pack 6 data items into 4 vectors, then apply CRTStack (moduli 9, 10) to obtain 2 stacked vectors, and finally use ImgConcat to merge them into one complex vector.
  • Figure 3: Minimum and maximum Chebyshev coefficients for approximation polynomials of different degrees. The approximation interval is $[0, 29]$.
  • Figure 4: Comparison of point-wise approximation absolute errors over $[0,29]$ with approximation polynomial degree $50$.
  • Figure 5: Comparison of different packing combinations.