Introduction
Encryption protects the confidentiality of data in storage and communication, but conventional computation requires exposing that data in plaintext, problematic for sattistical analysis, machine-learning inference, and other computations on confidential data. Homomorphic encryption allows a server to compute directly on ciphertexts: The server need not hold the decryption key or receive the intermediate plaintext values. This makes homomorphic encryption a natural approach to computation on private data, but its computational overhead has remained a central obstacle.
For numerical computation, this overhead depends on both the security parameter and the precision of the values being processed. A basic operation is fixed-point multiplication: given two numbers represented to n n n bits of precision, compute their product to the required precision. In plaintext, this operation reduces to integer multiplication and rounding, and admits quasilinear bit complexity [6 , 25 ] . It is natural to ask how much additional work is necessary when the inputs and output must remain encrypted. We focus on the cost of multiplying a single pair of high-precision numbers, including the cost of maintaining ciphertexts for subsequent computation.
Homomorphic encryption schemes based on Ring-Learning With Errors (RLWE) [31 ] provide efficient arithmetic on encrypted data by batching multiple slots with SIMD. BFV [5 , 18 ] and BGV [4 ] support exact arithmetic over plaintext rings, while CKKS [13 ] supports approximate arithmetic on vectors of real or complex numbers. Their ability to pack many values into one ciphertext can amortize the cost of a ring operation across many independent computations. For a single high-precision value, however, the cost of the entire ciphertext must be accounted for. In the standard CKKS encoding, n n n bits of precision require a scale factor larger than n n n bits, and multiplication followed by rescaling consumes a comparable number of modulus bits. The ciphertext modulus must accommodate this scale, while the ring dimension must also grow linearly to maintain security as the modulus increases [1 ] . Consequently, the conventional representation entails a quadratic dependence on input plaintext size, even before accounting for the cost of arithmetic on ciphertexts.
One can instead represent the inputs as encrypted bits or small digits and evaluate an arithmetic circuit, as in the gate-bootstrapping approach of TFHE [10 ] . In particular, Liu and Wang [LW23] achieve an amortized bit cost of O ~ ( λ ) \widetilde{O}(\lambda) O ( λ ) per gate through batch bootstrapping. However, applied to a multiplication circuit of size O ( M ( n ) ) O(M(n)) O ( M ( n )) , this gives a O ~ ( λ M ( n ) ) \widetilde{O}(\lambda M(n)) O ( λ M ( n )) bound, where M ( n ) M(n) M ( n ) denotes the cost of plaintext integer multiplication. Thus, batching alone does not establish a bound matching plaintext multiplication when the security parameter is considered to be large.
We study this question in a model that permits preprocessing depending on the parameters, but independent of the inputs. The preprocessing can be reused across subsequent computations; the online cost measures the work performed once the inputs are available. Our central question is:
Can encrypted fixed-point multiplication match the asymptotic cost of plaintext multiplication in an appropriate security regime, including the bootstrapping needed for continued computation, with fixed input-independent preprocessing?
Contributions
Our starting point is focused encoding , which represents a single number at n = Θ ( N log N ) n = \Theta(N \log N) n = Θ ( N log N ) bits of precision with a polynomial of degree N N N with polynomially bounded coefficients. We employ a focal element, shaping the error to be exponentially small at the focus embedding and polynomially bounded elsewhere. As a result, we obtain quasilinear levelled multiplication. However, conventional bootstrapping goes through an ordinary coefficient encoding at the full message precision, reintroducing quadratic complexity.
We overcome this bottleneck by bootstrapping the small coefficients of the encoded polynomial, and then restoring the focused error shape. To do this, we find a polynomial that is multiple of the focal element that is congruent to one modulo the output modulus, which is obtained as a product of focal element and its modular inverse. Multiplying the polynomial to the ciphertext before rescaling, this preserves the message while giving the error the desired shape. While this requires additional modulus to absorb the noise amplification, it is sufficient to yield quasilinear bootstrapping which preserves the message precision.
Then, to reduce the remaining logarithmic overhead, we perform coefficient bootstrapping over a smaller subring. As precision grows, the full ring exceeds the ring dimension needed for secure bootstrapping at the chosen modulus and security parameter λ \lambda λ . Hence, we sample the secret key from the subring, which allows us to split the ciphertext into components and be bootstrapped separately. After recombining the refreshed components, we use the focal element u u u to shape their combined error.
Together, these techniques give quasilinear levelled encrypted multiplication and bootstrapping whose cost is quasilinear in the precision and polylogarithmic in the security parameter. We allow fixed, input-independent preprocessing, which may take exponential time and is reusable across computations.
Theorem 1.1 (Informal). Using an O ( n log n ) O(n \log n) O ( n log n ) -time integer multiplication algorithm, levelled encrypted fixed-point multiplication at n n n -bit precision has online time complexity O ( n log n ) O(n \log n) O ( n log n ) for any fixed multiplicative depth, provided λ = O ( n / log 2 n ) \lambda= O(n/\log^{2} n) λ = O ( n / log 2 n ) . Including bootstrapping for continued computation, the online time per multiplication is O ( n log n + n ( log λ ) 3 log log λ ) O(n \log n + n(\log\lambda)^3 \log\log\lambda) O ( n log n + n ( log λ ) 3 log log λ ) , provided λ = O ( n / log 3 n ) \lambda= O(n/\log^{3} n) λ = O ( n / log 3 n ) .
The formal statements are given in Theorems 3.8, 3.10 and 3.11.
We also give an input encoder of quasilinear time complexity that passes through intermediate encodings in a tower of cyclotomic rings, avoiding the quadratic expansion of the direct encoding formula.
Related Works
High-Precision Homomorphic Arithmetic
Several works reduce the cost of high-precision arithmetic by changing the plaintext representation. CLPX [16 ] uses polynomial plaintext moduli to represent large integers with reduced noise growth, and GBFV [19 ] extends this approach to support SIMD packing and bootstrapping. Geelen and Vercauteren [20 ] improve GBFV bootstrapping by evaluating SlotToCoeff entirely in GBFV and reducing the work performed in ordinary BFV. Kim [27 ] instead bootstraps the ciphertext noise through CKKS, supporting large-precision GBFV instances, including CLPX. These results concern modular arithmetic with a limited choice of modulus.
On the other hand, Gao and Zheng [21 ] implement modular arithmetic on top of CKKS by representing words across multiple CKKS slots. Wei et al. [35 ] and Liu et al. [30 ] extend this approach to large prime moduli and arbitrary plaintext moduli, respectively, with conversions to Boolean or digit representations using a constant number of bootstrapping calls. Jang and Lee [26 ] also support large-characteristic finite-field arithmetic, including modular arithmetic, through bi-spectral encoding. However, without restrictions on the plaintext modulus, their encoding conversions require dense n × n n \times n n × n matrix, incurring Ω ( n 2 ) \Omega(n^{2}) Ω ( n 2 ) bit complexity, despite the constant number of bootstrapping calls.
We note that there is no straightforward method to reduce fixed-point arithmetic to modular arithmetic with fixed modulus without additional operations like bit decomposition.
For approximate arithmetic, Tuple-CKKS [7 ] decomposes ciphertexts into multiple components, but there is no known methods for bootstrapping Tuple-CKKS ciphertexts. High-precision bootstrapping has also been developed through improved modular approximation [29 ] , repeated bootstrapping in Meta-BTS [2 ] , and discrete-CKKS-based precision enhancement [14 ] . While these techniques improve the precision of bootstrapping, it does not achieve quasilinear complexity for a multiplication.
We obtain a fixed-point encrypted multiplication algorithm in quasilinear complexity, and obtain the same complexity as plaintext under certain security conditions.
Concurrent Work
Several concurrent works trade slot capacity for precision in approximate homomorphic encryption, using a public ring element to suppress error on focus slots while allowing larger error in background slots. Dumezy [17 ] proposes a framework including bootstrapping, but their bootstrapping passes through an ordinary coefficient encoding, whose scale and base modulus must accommodate the full target precision. Thus, n n n -bit precision still requires Ω ( n ) \Omega(n) Ω ( n ) modulus bits at this stage, giving at least quadratic time complexity. Ma et al. [34 ] introduce a similar framework named GCKKS, which did not contain bootstrapping. Their follow-up work [33 ] combines low-precision overflow extraction with iterative ciphertext splitting and precision doubling. However, the ciphertext count doubles at each cleaning stage, costing O ( n ) O(n) O ( n ) homomorphic ring operations to reach n n n -bit precision. Liang et al. [28 ] extends to different precision requirements across slots, but does not contain bootstrapping. Meanwhile, our earlier preprint [15 ] presented the framework as focused encoding and bootstrapping using focal units.
Our present construction is the first to obtain quasilinear complexity in fixed-point multiplication including bootstrapping, and we achieve this by refreshing the small coefficients over a subring and then restores the focused error shape, avoiding this expansion into many full-ring ciphertexts.
Preliminaries
Notations
Write [ d ] = { 0 , … , d − 1 } [d] = \{0, \ldots, d - 1\} [ d ] = { 0 , … , d − 1 } . Let ⊙ \odot ⊙ denote componentwise multiplication, and e r e_r e r the r r r -th standard basis vector, indexed by r ∈ [ d ] r \in[d] r ∈ [ d ] . log \log log denotes the logarithm with base 2.
Let N N N be a power-of-two integer, and denote R = Z [ X ] / ( X N + 1 ) \mathcal{R} = \mathbb{Z}[X]/(X^N + 1) R = Z [ X ] / ( X N + 1 ) , K = Q [ X ] / ( X N + 1 ) \mathcal{K} = \mathbb{Q}[X]/(X^N + 1) K = Q [ X ] / ( X N + 1 ) , K R = K ⊗ Q R = R [ X ] / ( X N / 2 − i ) \mathcal{K}_{\mathcal{R}} = \mathcal{K} \otimes_{\mathbb{Q}} \mathcal{R} = \mathbb{R}[X]/(X^{N/2} - i) K R = K ⊗ Q R = R [ X ] / ( X N /2 − i ) . The ℓ ∞ \ell^\infty ℓ ∞ , ℓ 2 \ell^2 ℓ 2 , and ℓ 1 \ell^1 ℓ 1 -norms on K R \mathcal{K}_{\mathcal{R}} K R are defined with respect to its real coefficient vector. Given m ∈ K R = C [ X ] / ( X N / 2 − i ) m \in\mathcal{K}_{\mathcal{R}} = \mathbb{C}[X]/(X^{N/2} - i) m ∈ K R = C [ X ] / ( X N /2 − i ) , [ m ] ∈ C N / 2 [m] \in\mathbb{C}^{N/2} [ m ] ∈ C N /2 denotes its complex coefficient vector.
For m ∈ K m \in\mathcal{K} m ∈ K and a modulus Q Q Q , [ m ] Q [m]_Q [ m ] Q denotes the centered remainder mod Q Q Q . For m ∈ K R m \in\mathcal{K}_{\mathcal{R}} m ∈ K R , [ m ] ∈ R [m] \in\mathcal{R} [ m ] ∈ R denotes coefficientwise rounding to the nearest integer. Given an invertible element u ∈ R Q u \in\mathcal{R}_Q u ∈ R Q , denote its modular inverse as [ u − 1 ] Q [u^{-1}]_Q [ u − 1 ] Q .
For a positive integer M M M , write ζ M = exp ( 2 π i / M ) \zeta_M = \exp(2\pi i/M) ζ M = exp ( 2 π i / M ) , and set ζ = ζ 2 N \zeta= \zeta_{2N} ζ = ζ 2 N . For j ∈ [ N / 2 ] j \in[N/2] j ∈ [ N /2 ] , σ j : K R → C \sigma_j : \mathcal{K}_{\mathcal{R}} \to\mathbb{C} σ j : K R → C denotes evaluation at ζ 5 j \zeta^{5j} ζ 5 j , and the canonical embedding is σ ( m ) = ( σ j ( m ) ) j ∈ [ N / 2 ] ∈ C N / 2 \sigma(m) = (\sigma_j(m))_{j \in[N/2]} \in\mathbb{C}^{N/2} σ ( m ) = ( σ j ( m ) ) j ∈ [ N /2 ] ∈ C N /2 . For m ∈ K R m \in\mathcal{K}_{\mathcal{R}} m ∈ K R , its canonical norm is ∥ m ∥ ∞ c a n = ∥ σ ( m ) ∥ ∞ \lVert m\rVert_\infty^{\mathrm{can}} = \lVert\sigma(m)\rVert_\infty ∥ m ∥ ∞ can = ∥ σ ( m ) ∥ ∞ . Write κ j \kappa_j κ j for the automorphism X ↦ X 5 j X \mapsto X^{5^j} X ↦ X 5 j .
Fixed-Point and Polynomial Multiplication
We concern ourselves with fixed-point multiplication at n n n -bit precision. Given x , y ∈ [ − 1 , 1 ] x,y \in[-1,1] x , y ∈ [ − 1 , 1 ] represented in fixed-point form with n n n fractional bits, the task is to compute an approximation $z satisfying
∣ z − x y ∣ ≤ 2 − n . \lvert z-xy\rvert\le2^{-n}. ∣ z − x y ∣ ≤ 2 − n .
Fixed-point multiplication at n n n -bit precision and modular multiplication with an n n n -bit modulus both have bit complexity O ( M ( n ) ) O(M(n)) O ( M ( n )) , using fast rounding and division [6 ] . Schönhage–Strassen multiplication gives
M ( b ) = O ( b log b log log b ) , M(b)=O(b\log b\log\log b), M ( b ) = O ( b log b log log b ) ,
while Harvey and van der Hoeven [25 ] achieve O ( b log b ) O(b\log b) O ( b log b ) .
For polynomials, consider binary representation of coefficients. We denote M ( N , b ) M(N,b) M ( N , b ) to be the bit cost of multiplying two polynomials of degree less than N N N with coefficients of b b b -bit size. By Kronecker substitution [6 ] ,
M ( N , b ) = O ( M ( N ( b + log N ) ) ) . M(N,b)=O(M(N(b+\log N))). M ( N , b ) = O ( M ( N ( b + log N ))) .
Residue Number System (RNS) and Number Theoretic Transform (NTT) representation can reduce the time complexity for specific cases, but we do not consider them here.
CKKS Scheme
CKKS [13 ] is an RLWE-based levelled homomorphic encryption scheme that supports approximate computation on a vector of complex numbers. Fix an error distribution χ \chi χ on R \mathcal{R} R within ∥ e ∥ ∞ ≤ Σ \lVert e\rVert_\infty\le\Sigma ∥ e ∥ ∞ ≤ Σ , e.g. a discrete Gaussian truncated at Σ \Sigma Σ . It consists of the following algorithms.
KeyGen(1 λ 1^\lambda 1 λ ). Samples a secret key s k ← H W T ( h ) \mathsf{sk}\leftarrow\mathcal{HWT}(h) sk ← H W T ( h ) , whose coefficient vector is uniform over { 0 , ± 1 } N \{0,\pm1\}^{N} { 0 , ± 1 } N of Hamming weight h h h .
Ecd(z ; Δ z;\Delta z ; Δ ). Given z ∈ C N / 2 z\in\mathbb{C}^{N/2} z ∈ C N /2 and a scaling factor Δ \Delta Δ , returns ⌊ Δ σ − 1 ( z ) ⌉ ∈ R \lfloor\Delta\sigma^{-1}(z)\rceil\in\mathcal{R} ⌊ Δ σ − 1 ( z )⌉ ∈ R .
Dcd(p t ; Δ \mathsf{pt};\Delta pt ; Δ ). Given p t ∈ R \mathsf{pt}\in\mathcal{R} pt ∈ R , returns σ ( p t ) / Δ ∈ C N / 2 \sigma(\mathsf{pt})/\Delta\in\mathbb{C}^{N/2} σ ( pt ) /Δ ∈ C N /2 .
Encs k ( p t ) _{\mathsf{sk}}(\mathsf{pt}) sk ( pt ) . Given p t ∈ R \mathsf{pt}\in\mathcal{R} pt ∈ R , samples a uniform mask a ∈ R Q a\in\mathcal{R}_{Q} a ∈ R Q and an error e E n c ← χ e_{\mathrm{Enc}}\leftarrow\chi e Enc ← χ , and returns ( p t , 0 ) + ( − a ⋅ s k + e E n c , a ) (\mathsf{pt},0)+(-a\cdot\mathsf{sk}+e_{\mathrm{Enc}},a) ( pt , 0 ) + ( − a ⋅ sk + e Enc , a ) .
Decs k ( c t ) _{\mathsf{sk}}(\mathsf{ct}) sk ( ct ) . Given c t = ( b , a ) ∈ R Q 2 \mathsf{ct}=(b,a)\in\mathcal{R}_{Q}^{2} ct = ( b , a ) ∈ R Q 2 , returns [ b + a ⋅ s k ] Q [b+a\cdot\mathsf{sk}]_{Q} [ b + a ⋅ sk ] Q .
KSs k → s k ′ ( c t ) _{\mathsf{sk}\to\mathsf{sk}'}(\mathsf{ct}) sk → sk ′ ( ct ) . Given c t = ( b , a ) ∈ R Q 2 \mathsf{ct}=(b,a)\in\mathcal{R}_{Q}^{2} ct = ( b , a ) ∈ R Q 2 under key s k \mathsf{sk} sk and a switching key s w k s k → s k ′ ∈ R P Q 2 \mathsf{swk}_{\mathsf{sk}\to\mathsf{sk}'}\in\mathcal{R}_{PQ}^{2} swk sk → sk ′ ∈ R P Q 2 , an encryption of P ⋅ s k P\cdot\mathsf{sk} P ⋅ sk under s k ′ \mathsf{sk}' sk ′ for an auxiliary modulus P P P , returns
K S s k → s k ′ ( c t ) = ( b , 0 ) + ⌊ P − 1 a ⋅ s w k s k → s k ′ ⌉ ∈ R Q 2 . \mathrm{KS}_{\mathsf{sk}\to\mathsf{sk}'}(\mathsf{ct})=(b,0)+\left\lfloor P^{-1}a\cdot\mathsf{swk}_{\mathsf{sk}\to\mathsf{sk}'}\right\rceil\in\mathcal{R}_{Q}^{2}. KS sk → sk ′ ( ct ) = ( b , 0 ) + ⌊ P − 1 a ⋅ swk sk → sk ′ ⌉ ∈ R Q 2 .
RSq ( c t ) _q(\mathsf{ct}) q ( ct ) . Given c t = ( b , a ) ∈ R Q 2 \mathsf{ct}=(b,a)\in\mathcal{R}_{Q}^{2} ct = ( b , a ) ∈ R Q 2 with q ∣ Q q\mid Q q ∣ Q , returns ( ⌊ q − 1 b ⌉ , ⌊ q − 1 a ⌉ ) ∈ R Q / q 2 (\lfloor q^{-1}b\rceil,\lfloor q^{-1}a\rceil)\in\mathcal{R}_{Q/q}^{2} (⌊ q − 1 b ⌉ , ⌊ q − 1 a ⌉) ∈ R Q / q 2 .
Add( c t 1 , c t 2 ) (\mathsf{ct}_1,\mathsf{ct}_2) ( ct 1 , ct 2 ) returns c t 1 + c t 2 ∈ R Q 2 \mathsf{ct}_1+\mathsf{ct}_2\in\mathcal{R}_{Q}^{2} ct 1 + ct 2 ∈ R Q 2 .
Mult( c t 1 , c t 2 ) (\mathsf{ct}_1,\mathsf{ct}_2) ( ct 1 , ct 2 ) . Given c t i = ( b i , a i ) ∈ R Q 2 \mathsf{ct}_i=(b_i,a_i)\in\mathcal{R}_{Q}^{2} ct i = ( b i , a i ) ∈ R Q 2 , computes ( d 0 , d 1 , d 2 ) = ( b 1 b 2 , a 1 b 2 + a 2 b 1 , a 1 a 2 ) (d_0,d_1,d_2)=(b_1b_2,a_1b_2+a_2b_1,a_1a_2) ( d 0 , d 1 , d 2 ) = ( b 1 b 2 , a 1 b 2 + a 2 b 1 , a 1 a 2 ) and returns
R S Δ ( ( d 0 , d 1 ) + K S s k 2 → s k ( ( 0 , d 2 ) ) ) ∈ R Q / Δ 2 . \mathrm{RS}_{\Delta}\left((d_0,d_1)+\mathrm{KS}_{\mathsf{sk}^{2}\to\mathsf{sk}}((0,d_2))\right)\in\mathcal{R}_{Q/\Delta}^{2}. RS Δ ( ( d 0 , d 1 ) + KS sk 2 → sk (( 0 , d 2 )) ) ∈ R Q /Δ 2 .
Autκ ( c t ) _\kappa(\mathsf{ct}) κ ( ct ) . Given c t = ( b , a ) \mathsf{ct}=(b,a) ct = ( b , a ) and κ ∈ Gal ( K / Q ) \kappa\in\operatorname{Gal}(\mathcal{K}/\mathbb{Q}) κ ∈ Gal ( K / Q ) , returns K S κ ( s k ) → s k ( ( κ ( b ) , κ ( a ) ) ) \mathrm{KS}_{\kappa(\mathsf{sk})\to\mathsf{sk}}((\kappa(b),\kappa(a))) KS κ ( sk ) → sk (( κ ( b ) , κ ( a ))) .
The following correctness lemmas record worst-case error bounds that are well-established.
Lemma 2.1 (Encryption). Given a message m ∈ R m \in\mathcal{R} m ∈ R , its encryption c t = Enc s k ( m ) \mathrm{ct} = \operatorname{Enc}_{\mathrm{sk}}(m) ct = Enc sk ( m ) satisfies
Dec s k ( c t ) = m + e E n c ( m o d Q ) , ∥ e E n c ∥ ∞ c a n ≤ E E n c : = N Σ . \operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}) = m + e_{\mathrm{Enc}} \pmod{Q}, \qquad\lVert e_{\mathrm{Enc}} \rVert_{\infty}^{\mathrm{can}} \le E_{\mathrm{Enc}} := N\Sigma. Dec sk ( ct ) = m + e Enc ( mod Q ) , ∥ e Enc ∥ ∞ can ≤ E Enc := N Σ.
Lemma 2.2 (Key-switching and rescale). Suppose q ∣ Q q \mid Q q ∣ Q and P ≥ Q P \ge Q P ≥ Q . Given a ciphertext c t ∈ R Q 2 \mathrm{ct} \in\mathcal{R}_{Q}^{2} ct ∈ R Q 2 ,
Dec s k ′ ( KS s k → s k ′ ( c t ) ) = Dec s k ( c t ) + e K S ( m o d Q ) , ∥ e K S ∥ ∞ c a n ≤ E K S : = N 2 Σ 2 + 1 + h 2 N , \operatorname{Dec}_{\mathrm{sk}'}\bigl(\operatorname{KS}_{\mathrm{sk}\to\mathrm{sk}'}(\mathrm{ct})\bigr) = \operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}) + e_{\mathrm{KS}} \pmod{Q}, \qquad\lVert e_{\mathrm{KS}} \rVert_{\infty}^{\mathrm{can}} \le E_{\mathrm{KS}} := \frac{N^{2}\Sigma}{2} + \frac{1+h}{2}N, Dec sk ′ ( KS sk → sk ′ ( ct ) ) = Dec sk ( ct ) + e KS ( mod Q ) , ∥ e KS ∥ ∞ can ≤ E KS := 2 N 2 Σ + 2 1 + h N , Dec s k ( RS q ( c t ) ) = 1 q Dec s k ( c t ) + e R S ( m o d Q / q ) , ∥ e R S ∥ ∞ c a n ≤ E R S : = 1 + h 2 N . \operatorname{Dec}_{\mathrm{sk}}\bigl(\operatorname{RS}_{q}(\mathrm{ct})\bigr) = \frac{1}{q}\operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}) + e_{\mathrm{RS}} \pmod{Q/q}, \qquad\lVert e_{\mathrm{RS}} \rVert_{\infty}^{\mathrm{can}} \le E_{\mathrm{RS}} := \frac{1+h}{2}N. Dec sk ( RS q ( ct ) ) = q 1 Dec sk ( ct ) + e RS ( mod Q / q ) , ∥ e RS ∥ ∞ can ≤ E RS := 2 1 + h N .
We sometimes omit the scale factor in Ecd and Dcd for exposition.
CKKS Bootstrapping
Bootstrapping is a procedure that refreshes a ciphertext whose modulus has been consumed by levelled multiplications, restoring it to a higher level so that computation can continue. The contemporary CKKS bootstrapping algorithms are made of the following steps.
ModRaise. Given a ciphertext c t ∈ R q 0 2 \mathrm{ct} \in\mathcal{R}_{q_{0}}^{2} ct ∈ R q 0 2 encrypting m ∈ R m \in\mathcal{R} m ∈ R and a higher modulus Q > q 0 Q > q_{0} Q > q 0 , returns its lift c t ^ ∈ R Q 2 \hat{\mathrm{ct}} \in\mathcal{R}_{Q}^{2} ct ^ ∈ R Q 2 encrypting m ^ = m + q 0 I \hat{m} = m + q_{0}I m ^ = m + q 0 I for some bounded overflow I ∈ R I \in\mathcal{R} I ∈ R .
C2S. Given a ciphertext encrypting m ^ ∈ R \hat{m} \in\mathcal{R} m ^ ∈ R , evaluates inverse DFT to return a ciphertext encrypting Ecd ( ⟦ m ^ ⟧ ) \operatorname{Ecd}(\llbracket\hat{m} \rrbracket) Ecd ( [ [ m ^ ] ] ) .
EvalMod. Given a ciphertext encrypting Ecd ( ⟦ m ⟧ + q ⟦ I ⟧ ) \operatorname{Ecd}(\llbracket m \rrbracket+ q\llbracket I \rrbracket) Ecd ( [ [ m ] ] + q [ [ I ] ] ) , evaluates modular reduction to remove the overflow and return a ciphertext encrypting Ecd ( ⟦ m ⟧ ) \operatorname{Ecd}(\llbracket m \rrbracket) Ecd ( [ [ m ] ] ) .
S2C. Given a ciphertext encrypting Ecd ( ⟦ m ⟧ ) \operatorname{Ecd}(\llbracket m \rrbracket) Ecd ( [ [ m ] ] ) , evaluates forward DFT to return a ciphertext encrypting m ∈ R m \in\mathcal{R} m ∈ R .
Modulus Raising and Homomorphic Modular Reduction
The ModRaise takes centered remainder of the ciphertext components, so that it encrypts
[ b ] q 0 + [ a ] q 0 ⋅ s k = m + q 0 I . [b]_{q_{0}} + [a]_{q_{0}} \cdot\mathrm{sk} = m + q_{0}I. [ b ] q 0 + [ a ] q 0 ⋅ sk = m + q 0 I .
It introduces the bounded overflow q 0 I ∈ R q_{0}I \in\mathcal{R} q 0 I ∈ R with ∥ I ∥ ∞ ≤ K \lVert I \rVert_{\infty} \le K ∥ I ∥ ∞ ≤ K , K = O ( h ) K = O(h) K = O ( h ) , and rest of the bootstrapping is dedicated to removing the overflow.
The EvalMod evaluates the modular reduction by q 0 q_{0} q 0 to remove the overflow in slots. Classical constructions evaluate polynomials approximating the modular reduction using periodic trigonometric functions [11 , 23 ] .
Homomorphic Discrete Fourier Transformation
The S2C and C2S are forward and inverse Discrete Fourier Transformations; in terms of the slot vector, S2C maps ⟦ m ⟧ \llbracket m \rrbracket [ [ m ] ] to σ ( m ) \sigma(m) σ ( m ) , and C2S maps σ ( m ) \sigma(m) σ ( m ) to ⟦ m ⟧ \llbracket m \rrbracket [ [ m ] ] .
For a power of two n n n , define the DFT matrix
V n = ( ζ 4 n i j ) i , j ∈ [ n ] . V_{n} = \left(\zeta_{4n}^{ij}\right)_{i,j \in[n]}. V n = ( ζ 4 n ij ) i , j ∈ [ n ] .
Then V = V N / 2 V = V_{N/2} V = V N /2 satisfies σ ( m ) = V ⟦ m ⟧ \sigma(m) = V\llbracket m \rrbracket σ ( m ) = V [ [ m ] ] . Thus, S2C evaluates V V V and C2S evaluates V − 1 V^{-1} V − 1 in the slots.
For homomorphic evaluation, we use bit-reversed coefficient order: C2S outputs the coefficients in this order, and S2C accepts them in the same order. The corresponding conversion matrices admit decompositions into log ( N / 2 ) \log(N/2) log ( N /2 ) sparse layers [22 , 8 ] , requiring O ( log N ) O(\log N) O ( log N ) levels and ring operations.
Homomorphic Sign Evaluation
We also introduce homomorphic sign evaluation [12 ] for the cleaning-based bootstrapping. The sign function can be approximated by a repeated composition of a fixed polynomial f f f . Applying the approximation to y / 2 y/2 y /2 gives the circuit Sign q ( y ) \operatorname{Sign}_q(y) Sign q ( y ) below, by specializing [CKK20, App. D, Cor. 6.
Lemma 2.3 (Approximate Sign Evaluation). For every integer q ≥ 2 q \ge2 q ≥ 2 , there is a polynomial circuit Sign q \operatorname{Sign}_q Sign q of size and multiplicative depth O ( log q ) O(\log q) O ( log q ) whose approximate evaluation satisfies
∣ Sign ^ q ( y ) − sgn ( y ) ∣ ≤ 2 − q \left|\widehat{\operatorname{Sign}}_q(y)-\operatorname{sgn}(y)\right| \le2^{-q} Sign q ( y ) − sgn ( y ) ≤ 2 − q for every real y y y with 1 / 2 ≤ ∣ y ∣ ≤ 3 / 2 1/2 \le|y| \le3/2 1/2 ≤ ∣ y ∣ ≤ 3/2 , provided each arithmetic gate introduces error of magnitude at most a sufficiently small constant multiple of 2 − q 2^{-q} 2 − q .
Encrypted Fixed-Point Multiplication by Focused Encoding
We illustrate our fixed-point multiplication within the encrypted setting. Its main ingredient is the focused encoding, which homomorphically encodes a single real number with high precision into a polynomial with small coefficients.
Focused Encoding
We encode a single fixed-point number into the cyclotomic ring R = Z [ X ] / ( X N + 1 ) \mathcal{R} = \mathbb{Z}[X]/(X^N+1) R = Z [ X ] / ( X N + 1 ) with power-of-two dimension N N N using a ‘focal element’ u ∈ R u \in\mathcal{R} u ∈ R .
We control both the approximation error at the focus embedding σ 0 \sigma_0 σ 0 and the magnitude at the remaining embeddings. Hence, we say that m ∈ K R m \in\mathcal{K}_{\mathbb{R}} m ∈ K R encodes z ∈ R z \in\mathbb{R} z ∈ R within error ( ϵ , B ) (\epsilon, B) ( ϵ , B ) at scale Δ > 0 \Delta> 0 Δ > 0 if
∣ 1 Δ σ 0 ( m ) − z ∣ ≤ ϵ , ∣ 1 Δ σ j ( m ) ∣ ≤ B ( j ≠ 0 ) . \left|\frac{1}{\Delta}\sigma_0(m)-z\right| \le\epsilon,\qquad\left|\frac{1}{\Delta}\sigma_j(m)\right| \le B\quad(j\ne0). Δ 1 σ 0 ( m ) − z ≤ ϵ , Δ 1 σ j ( m ) ≤ B ( j = 0 ) .
Focal Element
A focal element is an element which is small at the focus embedding σ 0 \sigma_0 σ 0 , which gives more precision at the embedding with shaped error u e ue u e . We say a focal element u u u has p p p -bit gain and b b b -bit overhead if
log ∣ σ 0 ( u ) ∣ ≤ − p + b , max j ≠ 0 log ∣ σ j ( u ) ∣ ≤ b , (1) \log|\sigma_0(u)| \le-p+b,\qquad\max_{j\ne0}\log|\sigma_j(u)| \le b, \tag*{(1)} log ∣ σ 0 ( u ) ∣ ≤ − p + b , j = 0 max log ∣ σ j ( u ) ∣ ≤ b , (1)
whose meaning is clarified in the following lemma.
Lemma 3.1 (Error shaping by focal element). Suppose u u u is given as in (1). Consider a plaintext m ∈ K R m \in\mathcal{K}_{\mathbb{R}} m ∈ K R encoding z ∈ R z \in\mathbb{R} z ∈ R within error ( ϵ , B ) (\epsilon, B) ( ϵ , B ) , and a shaped error u e ue u e with 2 b ∥ e ∥ ∞ c a n ≤ γ Δ 2^b\|e\|_\infty^{\mathrm{can}} \le\gamma\Delta 2 b ∥ e ∥ ∞ can ≤ γ Δ for some γ > 0 \gamma> 0 γ > 0 . Then, the plaintext m + u e m+ue m + u e encodes z z z within error ( ϵ + 2 − p γ , B + γ ) (\epsilon+2^{-p}\gamma, B+\gamma) ( ϵ + 2 − p γ , B + γ ) .
In particular, such an operation increases the coefficient size by at most γ Δ = Ω ( 2 b ) \gamma\Delta= \Omega(2^b) γ Δ = Ω ( 2 b ) , while having precision of roughly p p p -bit.
Proof. This follows from ∣ σ j ( u e ) ∣ ≤ γ Δ |\sigma_j(ue)| \le\gamma\Delta ∣ σ j ( u e ) ∣ ≤ γ Δ for j ≠ 0 j \ne0 j = 0 and ∣ σ 0 ( u e ) ∣ ≤ 2 − p γ Δ |\sigma_0(ue)| \le2^{-p}\gamma\Delta ∣ σ 0 ( u e ) ∣ ≤ 2 − p γ Δ .
We call a focal element u u u asymptotic if its gain and overhead satisfies
p = Ω ( N log N ) , b = O ( log N ) . p=\Omega(N\log N),\qquad b=O(\log N). p = Ω ( N log N ) , b = O ( log N ) .
As it grants superlinear gain in the ring dimension, it will be a core ingredient of the focused encoding with large precision.
Theorem 3.2 (Existence of a Focal Element). Fix β > 0 \beta> 0 β > 0 . For every sufficiently large power-of-two ring dimension N N N , there is an asymptotic focal element u ∈ R ∖ { 0 } u \in\mathbb{R} \setminus\{0\} u ∈ R ∖ { 0 } which is conjugate-invariant, i.e., u ( X − 1 ) = u ( X ) u(X^{-1}) = u(X) u ( X − 1 ) = u ( X ) , and satisfies
0 < u F = σ 0 ( u ) ≤ N − β N / 2 , ∥ u ∥ ∞ c a n = O ( N β + 1 / 2 log N ) . 0 < u_{\mathrm{F}} = \sigma_0(u) \le N^{-\beta N/2}, \qquad\lVert u\rVert_{\infty}^{\mathrm{can}} = O\left(N^{\beta+1/2}\sqrt{\log N}\right). 0 < u F = σ 0 ( u ) ≤ N − β N /2 , ∥ u ∥ ∞ can = O ( N β + 1/2 log N ) .
Proof. Let c 0 = 1 c_0 = 1 c 0 = 1 and c j = X j + X − j c_j = X^j + X^{-j} c j = X j + X − j for 1 ≤ j < N / 2 1 \le j < N/2 1 ≤ j < N /2 be a conjugate-invariant basis. These satisfy ∣ σ k ( c j ) ∣ ≤ 2 |\sigma_k(c_j)| \le2 ∣ σ k ( c j ) ∣ ≤ 2 . Set B = ⌈ N β ⌉ B = \lceil N^\beta\rceil B = ⌈ N β ⌉ and T = B 4 N log e ( 2 N ) T = B\sqrt{4N\log_e(2N)} T = B 4 N log e ( 2 N ) , and for ϵ ∈ ( [ − B , B ] ∩ Z ) N / 2 \epsilon\in([-B,B] \cap\mathbb{Z})^{N/2} ϵ ∈ ([ − B , B ] ∩ Z ) N /2 , let v ϵ = ∑ j ϵ j c j v_\epsilon= \sum_j \epsilon_j c_j v ϵ = ∑ j ϵ j c j . We will show that there exist ϵ ≠ ϵ ′ \epsilon\ne\epsilon' ϵ = ϵ ′ such that
max { ∥ v ϵ ∥ ∞ c a n , ∥ v ϵ ′ ∥ ∞ c a n } ≤ T , ∣ σ 0 ( v ϵ − v ϵ ′ ) ∣ ≤ 4 T ( 2 B + 1 ) N / 2 − 2 . \max\{\lVert v_\epsilon\rVert_{\infty}^{\mathrm{can}},\lVert v_{\epsilon'}\rVert_{\infty}^{\mathrm{can}}\} \le T,\qquad|\sigma_0(v_\epsilon-v_{\epsilon'})| \le\frac{4T}{(2B+1)^{N/2}-2}. max {∥ v ϵ ∥ ∞ can , ∥ v ϵ ′ ∥ ∞ can } ≤ T , ∣ σ 0 ( v ϵ − v ϵ ′ ) ∣ ≤ ( 2 B + 1 ) N /2 − 2 4 T .
Choose ϵ \epsilon ϵ uniformly at random. For each slot k k k , σ k ( v ϵ ) = ∑ j ϵ j σ k ( c j ) \sigma_k(v_\epsilon)=\sum_j\epsilon_j\sigma_k(c_j) σ k ( v ϵ ) = ∑ j ϵ j σ k ( c j ) is a sum of N / 2 N/2 N /2 independent centered terms bounded by 2 B 2B 2 B , so Hoeffding’s inequality gives
Pr [ ∣ σ k ( v ϵ ) ∣ > T ] ≤ 2 exp ( − T 2 2 B 2 ∑ j σ k ( c j ) 2 ) ≤ 2 exp ( − T 2 4 N B 2 ) = 1 N . \Pr[|\sigma_k(v_\epsilon)|>T]\le2\exp\left(-\frac{T^2}{2B^2\sum_j\sigma_k(c_j)^2}\right)\le2\exp\left(-\frac{T^2}{4NB^2}\right)=\frac{1}{N}. Pr [ ∣ σ k ( v ϵ ) ∣ > T ] ≤ 2 exp ( − 2 B 2 ∑ j σ k ( c j ) 2 T 2 ) ≤ 2 exp ( − 4 N B 2 T 2 ) = N 1 .
A union bound over the N / 2 N/2 N /2 slots gives Pr [ ∥ v ϵ ∥ ∞ c a n > T ] ≤ 1 / 2 \Pr[\lVert v_\epsilon\rVert_{\infty}^{\mathrm{can}}>T]\le1/2 Pr [∥ v ϵ ∥ ∞ can > T ] ≤ 1/2 , so at least ( 2 B + 1 ) N / 2 / 2 (2B+1)^{N/2}/2 ( 2 B + 1 ) N /2 /2 distinct candidates satisfy ∥ v ϵ ∥ ∞ c a n ≤ T \lVert v_\epsilon\rVert_{\infty}^{\mathrm{can}}\le T ∥ v ϵ ∥ ∞ can ≤ T .
Their values at the 0 0 0 -th slot lie in [ − T , T ] [-T,T] [ − T , T ] , so two distinct candidates have difference u = v ϵ − v ϵ ′ ∈ R ∖ { 0 } u=v_\epsilon-v_{\epsilon'}\in\mathbb{R}\setminus\{0\} u = v ϵ − v ϵ ′ ∈ R ∖ { 0 } satisfying
∣ σ 0 ( u ) ∣ ≤ 2 T ( 2 B + 1 ) N / 2 / 2 − 1 , ∥ u ∥ ∞ c a n ≤ 2 T = O ( N β + 1 / 2 log N ) . |\sigma_0(u)|\le\frac{2T}{(2B+1)^{N/2}/2-1},\qquad\lVert u\rVert_{\infty}^{\mathrm{can}}\le2T=O\left(N^{\beta+1/2}\sqrt{\log N}\right). ∣ σ 0 ( u ) ∣ ≤ ( 2 B + 1 ) N /2 /2 − 1 2 T , ∥ u ∥ ∞ can ≤ 2 T = O ( N β + 1/2 log N ) .
Substituting B B B and T T T gives
4 T ( 2 B + 1 ) N / 2 − 2 = O ( 2 − N / 2 N β + 1 / 2 log N ) N − β N / 2 = o ( N − β N / 2 ) , \frac{4T}{(2B+1)^{N/2}-2}
=O\left(2^{-N/2}N^{\beta+1/2}\sqrt{\log N}\right)N^{-\beta N/2}
=o\left(N^{-\beta N/2}\right), ( 2 B + 1 ) N /2 − 2 4 T = O ( 2 − N /2 N β + 1/2 log N ) N − β N /2 = o ( N − β N /2 ) ,
proving the bound at the focus embedding for sufficiently large N N N . We may flip sign to obtain σ 0 ( u ) > 0 \sigma_0(u)>0 σ 0 ( u ) > 0 . □ \square □
Finding such an element is a substantial task, potentially taking 2 O ( N log N ) 2^{O(N\log N)} 2 O ( N l o g N ) . Hence, we admit exponential preprocessing for our algorithm. Finding an asymptotic focal element efficiently is an interesting open problem.
Focused Encoding
Using a focal element u u u , we encode a single real number at the focus embedding, while shaping the rounding error by the element.
Definition 3.3 (Focused Encoding). Given a real number z ∈ R z\in\mathbb{R} z ∈ R and scale factor Δ > 0 \Delta>0 Δ > 0 , the focused encoding is defined as
Ecd [ u ] ( z ; Δ ) = u ⋅ ⌊ Δ u − 1 ⋅ σ − 1 ( z ⋅ e 0 ) ⌉ ∈ R , Dcd [ u ] ( m ; Δ ) = 1 Δ Re σ 0 ( m ) ∈ R . \operatorname{Ecd}^{[u]}(z;\Delta)=u\cdot\left\lfloor\Delta u^{-1}\cdot\sigma^{-1}(z\cdot e_0)\right\rceil\in\mathbb{R},\qquad\operatorname{Dcd}^{[u]}(m;\Delta)=\frac{1}{\Delta}\operatorname{Re}\sigma_0(m)\in\mathbb{R}. Ecd [ u ] ( z ; Δ ) = u ⋅ ⌊ Δ u − 1 ⋅ σ − 1 ( z ⋅ e 0 ) ⌉ ∈ R , Dcd [ u ] ( m ; Δ ) = Δ 1 Re σ 0 ( m ) ∈ R .
Lemma 3.4 (Encoding). Suppose u u u is a focal element with p p p -bit gain and b b b -bit overhead, and γ Δ ≥ 2 b ⋅ E E c d \gamma\Delta\ge2^b\cdot E_{\mathrm{Ecd}} γ Δ ≥ 2 b ⋅ E Ecd for E E c d = N 2 E_{\mathrm{Ecd}}=\frac{N}{2} E Ecd = 2 N . Given z ∈ R z\in\mathbb{R} z ∈ R , Ecd [ u ] ( z ) \operatorname{Ecd}^{[u]}(z) Ecd [ u ] ( z ) encodes z z z within error ( 2 − p γ , γ ) (2^{-p}\gamma,\gamma) ( 2 − p γ , γ ) .
Proof. Let m 0 = Δ σ − 1 ( z e 0 ) ∈ K R m_0=\Delta\sigma^{-1}(ze_0)\in K_{\mathbb{R}} m 0 = Δ σ − 1 ( z e 0 ) ∈ K R , which encodes z z z within error ( 0 , 0 ) (0,0) ( 0 , 0 ) . One has
m : = Ecd [ u ] ( z ; Δ ) = u ⋅ ( u − 1 m 0 + e ) = m 0 + u e m:=\operatorname{Ecd}^{[u]}(z;\Delta)=u\cdot(u^{-1}m_0+e)=m_0+ue m := Ecd [ u ] ( z ; Δ ) = u ⋅ ( u − 1 m 0 + e ) = m 0 + u e
where ∥ e ∥ ∞ ≤ 1 2 \lVert e\rVert_\infty\le\frac{1}{2} ∥ e ∥ ∞ ≤ 2 1 , so that ∥ e ∥ ∞ c a n ≤ 1 2 \lVert e\rVert_\infty^{\mathrm{can}}\le\frac{1}{2} ∥ e ∥ ∞ can ≤ 2 1 . The error bound follows from Theorem 3.1. □ \square □
Efficient Encoding Algorithms
A direct implementation of Ecd [ u ] \operatorname{Ecd}^{[u]} Ecd [ u ] and Dcd [ u ] \operatorname{Dcd}^{[u]} Dcd [ u ] use n n n -bit arithmetic on all N N N coefficients, incurring a nearly quadratic cost in n n n . We give efficient algorithms of both maps using a tower of cyclotomic rings. Encoding ascends the tower, increasing the ring dimension while reducing the coefficient precision. Decoding descends the same tower, decreasing the ring dimension while increasing the coefficient bit lengths. In both directions, the intermediate polynomials have total bit length O ( n ) O(n) O ( n ) , yielding quasilinear complexity.
In this section, we will choose u u u as in Theorem 3.2 with β = 1 \beta= 1 β = 1 for sufficiently large precision n n n , taking the power-of-two dimension N N N to be a sufficiently large constant multiple of n / log n n/\log n n / log n . Then u u u has at least n n n -bit gain and b = O ( log N ) b = O(\log N) b = O ( log N ) -bit overhead.
Reformulating Encoding and Decoding. Consider Δ = 1 \Delta= 1 Δ = 1 for simplicity. For encoding, notice that the core is u ⋅ ⌈ u − 1 m ⌋ u \cdot\lceil u^{-1}m \rfloor u ⋅ ⌈ u − 1 m ⌋ where m ∈ R m \in\mathcal{R} m ∈ R holds the scalar z ∈ R z \in\mathbb{R} z ∈ R at the focus embedding. Instead, we consider computing the shaped rounding
u ⋅ ⌊ u − 1 z ⌉ = z − u ⋅ [ u − 1 z ] 1 , u \cdot\lfloor u^{-1}z \rceil= z - u \cdot[u^{-1}z]_1, u ⋅ ⌊ u − 1 z ⌉ = z − u ⋅ [ u − 1 z ] 1 ,
then adjust the algorithm to output the desired encoding approximately.
For decoding, notice
Re σ 0 ( m ) = 1 2 Tr K / Q ( m ⋅ σ − 1 ( e 0 ) ) . \operatorname{Re}\sigma_0(m) = \frac{1}{2}\operatorname{Tr}_{K/\mathbb{Q}}\left(m \cdot\sigma^{-1}(e_0)\right). Re σ 0 ( m ) = 2 1 Tr K / Q ( m ⋅ σ − 1 ( e 0 ) ) .
In particular, σ 0 ( u ) / u \sigma_0(u)/u σ 0 ( u ) / u approximates σ − 1 ( e 0 ) \sigma^{-1}(e_0) σ − 1 ( e 0 ) with high precision, so we can compute the following instead:
σ 0 ( u ) 2 ⋅ Tr K / Q ( u − 1 m ) . (2) \frac{\sigma_0(u)}{2} \cdot\operatorname{Tr}_{K/\mathbb{Q}}\left(u^{-1}m\right). \tag*{(2)} 2 σ 0 ( u ) ⋅ Tr K / Q ( u − 1 m ) . (2)
Each of these computations can be performed while ascending and descending tower, which admits intermediate representations of bit length O ( n ) O(n) O ( n ) .
Tower of Rings. For 0 ≤ i ≤ log N 0 \leq i \leq\log N 0 ≤ i ≤ log N , define tower of rings
R i = Z [ X i ] / ( X i 2 i + 1 ) , K i = Q [ X i ] / ( X i 2 i + 1 ) , \mathcal{R}_i = \mathbb{Z}[X_i]/(X_i^{2^i} + 1), \qquad\mathcal{K}_i = \mathbb{Q}[X_i]/(X_i^{2^i} + 1), R i = Z [ X i ] / ( X i 2 i + 1 ) , K i = Q [ X i ] / ( X i 2 i + 1 ) ,
where R 0 = Z \mathcal{R}_0 = \mathbb{Z} R 0 = Z and R log N = R \mathcal{R}_{\log N} = \mathcal{R} R l o g N = R , and R i − 1 \mathcal{R}_{i-1} R i − 1 is a subring of R i \mathcal{R}_i R i by identification X i − 1 = X i 2 X_{i-1} = X_i^2 X i − 1 = X i 2 . Then, let u i = N K / K i ( u ) ∈ R i u_i = \operatorname{N}_{K/\mathcal{K}_i}(u) \in\mathcal{R}_i u i = N K / K i ( u ) ∈ R i be a relative norm of u u u . We have
u i − 1 ( X i − 1 ) = u i ( X i ) ⋅ u i ( − X i ) , 1 ≤ i ≤ log N , u_{i-1}(X_{i-1}) = u_i(X_i) \cdot u_i(-X_i), \qquad1 \leq i \leq\log N, u i − 1 ( X i − 1 ) = u i ( X i ) ⋅ u i ( − X i ) , 1 ≤ i ≤ log N ,
so roughly, u − 1 m = u log N − 1 m u^{-1}m = u_{\log N}^{-1}m u − 1 m = u l o g N − 1 m can be computed iteratively from u 0 − 1 m u_0^{-1}m u 0 − 1 m as
u i − 1 ( X i ) ⋅ m = u i ( − X i ) ⋅ ( u i − 1 − 1 ( X i − 1 ) ⋅ m ) . u_i^{-1}(X_i) \cdot m = u_i(-X_i) \cdot\left(u_{i-1}^{-1}(X_{i-1}) \cdot m\right). u i − 1 ( X i ) ⋅ m = u i ( − X i ) ⋅ ( u i − 1 − 1 ( X i − 1 ) ⋅ m ) .
Fractional Ascent
To compute [ u − 1 z ] 1 [u^{-1}z]_1 [ u − 1 z ] 1 , we ascend the tower while approximating [ u i − 1 z ] 1 [u_i^{-1}z]_1 [ u i − 1 z ] 1 by t i ∈ R [ X i ] / ( X i 2 i + 1 ) t_i \in\mathbb{R}[X_i]/(X_i^{2^i} + 1) t i ∈ R [ X i ] / ( X i 2 i + 1 ) . The details are given in Algorithm 1.
Lemma 3.5 (Correctness of fractional ascent). For an exactly represented number z ∈ R z \in\mathbb{R} z ∈ R , set precision as
ℓ = ⌈ log ∥ u ∥ 1 ⌉ , p i = N 2 i ( ℓ + 1 ) + 2. \ell= \lceil\log\lVert u \rVert_1 \rceil, \qquad p_i = \frac{N}{2^i}(\ell+ 1) + 2. ℓ = ⌈ log ∥ u ∥ 1 ⌉ , p i = 2 i N ( ℓ + 1 ) + 2. Then Algorithm 1 on input z z z returns t t t satisfying
t = [ u − 1 z + e ] 1 , ∥ e ∥ ∞ ≤ 1 8 ∥ u ∥ 1 . t = [u^{-1}z + e]_1, \qquad\lVert e \rVert_\infty\leq\frac{1}{8\lVert u \rVert_1}. t = [ u − 1 z + e ] 1 , ∥ e ∥ ∞ ≤ 8 ∥ u ∥ 1 1 .
Algorithm 1 Fractional Ascent
Require: Precision ( p i ) i = 0 log N (p_i)_{i=0}^{\log N} ( p i ) i = 0 l o g N , scalar z ∈ R z \in\mathbb{R} z ∈ R and relative norms ( u i ) i = 0 log N (u_i)_{i=0}^{\log N} ( u i ) i = 0 l o g N .
Ensure: An approximation to [ u − 1 z ] 1 [u^{-1}z]_1 [ u − 1 z ] 1 , with coefficients in [ − 1 / 2 , 1 / 2 ] [-1/2,1/2] [ − 1/2 , 1/2 ] .
t 0 ← [ z / u 0 ] 1 t_0 \leftarrow[z/u_0]_1 t 0 ← [ z / u 0 ] 1 ▹ \triangleright ▹ with p 0 p_0 p 0 -bit precision
for i = 1 , … , log N i=1,\ldots,\log N i = 1 , … , log N do
t i ( X i ) ← [ u i ( − X i ) t i − 1 ( X i 2 ) ] 1 t_i(X_i) \leftarrow[u_i(-X_i)t_{i-1}(X_i^2)]_1 t i ( X i ) ← [ u i ( − X i ) t i − 1 ( X i 2 ) ] 1 ▹ \triangleright ▹ with p i p_i p i -bit precision
end for
return t log N t_{\log N} t l o g N
Proof. The relative-norm recursion gives ∥ u i ∥ 1 ≤ ∥ u ∥ 1 N / 2 i ≤ 2 ( N / 2 i ) ℓ \lVert u_i\rVert_1 \le\lVert u\rVert_1^{N/2^i} \le2^{(N/2^i)\ell} ∥ u i ∥ 1 ≤ ∥ u ∥ 1 N / 2 i ≤ 2 ( N / 2 i ) ℓ . We show inductively that
t i = [ u − 1 z + e i ] 1 , ∥ e i ∥ ∞ ≤ 2 − p i . t_i=[u^{-1}z+e_i]_1,\qquad\lVert e_i\rVert_\infty\le2^{-p_i}. t i = [ u − 1 z + e i ] 1 , ∥ e i ∥ ∞ ≤ 2 − p i .
For i = 0 i=0 i = 0 , this follows from the rounding error bound 2 − p 0 − 1 ≤ 2 − p 0 2^{-p_0-1}\le2^{-p_0} 2 − p 0 − 1 ≤ 2 − p 0 . For i ≥ 1 i\ge1 i ≥ 1 , multiplication by the integral polynomial u i ( − X i ) u_i(-X_i) u i ( − X i ) preserves congruence modulo 1. Hence the relative-norm identity gives t i = [ u − 1 z + e i ] 1 t_i=[u^{-1}z+e_i]_1 t i = [ u − 1 z + e i ] 1 , where e i e_i e i is u i ( − X i ) e i − 1 ( X i 2 ) u_i(-X_i)e_{i-1}(X_i^2) u i ( − X i ) e i − 1 ( X i 2 ) plus the rounding error at level i i i . It yields
∥ e i ∥ ∞ ≤ ∥ u i ∥ 1 ∥ e i − 1 ∥ ∞ + 2 − p i − 1 ≤ 2 − p i . \lVert e_i\rVert_\infty\le\lVert u_i\rVert_1\lVert e_{i-1}\rVert_\infty+2^{-p_i-1}\le2^{-p_i}. ∥ e i ∥ ∞ ≤ ∥ u i ∥ 1 ∥ e i − 1 ∥ ∞ + 2 − p i − 1 ≤ 2 − p i .
Taking i = log N i=\log N i = log N gives t = [ u − 1 z + e ] 1 t=[u^{-1}z+e]_1 t = [ u − 1 z + e ] 1 with ∥ e ∥ ∞ ≤ 2 − ℓ − 3 ≤ 1 / ( 8 ∥ u ∥ 1 ) \lVert e\rVert_\infty\le2^{-\ell-3}\le1/(8\lVert u\rVert_1) ∥ e ∥ ∞ ≤ 2 − ℓ − 3 ≤ 1/ ( 8 ∥ u ∥ 1 ) .
Shaped rounding follows directly from Theorem 3.5. Writing t = u − 1 z + k + e t=u^{-1}z+k+e t = u − 1 z + k + e with k ∈ R k\in\mathcal{R} k ∈ R , we have z − u t = − u k − u e z-ut=-uk-ue z − u t = − u k − u e and ∥ u e ∥ ∞ ≤ 1 / 8 \lVert ue\rVert_\infty\le1/8 ∥ u e ∥ ∞ ≤ 1/8 . Hence integer rounding gives
P = ⌊ z − u t ⌉ = − u k = z + u ( e − t ) ∈ u R , P=\lfloor z-ut\rceil=-uk=z+u(e-t)\in u\mathcal{R}, P = ⌊ z − u t ⌉ = − u k = z + u ( e − t ) ∈ u R ,
where ∥ e − t ∥ ∞ ≤ 1 / 8 + 1 / 2 = 5 / 8 \lVert e-t\rVert_\infty\le1/8+1/2=5/8 ∥ e − t ∥ ∞ ≤ 1/8 + 1/2 = 5/8 .
Complexity of Fractional Ascent. With the precisions specified in Theorem 3.5, ℓ = ⌈ log ∥ u ∥ 1 ⌉ = O ( log N ) \ell=\lceil\log\lVert u\rVert_1\rceil=O(\log N) ℓ = ⌈ log ∥ u ∥ 1 ⌉ = O ( log N ) for focused encoding, so level i i i uses 2 i 2^i 2 i coefficients represented with O ( ( N / 2 i ) log N ) O((N/2^i)\log N) O (( N / 2 i ) log N ) bits each, with total at O ( N log N ) O(N\log N) O ( N log N ) bits. By Kronecker substitution, each of its constant number of polynomial products costs O ( M ( N log N ) ) = O ( M ( n ) ) O(M(N\log N))=O(M(n)) O ( M ( N log N )) = O ( M ( n )) . Taking fractional parts and rounding fit within the same bound. There are O ( log N ) O(\log N) O ( log N ) levels, giving total cost
O ( M ( n ) log N ) , O(M(n)\log N), O ( M ( n ) log N ) ,
assuming the relative norms are precomputed. The initial scalar division and the final product by u u u each cost O ( M ( n ) ) O(M(n)) O ( M ( n )) .
Focused Encoding by Fractional Ascent
To keep the background embeddings bounded for repeated multiplication, we multiply the shaped-rounding output by the precomputed polynomial
v = ⌊ 4 N σ − 1 ( e 0 ) ⌉ , v F = σ 0 ( v ) , v=\left\lfloor4N\sigma^{-1}(e_0)\right\rceil,\qquad v_F=\sigma_0(v), v = ⌊ 4 N σ − 1 ( e 0 ) ⌉ , v F = σ 0 ( v ) ,
where rounding preserves conjugate invariance.
Lemma 3.6 (Efficient focused encoding). Suppose log Δ = O ( log N ) \log\Delta= O(\log N) log Δ = O ( log N ) and γ Δ ≥ 3 ⋅ 2 b N 2 \gamma\Delta\ge3\cdot2^{bN^2} γ Δ ≥ 3 ⋅ 2 b N 2 . For ∣ z ∣ ≤ 1 |z| \le1 ∣ z ∣ ≤ 1 , apply Algorithm 1 to Δ z / v F \Delta z/v_F Δ z / v F with the precisions of Theorem 3.5, and denote its output by t t t . Then
Ecd ~ [ u ] ( z ; Δ ) = v ⌊ Δ z / v F − u t ⌉ \widetilde{\operatorname{Ecd}}^{[u]}(z;\Delta)=v\left\lfloor\Delta z/v_F-ut\right\rceil Ecd [ u ] ( z ; Δ ) = v ⌊ Δ z / v F − u t ⌉ encodes z z z within error ( γ 2 − n , 1 7 + γ ) (\gamma2^{-n},\frac{1}{7}+\gamma) ( γ 2 − n , 7 1 + γ ) at scale Δ \Delta Δ . Evaluation takes O ( M ( n ) log n ) O(M(n)\log n) O ( M ( n ) log n ) time, with the relative norms, v v v , and Δ / v F \Delta/v_F Δ/ v F precomputed.
Proof. Rounding gives
v F ≥ 7 2 N , max j ≠ 0 ∣ σ j ( v ) ∣ ≤ N 2 , ∥ v ∥ ∞ a n ≤ 9 2 N . v_F\ge\frac{7}{2}N,\qquad\max_{j\ne0}|\sigma_j(v)|\le\frac{N}{2},\qquad\|v\|_\infty^{\mathrm{an}}\le\frac{9}{2}N. v F ≥ 2 7 N , j = 0 max ∣ σ j ( v ) ∣ ≤ 2 N , ∥ v ∥ ∞ an ≤ 2 9 N .
Scalar rounding gives
Ecd ~ [ u ] ( z ; Δ ) = Δ z v / v F + u ( v r ) , ∥ r ∥ ∞ ≤ 5 8 . \widetilde{\operatorname{Ecd}}^{[u]}(z;\Delta)=\Delta z v/v_F+u(vr),\qquad\|r\|_\infty\le\frac{5}{8}. Ecd [ u ] ( z ; Δ ) = Δ z v / v F + u ( v r ) , ∥ r ∥ ∞ ≤ 8 5 .
The first term encodes z z z within error ( 0 , 1 / 7 ) (0,1/7) ( 0 , 1/7 ) at scale Δ \Delta Δ . Since ∥ v r ∥ ∞ a n ≤ ( 9 N / 2 ) ( 5 N / 8 ) < 3 N 2 \|vr\|_\infty^{\mathrm{an}}\le(9N/2)(5N/8)<3N^2 ∥ v r ∥ ∞ an ≤ ( 9 N /2 ) ( 5 N /8 ) < 3 N 2 , Theorem 3.1 gives the result. Scalar normalization and multiplication by v v v add O ( M ( n ) ) O(M(n)) O ( M ( n )) work to the scalar-rounding cost above, giving total time O ( M ( n ) log N ) = O ( M ( n ) log n ) O(M(n)\log N)=O(M(n)\log n) O ( M ( n ) log N ) = O ( M ( n ) log n ) .
Trace Descent
To evaluate Equation (2) , we descend the tower using relative traces. Algorithm 2 returns the integer
m 0 = u 0 Tr K / Q ( u − 1 m ) m_0=u_0\operatorname{Tr}_{K/\mathbb{Q}}(u^{-1}m) m 0 = u 0 Tr K / Q ( u − 1 m )
exactly.
Algorithm 2 Trace Descent
Require: Polynomial m ∈ R m\in\mathcal{R} m ∈ R and relative norms ( u i ) i = 0 log N (u_i)_{i=0}^{\log N} ( u i ) i = 0 l o g N .
Ensure: The integer u 0 Tr K / Q ( u − 1 m ) u_0\operatorname{Tr}_{K/\mathbb{Q}}(u^{-1}m) u 0 Tr K / Q ( u − 1 m ) .
m log N ← m m_{\log N}\gets m m l o g N ← m
for i = log N , … , 1 i=\log N,\ldots,1 i = log N , … , 1 do
m i − 1 ← Tr K i / K i − 1 ( m i ( X i ) u i ( − X i ) ) m_{i-1}\gets\operatorname{Tr}_{K_i/K_{i-1}}\left(m_i(X_i)u_i(-X_i)\right) m i − 1 ← Tr K i / K i − 1 ( m i ( X i ) u i ( − X i ) )
end for
return m 0 m_0 m 0
Correctness of Algorithm 2 follows from iterating the obvious identity
m i − 1 u i − 1 = Tr K i / K i − 1 ( m i u i ) . \frac{m_{i-1}}{u_{i-1}}=\operatorname{Tr}_{K_i/K_{i-1}}\left(\frac{m_i}{u_i}\right). u i − 1 m i − 1 = Tr K i / K i − 1 ( u i m i ) .
Complexity of Trace Descent. Suppose m m m has O ( log N ) O(\log N) O ( log N ) -bit coefficients. Each relative trace increases the coefficient ℓ 1 \ell^1 ℓ 1 -norm by at most a factor of two, so
∥ m i ∥ 1 ≤ N 2 i ∥ m ∥ 1 , ∏ j = i + 1 log N ∥ u j ∥ 1 ≤ N 2 i ∥ m ∥ 1 ∥ u ∥ 1 N / 2 i − 1 . \|m_i\|_1\le\frac{N}{2^i}\|m\|_1,\qquad\prod_{j=i+1}^{\log N}\|u_j\|_1\le\frac{N}{2^i}\|m\|_1\|u\|_1^{N/2^i-1}. ∥ m i ∥ 1 ≤ 2 i N ∥ m ∥ 1 , j = i + 1 ∏ l o g N ∥ u j ∥ 1 ≤ 2 i N ∥ m ∥ 1 ∥ u ∥ 1 N / 2 i − 1 .
Thus m i m_i m i has 2 i 2^i 2 i coefficients of O ( ( N / 2 i ) log N ) O((N/2^i)\log N) O (( N / 2 i ) log N ) bits each. Each exact product costs O ( M ( N log N ) ) = O ( M ( n ) ) O(M(N\log N))=O(M(n)) O ( M ( N log N )) = O ( M ( n )) , giving O ( M ( n ) log N ) O(M(n)\log N) O ( M ( n ) log N ) over the tower, with the relative norms precomputed.
Focused Decoding by Trace Descent
Using the trace descent, the decoder computes
D c d ~ [ u ] ( m ; Δ ) = σ 0 ( u ) 2 Δ u 0 m 0 \widetilde{\mathrm{Dcd}}^{[u]}(m;\Delta)=\frac{\sigma_0(u)}{2\Delta u_0}m_0 Dcd [ u ] ( m ; Δ ) = 2Δ u 0 σ 0 ( u ) m 0
to n + 1 n+1 n + 1 fractional bits using a precomputed approximation to the scalar factor, and returns the result z ^ \hat{z} z ^ . The integer m 0 m_0 m 0 has O ( N log N ) O(N\log N) O ( N log N ) bits, so n + O ( N log N ) = O ( n ) n+O(N\log N)=O(n) n + O ( N log N ) = O ( n ) fractional bits of the scalar factor suffice to keep the final multiplication and rounding error within 2 − n 2^{-n} 2 − n . This step costs O ( M ( n ) ) O(\mathrm{M}(n)) O ( M ( n )) .
Lemma 3.7 (Efficient focused decoding). Suppose m ∈ R m\in\mathcal{R} m ∈ R has O ( log N ) O(\log N) O ( log N ) -bit coefficients and encodes z ∈ [ − 1 , 1 ] z\in[-1,1] z ∈ [ − 1 , 1 ] within error ( ϵ , B ) (\epsilon,B) ( ϵ , B ) at scale Δ ≥ 1 \Delta\ge1 Δ ≥ 1 . Then evaluating D c d ~ [ u ] ( m ; Δ ) \widetilde{\mathrm{Dcd}}^{[u]}(m;\Delta) Dcd [ u ] ( m ; Δ ) returns z ^ \hat{z} z ^ satisfying
∣ z ^ − z ∣ ≤ ϵ + ( B + 1 ) 2 − n |\hat{z}-z|\le\epsilon+(B+1)2^{-n} ∣ z ^ − z ∣ ≤ ϵ + ( B + 1 ) 2 − n in O ( M ( n ) log n ) O(\mathrm{M}(n)\log n) O ( M ( n ) log n ) time, where the relative norms and scalar factor are precomputed.
Proof. Since each σ j ( u ) \sigma_j(u) σ j ( u ) is real, the two conjugate embeddings contribute 2 Re σ j ( m ) / σ j ( u ) 2\operatorname{Re}\sigma_j(m)/\sigma_j(u) 2 Re σ j ( m ) / σ j ( u ) to the trace. Hence,
D c d ~ [ u ] ( m ; Δ ) = Re σ 0 ( m ) Δ + ∑ j ≠ 0 σ 0 ( u ) σ j ( u ) Re σ j ( m ) Δ . \widetilde{\mathrm{Dcd}}^{[u]}(m;\Delta)=\frac{\operatorname{Re}\sigma_0(m)}{\Delta}+\sum_{j\ne0}\frac{\sigma_0(u)}{\sigma_j(u)}\frac{\operatorname{Re}\sigma_j(m)}{\Delta}. Dcd [ u ] ( m ; Δ ) = Δ Re σ 0 ( m ) + j = 0 ∑ σ j ( u ) σ 0 ( u ) Δ Re σ j ( m ) . Let H = ∥ u ∥ ∞ H=\lVert u\rVert_\infty H = ∥ u ∥ ∞ . Since N K / Q ( u ) ≥ 1 N_{K/\mathbb{Q}}(u)\ge1 N K / Q ( u ) ≥ 1 , for each j ≠ 0 j\ne0 j = 0 ,
1 ≤ ∏ k = 0 N / 2 − 1 ∣ σ k ( u ) ∣ ≤ ∣ σ 0 ( u ) σ j ( u ) ∣ H N / 2 − 2 . 1\le\prod_{k=0}^{N/2-1}|\sigma_k(u)|\le|\sigma_0(u)\sigma_j(u)|H^{N/2-2}. 1 ≤ k = 0 ∏ N /2 − 1 ∣ σ k ( u ) ∣ ≤ ∣ σ 0 ( u ) σ j ( u ) ∣ H N /2 − 2 . Substituting bounds of Theorem 3.2 implies
∑ j ≠ 0 ∣ σ 0 ( u ) σ j ( u ) ∣ ≤ N ∣ σ 0 ( u ) ∣ 2 H N / 2 − 2 ≤ 2 − Ω ( N log N ) . \sum_{j\ne0}\left|\frac{\sigma_0(u)}{\sigma_j(u)}\right|\le N|\sigma_0(u)|^2H^{N/2-2}\le2^{-\Omega(N\log N)}. j = 0 ∑ σ j ( u ) σ 0 ( u ) ≤ N ∣ σ 0 ( u ) ∣ 2 H N /2 − 2 ≤ 2 − Ω ( N l o g N ) . Taking the constant in the choice N = Θ ( n / log n ) N=\Theta(n/\log n) N = Θ ( n / log n ) sufficiently large makes this bound at most 2 − n 2^{-n} 2 − n . The encoding bounds on m m m therefore give ∣ D c d ~ [ u ] ( m ; Δ ) − z ∣ ≤ ϵ + B 2 − n |\widetilde{\mathrm{Dcd}}^{[u]}(m;\Delta)-z|\le\epsilon+B2^{-n} ∣ Dcd [ u ] ( m ; Δ ) − z ∣ ≤ ϵ + B 2 − n . The final scalar multiplication and rounding add error at most 2 − n 2^{-n} 2 − n , thus ∣ z ^ − z ∣ ≤ ϵ + ( B + 1 ) 2 − n |\hat{z}-z|\le\epsilon+(B+1)2^{-n} ∣ z ^ − z ∣ ≤ ϵ + ( B + 1 ) 2 − n .
The trace-descent and scaling costs above give total time O ( M ( n ) log N ) = O ( M ( n ) log n ) O(\mathrm{M}(n)\log N)=O(\mathrm{M}(n)\log n) O ( M ( n ) log N ) = O ( M ( n ) log n ) .
Levelled Multiplication by Focused Encoding
Now, we present a focused CKKS scheme as a levelled homomorphic encryption scheme, which preserves the shaped error. As a result, we will obtain a levelled homomorphic multiplication.
Theorem 3.8 (Levelled homomorphic fixed-point multiplication). There is a multiplication algorithm
Mult [ u ] : R Q ℓ 2 × R Q ℓ 2 ⟶ R Q ℓ − 1 2 , \operatorname{Mult}^{[u]}:\mathcal{R}_{Q_\ell}^{2}\times\mathcal{R}_{Q_\ell}^{2}\longrightarrow\mathcal{R}_{Q_{\ell-1}}^{2}, Mult [ u ] : R Q ℓ 2 × R Q ℓ 2 ⟶ R Q ℓ − 1 2 , with a suitable modulus chain { Q ℓ } ℓ ∈ [ L + 1 ] \{Q_\ell\}_{\ell\in[L+1]} { Q ℓ } ℓ ∈ [ L + 1 ] and a constant 0 < γ ≤ 1 / 4 0<\gamma\le1/4 0 < γ ≤ 1/4 such that, whenever Dec ( c t i ) \operatorname{Dec}(\mathrm{ct}_i) Dec ( ct i ) encodes z i ∈ [ − 1 , 1 ] z_i\in[-1,1] z i ∈ [ − 1 , 1 ] within error ( ϵ i , B i ) (\epsilon_i,B_i) ( ϵ i , B i ) with ϵ i , B i ≤ 1 / 4 \epsilon_i,B_i\le1/4 ϵ i , B i ≤ 1/4 , Dec ( Mult [ u ] ( c t 1 , c t 2 ) ) \operatorname{Dec}(\operatorname{Mult}^{[u]}(\mathrm{ct}_1,\mathrm{ct}_2)) Dec ( Mult [ u ] ( ct 1 , ct 2 )) encodes z 1 z 2 z_1z_2 z 1 z 2 within error ( ϵ × , B × ) (\epsilon_\times,B_\times) ( ϵ × , B × ) where
ϵ × = ∣ z 1 ∣ ϵ 2 + ∣ z 2 ∣ ϵ 1 + ϵ 1 ϵ 2 + γ 2 − n , B × = B 1 B 2 + γ . \epsilon_\times=|z_1|\epsilon_2+|z_2|\epsilon_1+\epsilon_1\epsilon_2+\gamma2^{-n},\qquad B_\times=B_1B_2+\gamma. ϵ × = ∣ z 1 ∣ ϵ 2 + ∣ z 2 ∣ ϵ 1 + ϵ 1 ϵ 2 + γ 2 − n , B × = B 1 B 2 + γ . Assuming the security parameter satisfies λ L = O ( n / log 2 n ) \lambda_L=O(n/\log^2 n) λ L = O ( n / log 2 n ) , it runs in time O ( M ( n L ) ) O(\mathrm{M}(nL)) O ( M ( n L )) .
Focused Encryption
Fix modulus Q Q Q . In RLWE with ternary secrets, the secret key s k \mathrm{sk} sk is sampled from the ternary distribution of hamming weight h h h , and an RLWE sample is given as ( b , a ) ∈ R Q 2 (b,a) \in\mathcal{R}_Q^2 ( b , a ) ∈ R Q 2 where b = − a ⋅ s k + e b=-a\cdot\mathrm{sk}+e b = − a ⋅ sk + e , a a a , e e e are each sampled from uniform and discrete Gaussian distribution. The decisional RLWE problem states that the sample is indistinguishable from uniform, providing secrecy for encryption schemes like CKKS.
If the focal element u u u is invertible in R Q \mathcal{R}_Q R Q , multiplication by u u u becomes a bijection, so multiplying u u u to the RLWE sample stays indistinguishable from uniform. Hence, we define focused encryption as
Enc s k [ u ] ( m ) = ( [ m ] Q , 0 ) + u ⋅ ( − a ⋅ s k + e , a ) , Dec s k [ u ] ( c t = ( b , a ) ) = Dec s k ( c t ) = [ b + a ⋅ s k ] Q . \operatorname{Enc}_{\mathrm{sk}}^{[u]}(m)=([m]_Q,0)+u\cdot(-a\cdot\mathrm{sk}+e,a),\qquad\operatorname{Dec}_{\mathrm{sk}}^{[u]}(\mathrm{ct}=(b,a))=\operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct})=[b+a\cdot\mathrm{sk}]_Q. Enc sk [ u ] ( m ) = ([ m ] Q , 0 ) + u ⋅ ( − a ⋅ sk + e , a ) , Dec sk [ u ] ( ct = ( b , a )) = Dec sk ( ct ) = [ b + a ⋅ sk ] Q .
so that the encryption error follows the shape of u u u . Specifically, one has
Dec s k ( Enc s k [ u ] ( m ) ) = m + u e E n c ( m o d Q ) , ∥ e E n c ∥ ∞ c a n ≤ E E n c . \operatorname{Dec}_{\mathrm{sk}}(\operatorname{Enc}_{\mathrm{sk}}^{[u]}(m))=m+ue_{\mathrm{Enc}}\pmod Q,\qquad\lVert e_{\mathrm{Enc}}\rVert_{\infty}^{\mathrm{can}}\le E_{\mathrm{Enc}}. Dec sk ( Enc sk [ u ] ( m )) = m + u e Enc ( mod Q ) , ∥ e Enc ∥ ∞ can ≤ E Enc .
By Theorem 3.1, it adds ( 2 − p γ , γ ) (2^{-p}\gamma,\gamma) ( 2 − p γ , γ ) to the error bounds where γ = 2 b E E n c / Δ \gamma=2^bE_{\mathrm{Enc}}/\Delta γ = 2 b E Enc /Δ .
On the other hand, a ciphertext c t \mathrm{ct} ct satisfying Dec s k ( c t ) = m ( m o d Q ) \operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct})=m\pmod Q Dec sk ( ct ) = m ( mod Q ) decrypts to m m m whenever
∥ m ∥ ∞ < Q 2 . \lVert m\rVert_{\infty}<\frac{Q}{2}. ∥ m ∥ ∞ < 2 Q .
In particular, if m ∈ R m\in\mathcal{R} m ∈ R encoding z ∈ [ − 1 , 1 ] z\in[-1,1] z ∈ [ − 1 , 1 ] within error ( ϵ , B ) (\epsilon,B) ( ϵ , B ) , one has
∥ m ∥ ∞ ≤ ∥ m ∥ ∞ c a n ≤ max ( 1 + ϵ , B ) ⋅ Δ , \lVert m\rVert_{\infty}\le\lVert m\rVert_{\infty}^{\mathrm{can}}\le\max(1+\epsilon,B)\cdot\Delta, ∥ m ∥ ∞ ≤ ∥ m ∥ ∞ can ≤ max ( 1 + ϵ , B ) ⋅ Δ ,
so max ( 1 + ϵ , B ) ⋅ Δ < Q / 2 \max(1+\epsilon,B)\cdot\Delta<Q/2 max ( 1 + ϵ , B ) ⋅ Δ < Q /2 suffices for decryption to recover the plaintext m m m .
Note that u u u is invertible modulo Q Q Q if and only if Q Q Q is coprime with N K / Q ( u ) \mathrm{N}_{\mathcal{K}/\mathbb{Q}}(u) N K / Q ( u ) ; we call such a modulus Q Q Q admissible , and we only work with admissible moduli. For an asymptotic focal element, log ∣ N K / Q ( u ) ∣ = O ( N log N ) \log\lvert\mathrm{N}_{\mathcal{K}/\mathbb{Q}}(u)\rvert=O(N\log N) log ∣ N K / Q ( u )∣ = O ( N log N ) , so only O ( N log N ) O(N\log N) O ( N log N ) primes are not admissible. Since prime number theorem guarantees Θ ( T / log T ) \Theta(T/\log T) Θ ( T / log T ) primes in [ T , 2 T ] [T,2T] [ T , 2 T ] for each T T T , we can choose admissible primes large enough to satisfy our parameter requirements, while keeping their bit lengths O ( log N ) O(\log N) O ( log N ) .
Security parameters. Let λ \lambda λ be the security parameter, Q max Q_{\max} Q m a x be the largest modulus used in the construction, including auxiliary key-switching moduli, and σ \sigma σ be the standard deviation of error distribution χ \chi χ . In the small-error regime log ( Q max / σ ) = Θ ( log Q max ) \log(Q_{\max}/\sigma)=\Theta(\log Q_{\max}) log ( Q m a x / σ ) = Θ ( log Q m a x ) , the dual-lattice and BKZ estimates discussed in [1 ] give
log δ = Θ ( log Q max N ) , log T B K Z = Θ ( N log Q max log N log Q max ) . \log\delta=\Theta\left(\frac{\log Q_{\max}}{N}\right),\qquad\log T_{\mathrm{BKZ}}=\Theta\left(\frac{N}{\log Q_{\max}}\log\frac{N}{\log Q_{\max}}\right). log δ = Θ ( N log Q m a x ) , log T BKZ = Θ ( log Q m a x N log log Q m a x N ) .
Thus choosing N = Ω ( λ log Q max ) N=\Omega(\lambda\log Q_{\max}) N = Ω ( λ log Q m a x ) makes this attack cost at least 2 Ω ( λ ) 2^{\Omega(\lambda)} 2 Ω ( λ ) . Meanwhile, the sparse-secret attack of [1 Section 5] can reduce the dimension by a constant fraction at a repetition cost of 2 Θ ( h ) 2^{\Theta(h)} 2 Θ ( h ) in the sparse regime. We choose h = Ω ( λ ) h=\Omega(\lambda) h = Ω ( λ ) so that this cost is 2 Ω ( λ ) 2^{\Omega(\lambda)} 2 Ω ( λ ) . Our parameter requirements are therefore
N = Ω ( λ log Q max ) , h = Ω ( λ ) . N=\Omega(\lambda\log Q_{\max}),\qquad h=\Omega(\lambda). N = Ω ( λ log Q m a x ) , h = Ω ( λ ) .
Together, these conditions ensure an attack cost of 2 Ω ( λ ) 2^{\Omega(\lambda)} 2 Ω ( λ ) under the stated lattice-attack heuristic. As in CKKS [13 ] , we additionally assume circular security for the evaluation keys. Note that the precomputed focal element depends only on N N N and has an O ( N log N ) O(N\log N) O ( N log N ) -bit description; we assume security against non-uniform adversaries that receive it as advice.
Homomorphic Operations
Now, we give a focused version of two core operations of CKKS, key-switching and rescale, whose error is shaped by u u u .
Lemma 3.9 (Key-switching and Rescale). Suppose q ∣ Q q \mid Q q ∣ Q , P ≥ Q P \ge Q P ≥ Q . Then, the following algorithms
K S s k → s k ′ [ u ] ( c t ) = u ⋅ K S s k → s k ′ ( [ u − 1 ] Q ⋅ c t ) , R S q [ u ] ( c t ) = u ⋅ R S q ( [ u − 1 ] Q ⋅ c t ) \mathrm{KS}^{[u]}_{\mathrm{sk}\to\mathrm{sk}'}(\mathrm{ct}) = u \cdot\mathrm{KS}_{\mathrm{sk}\to\mathrm{sk}'}([u^{-1}]_Q \cdot\mathrm{ct}), \qquad\mathrm{RS}^{[u]}_q(\mathrm{ct}) = u \cdot\mathrm{RS}_q([u^{-1}]_Q \cdot\mathrm{ct}) KS sk → sk ′ [ u ] ( ct ) = u ⋅ KS sk → sk ′ ([ u − 1 ] Q ⋅ ct ) , RS q [ u ] ( ct ) = u ⋅ RS q ([ u − 1 ] Q ⋅ ct ) runs in O ( M ( N , log ( P Q ) ) ) O(M(N,\log(PQ))) O ( M ( N , log ( P Q ))) time. Also, if Dec s k ( c t ) = m ( m o d Q ) \operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}) = m \pmod Q Dec sk ( ct ) = m ( mod Q ) , they satisfy
Dec s k ′ ( K S s k → s k ′ [ u ] ( c t ) ) = m + u e K S ( m o d Q ) , \operatorname{Dec}_{\mathrm{sk}'}\left(\mathrm{KS}^{[u]}_{\mathrm{sk}\to\mathrm{sk}'}(\mathrm{ct})\right) = m + u e_{\mathrm{KS}} \pmod Q, Dec sk ′ ( KS sk → sk ′ [ u ] ( ct ) ) = m + u e KS ( mod Q ) , Dec s k ( R S q [ u ] ( c t ) ) = m q + u e R S ( m o d Q / q ) . \operatorname{Dec}_{\mathrm{sk}}\left(\mathrm{RS}^{[u]}_q(\mathrm{ct})\right) = \frac{m}{q} + u e_{\mathrm{RS}} \pmod{Q/q}. Dec sk ( RS q [ u ] ( ct ) ) = q m + u e RS ( mod Q / q ) . with ∥ e K S ∥ ∞ c a n ≤ E K S \lVert e_{\mathrm{KS}}\rVert_{\infty}^{\mathrm{can}} \le E_{\mathrm{KS}} ∥ e KS ∥ ∞ can ≤ E KS and ∥ e R S ∥ ∞ c a n ≤ E R S \lVert e_{\mathrm{RS}}\rVert_{\infty}^{\mathrm{can}} \le E_{\mathrm{RS}} ∥ e RS ∥ ∞ can ≤ E RS .
Proof. The correctness follows from applying Dec ( [ u − 1 ] Q ⋅ c t ) = [ u − 1 ] Q ⋅ Dec s k ( c t ) ( m o d Q ) \operatorname{Dec}([u^{-1}]_Q \cdot\mathrm{ct}) = [u^{-1}]_Q \cdot\operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}) \pmod Q Dec ([ u − 1 ] Q ⋅ ct ) = [ u − 1 ] Q ⋅ Dec sk ( ct ) ( mod Q ) into Theorem 2.2, then multiplying u u u .
Then, the levelled multiplication can be constructed as follows.
Proof of Theorem 3.8 . Consider ring dimension N N N with n = Θ ( N log N ) n = \Theta(N\log N) n = Θ ( N log N ) with an asymptotic focal element u u u with gain p = n p = n p = n and background b = O ( log N ) b = O(\log N) b = O ( log N ) . We take modulus chain { Q ℓ } ℓ ∈ [ L + 1 ] \{Q_\ell\}_{\ell\in[L+1]} { Q ℓ } ℓ ∈ [ L + 1 ] and scale factor Δ 0 \Delta_0 Δ 0 as
Q ℓ = q 0 Δ 0 ℓ , Δ 0 ≥ ( 2 b γ ) ⋅ ( E K S + E R S ) , q 0 ≥ 4 Δ 0 . Q_\ell= q_0\Delta_0^\ell,\qquad\Delta_0 \ge\left(\frac{2^b}{\gamma}\right)\cdot(E_{\mathrm{KS}}+E_{\mathrm{RS}}),\qquad q_0 \ge4\Delta_0. Q ℓ = q 0 Δ 0 ℓ , Δ 0 ≥ ( γ 2 b ) ⋅ ( E KS + E RS ) , q 0 ≥ 4 Δ 0 .
Note that both log Δ 0 \log\Delta_0 log Δ 0 and log q 0 \log q_0 log q 0 can be taken as O ( log N ) O(\log N) O ( log N ) . Taking auxiliary key-switching modulus comparable to the largest ciphertext modulus gives log Q max = O ( L log N ) \log Q_{\max} = O(L\log N) log Q m a x = O ( L log N ) . Since n = Θ ( N log N ) n = \Theta(N\log N) n = Θ ( N log N ) , the security assumption ensures N = Ω ( λ log Q max ) N = \Omega(\lambda\log Q_{\max}) N = Ω ( λ log Q m a x ) .
Given ciphertexts c t i = ( b i , a i ) ∈ R Q ℓ 2 \mathrm{ct}_i = (b_i,a_i) \in\mathcal{R}_{Q_\ell}^2 ct i = ( b i , a i ) ∈ R Q ℓ 2 , the multiplication algorithm is given as
Mult [ u ] ( c t 1 , c t 2 ) = R S Δ 0 [ u ] ( ( d 0 , d 1 ) + K S s k 2 → s k [ u ] ( ( 0 , d 2 ) ) ) ∈ R Q ℓ − 1 , \operatorname{Mult}^{[u]}(\mathrm{ct}_1,\mathrm{ct}_2) = \mathrm{RS}^{[u]}_{\Delta_0}\left((d_0,d_1) + \mathrm{KS}^{[u]}_{\mathrm{sk}_2\to\mathrm{sk}}((0,d_2))\right) \in\mathcal{R}_{Q_{\ell-1}}, Mult [ u ] ( ct 1 , ct 2 ) = RS Δ 0 [ u ] ( ( d 0 , d 1 ) + KS sk 2 → sk [ u ] (( 0 , d 2 )) ) ∈ R Q ℓ − 1 ,
( d 0 , d 1 , d 2 ) = ( b 1 b 2 , a 1 b 2 + a 2 b 1 , a 1 a 2 ) , (d_0,d_1,d_2) = (b_1b_2,a_1b_2+a_2b_1,a_1a_2), ( d 0 , d 1 , d 2 ) = ( b 1 b 2 , a 1 b 2 + a 2 b 1 , a 1 a 2 ) ,
which runs in O ( M ( N , log ( P Q ℓ ) ) ) = O ( M ( N L log N ) ) = O ( M ( n L ) ) O(M(N,\log(PQ_\ell))) = O(M(NL\log N)) = O(M(nL)) O ( M ( N , log ( P Q ℓ ))) = O ( M ( N L log N )) = O ( M ( n L )) time.
Now, we track its error. For m i = Dec ( c t i ) m_i = \operatorname{Dec}(\mathrm{ct}_i) m i = Dec ( ct i ) , we obtain
Dec ( Mult [ u ] ( c t 1 , c t 2 ) ) = 1 Δ 0 m 1 m 2 + u ( e K S Δ 0 + e R S ) ( m o d Q ℓ − 1 ) . \operatorname{Dec}(\operatorname{Mult}^{[u]}(\mathrm{ct}_1,\mathrm{ct}_2)) = \frac{1}{\Delta_0}m_1m_2 + u\left(\frac{e_{\mathrm{KS}}}{\Delta_0}+e_{\mathrm{RS}}\right) \pmod{Q_{\ell-1}}. Dec ( Mult [ u ] ( ct 1 , ct 2 )) = Δ 0 1 m 1 m 2 + u ( Δ 0 e KS + e RS ) ( mod Q ℓ − 1 ) .
m 1 m 2 m_1m_2 m 1 m 2 encodes z 1 z 2 z_1z_2 z 1 z 2 within error ( ∣ z 1 ∣ ϵ 2 + ∣ z 2 ∣ ϵ 1 + ϵ 1 ϵ 2 , B 1 B 2 ) (|z_1|\epsilon_2+|z_2|\epsilon_1+\epsilon_1\epsilon_2,B_1B_2) ( ∣ z 1 ∣ ϵ 2 + ∣ z 2 ∣ ϵ 1 + ϵ 1 ϵ 2 , B 1 B 2 ) , and the key-switching and rescale error adds ( 2 − p γ , γ ) (2^{-p}\gamma,\gamma) ( 2 − p γ , γ ) by Theorem 3.1.
Bootstrapping for Focused Encoding
The levelled multiplication eventually reaches the base modulus, where it cannot continue. Hence, we present the bootstrapping for Focused CKKS, which recovers the lost modulus, supporting unbounded number of multiplications.
Theorem 3.10 (Bootstrapping for Focused CKKS). Fix L = Θ ( 1 ) L = \Theta(1) L = Θ ( 1 ) and a constant 0 < γ ≤ 1 0 < \gamma\le1 0 < γ ≤ 1 . Assume λ ≥ 2 \lambda\ge2 λ ≥ 2 and λ = O ( n / log 3 n ) \lambda= O(n/\log^3 n) λ = O ( n / log 3 n ) with a sufficiently small implied constant. With a suitable modulus chain { Q ℓ } ℓ ∈ [ L + 1 ] \{Q_\ell\}_{\ell\in[L+1]} { Q ℓ } ℓ ∈ [ L + 1 ] , there is a bootstrapping algorithm
BTS [ u ] : R Q 0 2 ⟶ R Q L 2 \operatorname{BTS}^{[u]} : R_{Q_0}^2 \longrightarrow R_{Q_L}^2 BTS [ u ] : R Q 0 2 ⟶ R Q L 2 such that whenever ct encrypts z ∈ [ − 1 , 1 ] z \in[-1,1] z ∈ [ − 1 , 1 ] within error ( ϵ , B ) (\epsilon,B) ( ϵ , B ) with ϵ ≤ 1 \epsilon\le1 ϵ ≤ 1 and B ≤ 2 B \le2 B ≤ 2 , its output encrypts z z z within error ( ϵ + γ 2 − n , B + γ ) (\epsilon+\gamma2^{-n}, B+\gamma) ( ϵ + γ 2 − n , B + γ ) . Substituting M ( b ) = O ( b log b ) M(b)=O(b\log b) M ( b ) = O ( b log b ) , the running time is
O ( n log n + n ( log λ ) 3 log log λ ) . O\left(n\log n+n(\log\lambda)^3\log\log\lambda\right). O ( n log n + n ( log λ ) 3 log log λ ) .
Taking L = 1 L=1 L = 1 and performing bootstrapping after each multiplication, with suitable choice of γ \gamma γ for each step, gives the following.
Corollary 3.11 (Fixed-point multiplication for ciphertexts). There is a multiplication algorithm
Mult [ u ] : R Q 2 × R Q 2 ⟶ R Q 2 , \operatorname{Mult}^{[u]} : R_Q^2 \times R_Q^2 \longrightarrow R_Q^2, Mult [ u ] : R Q 2 × R Q 2 ⟶ R Q 2 , with a suitable modulus Q Q Q and a constant 0 < γ ≤ 1 4 0 < \gamma\le\frac14 0 < γ ≤ 4 1 such that, whenever c t i \mathrm{ct}_i ct i encrypts z i ∈ [ − 1 , 1 ] z_i \in[-1,1] z i ∈ [ − 1 , 1 ] within error ( ϵ i , B i ) (\epsilon_i,B_i) ( ϵ i , B i ) with ϵ i , B i ≤ 1 4 \epsilon_i,B_i \le\frac14 ϵ i , B i ≤ 4 1 , its output encrypts z 1 z 2 z_1z_2 z 1 z 2 within error ( ϵ × , B × ) (\epsilon_\times,B_\times) ( ϵ × , B × ) where
ϵ × = ∣ z 1 ∣ ϵ 2 + ∣ z 2 ∣ ϵ 1 + ϵ 1 ϵ 2 + γ 2 − n , B × = B 1 B 2 + γ . \epsilon_\times= |z_1|\epsilon_2+|z_2|\epsilon_1+\epsilon_1\epsilon_2+\gamma2^{-n},\qquad B_\times=B_1B_2+\gamma. ϵ × = ∣ z 1 ∣ ϵ 2 + ∣ z 2 ∣ ϵ 1 + ϵ 1 ϵ 2 + γ 2 − n , B × = B 1 B 2 + γ . Using M ( b ) = O ( b log b ) M(b)=O(b\log b) M ( b ) = O ( b log b ) and assuming λ ≥ 2 \lambda\ge2 λ ≥ 2 and λ = O ( n / log 3 n ) \lambda=O(n/\log^3 n) λ = O ( n / log 3 n ) , it runs in time
O ( n log n + n ( log λ ) 3 log log λ ) . O\left(n\log n+n(\log\lambda)^3\log\log\lambda\right). O ( n log n + n ( log λ ) 3 log log λ ) .
Proof. Correctness follows from levelled multiplication and Theorem 3.10 , allocating a constant fraction of γ \gamma γ to each operation. The multiplication adds O ( M ( n ) ) O(M(n)) O ( M ( n )) time, so the total running time has the same bound as bootstrapping.
Shaped Bootstrapping
To obtain the desired bootstrapping, the resulting error should be extremely small in the focus slot, so usual bootstrapping error does not suffice; regarding usual error as shaped error will blow up at the focus embedding, since u − 1 u^{-1} u − 1 has size 2 Ω ( n ) 2^{\Omega(n)} 2 Ω ( n ) at the embedding.
Instead, observe that if a ciphertext c t ∈ R ρ Q 2 \mathrm{ct}\in R_{\rho Q}^2 ct ∈ R ρQ 2 is encrypting
Dec ( c t ) = ρ m + e , m ∈ R , \operatorname{Dec}(\mathrm{ct})=\rho m+e,\qquad m\in R, Dec ( ct ) = ρ m + e , m ∈ R ,
multiplying u [ u − 1 ] Q u[u^{-1}]_Q u [ u − 1 ] Q does not change the message m m m , while it turns the error into a shaped error u ⋅ ( [ u − 1 ] Q e ) u\cdot([u^{-1}]_Qe) u ⋅ ([ u − 1 ] Q e ) . Crucially, [ u − 1 ] Q [u^{-1}]_Q [ u − 1 ] Q has size upper bound of Q Q Q .
To integrate this with the bootstrapping circuit, we consider a scaled bootstrapping BTS ρ \operatorname{BTS}_\rho BTS ρ , which outputs a ciphertext at modulus ρ Q \rho Q ρQ encrypting ρ m + e B T S \rho m+e_{\mathrm{BTS}} ρ m + e BTS with ∥ e B T S ∥ ∞ c a n / ρ ≤ 1 / Q \lVert e_{\mathrm{BTS}}\rVert_\infty^{\mathrm{can}}/\rho\le1/Q ∥ e BTS ∥ ∞ can / ρ ≤ 1/ Q . Then, we define a shaped bootstrapping as
BTS [ u ] ( c t ) = u ⋅ RS ρ ( [ u − 1 ] Q ⋅ BTS ρ ( c t ) ) , \operatorname{BTS}^{[u]}(\mathrm{ct})=u\cdot\operatorname{RS}_\rho([u^{-1}]_Q\cdot\operatorname{BTS}_\rho(\mathrm{ct})), BTS [ u ] ( ct ) = u ⋅ RS ρ ([ u − 1 ] Q ⋅ BTS ρ ( ct )) ,
which scales the message back down while shaping the error.
In particular,
Dec ( BTS [ u ] ( c t ) ) = m + u e , e = [ u − 1 ] Q ⋅ e B T S ρ + e R S \operatorname{Dec}(\operatorname{BTS}^{[u]}(\mathrm{ct}))=m+ue,\qquad e=[u^{-1}]_Q\cdot\frac{e_{\mathrm{BTS}}}{\rho}+e_{\mathrm{RS}} Dec ( BTS [ u ] ( ct )) = m + u e , e = [ u − 1 ] Q ⋅ ρ e BTS + e RS
where e B T S e_{\mathrm{BTS}} e BTS is the scaled bootstrapping error and e R S e_{\mathrm{RS}} e RS is the rescale error. Hence, sufficiently large ρ \rho ρ can give a reasonable bound on the resulting error e e e .
Scaled Bootstrapping
We use a CKKS bootstrapping implementation with scaling added in ModRaise.
Proposition 3.12 (Scaled bootstrapping). Fix a constant L ≥ 1 L \ge1 L ≥ 1 and a sufficiently large ring dimension N N N . Let moduli Q L = Q 0 Δ 0 L Q_L = Q_0\Delta_0^L Q L = Q 0 Δ 0 L , where Δ 0 , Q 0 \Delta_0, Q_0 Δ 0 , Q 0 are positive integers with Δ 0 ≥ N \Delta_0 \ge N Δ 0 ≥ N and Q 0 ≥ 2 Δ 0 2 Q_0 \ge2\Delta_0^2 Q 0 ≥ 2 Δ 0 2 . Suppose the secret is ternary of weight h = Θ ( λ ) ≤ N h = \Theta(\lambda) \le N h = Θ ( λ ) ≤ N , and the RLWE error is bounded by Σ = Q 0 O ( 1 ) \Sigma= Q_0^{O(1)} Σ = Q 0 O ( 1 ) , and N / log N = Ω ( λ log Q 0 ) N/\log N = \Omega(\lambda\log Q_0) N / log N = Ω ( λ log Q 0 ) .
For a suitable integer ρ = Q L ( N Σ ) O ( 1 ) \rho= Q_L(N\Sigma)^{O(1)} ρ = Q L ( N Σ ) O ( 1 ) , there is a scaled bootstrapping algorithm that maps c t ∈ R Q 0 2 \mathrm{ct} \in\mathcal{R}_{Q_0}^2 ct ∈ R Q 0 2 encrypting m = Dec s k ( c t ) m = \operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}) m = Dec sk ( ct ) with ∥ m ∥ ∞ ≤ 2 Δ 0 \lVert m\rVert_\infty\le2\Delta_0 ∥ m ∥ ∞ ≤ 2 Δ 0 , to c t ′ ∈ R ρ Q L 2 \mathrm{ct}' \in\mathcal{R}_{\rho Q_L}^2 ct ′ ∈ R ρ Q L 2 satisfying
Dec s k ( c t ′ ) = ρ m + e B T S ( m o d ρ Q L ) , ∥ e B T S ∥ ∞ c a n ≤ ρ / Q L . \operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}') = \rho m + e_{\mathrm{BTS}} \pmod{\rho Q_L}, \qquad\lVert e_{\mathrm{BTS}}\rVert_\infty^{\mathrm{can}} \le\rho/Q_L. Dec sk ( ct ′ ) = ρ m + e BTS ( mod ρ Q L ) , ∥ e BTS ∥ ∞ can ≤ ρ / Q L . It runs in
O ( ( log N + log λ log log Q 0 ) M ( N log N log Q 0 ) ) O\left((\log N + \log\lambda\log\log Q_0)M(N\log N\log Q_0)\right) O ( ( log N + log λ log log Q 0 ) M ( N log N log Q 0 ) ) time.
We defer the proof of Theorem 3.12 to the end of this subsection.
Subring Bootstrapping
While the bootstrapping construction above would give quasilinear performance, it has many logarithmic factors, which is not ideal for our purpose. Instead, we split the large ciphertext into several small ciphertext over a subring, reducing both the number and cost of ring operations needed for bootstrapping.
Consider a subring R 0 = Z [ Y ] / ( Y N 0 + 1 ) \mathcal{R}_0 = \mathbb{Z}[Y]/(Y^{N_0}+1) R 0 = Z [ Y ] / ( Y N 0 + 1 ) of R \mathcal{R} R by identification Y = X N / N 0 Y = X^{N/N_0} Y = X N / N 0 . As observed in [3 ] ,
R = ⨁ j ∈ [ N / N 0 ] R 0 X j \mathcal{R} = \bigoplus_{j\in[N/N_0]} \mathcal{R}_0X^j R = j ∈ [ N / N 0 ] ⨁ R 0 X j
as R 0 \mathcal{R}_0 R 0 -module. Hence, when the secret key lies in R 0 \mathcal{R}_0 R 0 , a ciphertext c t = ( b , a ) \mathrm{ct} = (b,a) ct = ( b , a ) over R \mathcal{R} R splits into N / N 0 N/N_0 N / N 0 ciphertexts c t j = ( b j , a j ) \mathrm{ct}_j = (b_j,a_j) ct j = ( b j , a j ) over R 0 \mathcal{R}_0 R 0 , and its security is determined by the subring degree N 0 N_0 N 0 .
Since we are bootstrapping the coefficients of the message polynomial, we may bootstrap each subring ciphertext instead, reducing the task to bootstrapping N N 0 \frac{N}{N_0} N 0 N ciphertexts of ring dimension N 0 N_0 N 0 .
We now prove Theorem 3.10 using bootstrapping over this subring.
Proof of Theorem 3.10. The bootstrapping algorithm consists of the following steps.
Split c t \mathrm{ct} ct into ciphertexts { c t j } j ∈ [ N / N 0 ] \{\mathrm{ct}_j\}_{j\in[N/N_0]} { ct j } j ∈ [ N / N 0 ] over R 0 \mathcal{R}_0 R 0 .
Bootstrap each component as c t j ′ = B T S ρ ( c t j ) \mathrm{ct}'_j = \mathrm{BTS}_{\rho}(\mathrm{ct}_j) ct j ′ = BTS ρ ( ct j ) over R 0 \mathcal{R}_0 R 0 .
Recombine the outputs as c t ′ = ∑ j ∈ [ N / N 0 ] X j c t j ′ \mathrm{ct}' = \sum_{j\in[N/N_0]} X^j\mathrm{ct}'_j ct ′ = ∑ j ∈ [ N / N 0 ] X j ct j ′ over R \mathcal{R} R .
Apply the shaped bootstrapping transformation to get c t ′ ′ = u ⋅ R S ρ ( [ u − 1 ] Q L ⋅ c t ′ ) \mathrm{ct}'' = u \cdot\mathrm{RS}_{\rho}([u^{-1}]_{Q_L}\cdot\mathrm{ct}') ct ′′ = u ⋅ RS ρ ([ u − 1 ] Q L ⋅ ct ′ ) .
We choose the secret key in R 0 \mathcal{R}_0 R 0 with Hamming weight h = Θ ( λ ) h = \Theta(\lambda) h = Θ ( λ ) , and use it for both multiplication and bootstrapping. Choose ring dimension N 0 N_0 N 0 as power-of-two with
N 0 = Θ ( λ log Q 0 log ( λ log Q 0 ) ) N_0 = \Theta(\lambda\log Q_0\log(\lambda\log Q_0)) N 0 = Θ ( λ log Q 0 log ( λ log Q 0 ))
to satisfy the security bound N 0 / log N 0 = Ω ( λ log Q 0 ) N_0/\log N_0 = \Omega(\lambda\log Q_0) N 0 / log N 0 = Ω ( λ log Q 0 ) . The bound λ = O ( n / log 3 n ) \lambda= O(n/\log^3 n) λ = O ( n / log 3 n ) ensures N 0 ≤ N N_0 \le N N 0 ≤ N .
For the moduli chain, choose admissible Δ 0 , Q 0 \Delta_0, Q_0 Δ 0 , Q 0 with log Δ 0 , log Q 0 = Θ ( log N ) \log\Delta_0, \log Q_0 = \Theta(\log N) log Δ 0 , log Q 0 = Θ ( log N ) such that
γ Δ 0 ≥ 2 b ( E K S + E R S ) , Q 0 ≥ 2 Δ 0 2 . \gamma\Delta_0 \ge2^b(E_{\mathrm{KS}}+E_{\mathrm{RS}}), \qquad Q_0 \ge2\Delta_0^2. γ Δ 0 ≥ 2 b ( E KS + E RS ) , Q 0 ≥ 2 Δ 0 2 .
and set Q ℓ = Q 0 Δ 0 ℓ Q_\ell=Q_0\Delta_0^\ell Q ℓ = Q 0 Δ 0 ℓ . Here, E K S E_{\mathrm{KS}} E KS and E R S E_{\mathrm{RS}} E RS are the error bounds for the full ring R \mathcal{R} R .
Now, let m = Dec s k ( c t ) m=\operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}) m = Dec sk ( ct ) . By the input bounds, one has
∥ m ∥ ∞ ≤ ∥ m ∥ ∞ c a n ≤ max ( 1 + ϵ , B ) Δ 0 ≤ 2 Δ 0 . \lVert m\rVert_\infty\le\lVert m\rVert_\infty^{\mathrm{can}} \le\max(1+\epsilon,B)\Delta_0 \le2\Delta_0. ∥ m ∥ ∞ ≤ ∥ m ∥ ∞ can ≤ max ( 1 + ϵ , B ) Δ 0 ≤ 2 Δ 0 .
After splitting, each component has the same coefficient bound, so they satisfy the input condition of Theorem 3.12. Our scale choice also yields Σ = O ( Δ 0 ) = Q 0 O ( 1 ) \Sigma=O(\Delta_0)=Q_0^{O(1)} Σ = O ( Δ 0 ) = Q 0 O ( 1 ) .
Applying the proposition for ring dimension N 0 N_0 N 0 to each component with the scaling factor ρ = Q L Q 0 O ( 1 ) \rho=Q_LQ_0^{O(1)} ρ = Q L Q 0 O ( 1 ) gives bootstrapping error at most ρ / Q L \rho/Q_L ρ / Q L per component. Each component has the same canonical norm when viewed in R \mathcal{R} R , and ∥ X j ∥ ∞ c a n = 1 \lVert X^j\rVert_\infty^{\mathrm{can}}=1 ∥ X j ∥ ∞ can = 1 , so recombination gives
Dec s k ( c t ′ ) = ρ m + e ′ ( m o d ρ Q L ) , ∥ e ′ ∥ ∞ c a n ρ ≤ N N 0 Q L . \operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}')=\rho m+e' \pmod{\rho Q_L}, \qquad\frac{\lVert e'\rVert_\infty^{\mathrm{can}}}{\rho}\le\frac{N}{N_0Q_L}. Dec sk ( ct ′ ) = ρ m + e ′ ( mod ρ Q L ) , ρ ∥ e ′ ∥ ∞ can ≤ N 0 Q L N .
Then, after the shaped bootstrapping transformation,
Dec s k ( c t ′ ′ ) = m + u e ′ ′ ( m o d Q L ) , e ′ ′ = [ u − 1 ] Q L e ′ ρ + e R S . \operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}'')=m+ue'' \pmod{Q_L}, \qquad e''=[u^{-1}]_{Q_L}\frac{e'}{\rho}+e_{\mathrm{RS}}. Dec sk ( ct ′′ ) = m + u e ′′ ( mod Q L ) , e ′′ = [ u − 1 ] Q L ρ e ′ + e RS .
Using ∥ [ u − 1 ] Q L ∥ ∞ c a n ≤ N Q L / 2 \lVert[u^{-1}]_{Q_L}\rVert_\infty^{\mathrm{can}}\le NQ_L/2 ∥[ u − 1 ] Q L ∥ ∞ can ≤ N Q L /2 , we obtain
∥ e ′ ′ ∥ ∞ c a n ≤ N 2 2 N 0 + E R S ≤ E K S . \lVert e''\rVert_\infty^{\mathrm{can}}\le\frac{N^2}{2N_0}+E_{\mathrm{RS}}\le E_{\mathrm{KS}}. ∥ e ′′ ∥ ∞ can ≤ 2 N 0 N 2 + E RS ≤ E KS .
Our scale choice and Theorem 3.1 therefore give output error ( ϵ + γ 2 − n , B + γ ) (\epsilon+\gamma2^{-n},B+\gamma) ( ϵ + γ 2 − n , B + γ ) .
As for cost, bootstrapping all N / N 0 N/N_0 N / N 0 components costs
O ( N N 0 ( log N 0 + log λ log log Q 0 ) M ( N 0 log N 0 log Q 0 ) ) . O\left(\frac{N}{N_0}(\log N_0+\log\lambda\log\log Q_0)\mathsf{M}(N_0\log N_0\log Q_0)\right). O ( N 0 N ( log N 0 + log λ log log Q 0 ) M ( N 0 log N 0 log Q 0 ) ) .
Since log Q 0 = Θ ( log N ) \log Q_0=\Theta(\log N) log Q 0 = Θ ( log N ) and n = Θ ( N log N ) n=\Theta(N\log N) n = Θ ( N log N ) , we have N 0 = Θ ( λ log n log ( λ log n ) ) N_0=\Theta(\lambda\log n\log(\lambda\log n)) N 0 = Θ ( λ log n log ( λ log n )) and log N 0 = Θ ( log ( λ log n ) ) \log N_0=\Theta(\log(\lambda\log n)) log N 0 = Θ ( log ( λ log n )) . Substituting, the cost is
O ( n log λ log log n λ log 2 n log ( λ log n ) M ( λ log 2 n log 2 ( λ log n ) ) ) . O\left(\frac{n\log\lambda\log\log n}{\lambda\log^2 n\log(\lambda\log n)}\mathsf{M}\left(\lambda\log^2 n\log^2(\lambda\log n)\right)\right). O ( λ log 2 n log ( λ log n ) n log λ log log n M ( λ log 2 n log 2 ( λ log n ) ) ) .
Splitting, recombination, and error shaping use moduli at most ρ Q L = N O ( 1 ) \rho Q_L=N^{O(1)} ρ Q L = N O ( 1 ) , adding O ( M ( N log N ) ) = O ( M ( n ) ) O(\mathsf{M}(N\log N))=O(\mathsf{M}(n)) O ( M ( N log N )) = O ( M ( n )) time. Substituting M ( b ) = O ( b log b ) \mathsf{M}(b)=O(b\log b) M ( b ) = O ( b log b ) , the total cost is
O ( n log n + n log λ log log n ( log λ + log log n ) 2 ) . O\left(n\log n+n\log\lambda\log\log n(\log\lambda+\log\log n)^2\right). O ( n log n + n log λ log log n ( log λ + log log n ) 2 ) .
If log λ ≤ ( log n ) 1 / 4 \log\lambda\le(\log n)^{1/4} log λ ≤ ( log n ) 1/4 , the second term is O ( n log n ) O(n\log n) O ( n log n ) . Otherwise, log log n < 4 log log λ \log\log n<4\log\log\lambda log log n < 4 log log λ and the second term is O ( n ( log λ ) 3 log log λ ) O(n(\log\lambda)^3\log\log\lambda) O ( n ( log λ ) 3 log log λ ) , proving the claimed bound.
Proof of Scaled Bootstrapping
For the scaled bootstrapping, we follow the cleaning-based approach of [14 , 15 ] , which computes and removes the overflow introduced by modular raising using approximate sign evaluation.
Approximate modular reduction. We first give a polynomial circuit that extracts each bit of the overflow to constant accuracy, refines them independently, and subtracts the reconstructed overflow.
Lemma 3.13 (Approximate modular reduction). Let K , p ≥ 1 K,p \ge1 K , p ≥ 1 be integers, and let ℓ = ⌈ log ( 2 K + 1 ) ⌉ \ell= \lceil\log(2K+1)\rceil ℓ = ⌈ log ( 2 K + 1 )⌉ . Given t = I + x t=I+x t = I + x where I ∈ [ − K , K ] ∩ Z I \in[-K,K]\cap\mathbb{Z} I ∈ [ − K , K ] ∩ Z and x ∈ [ − 1 4 , 1 4 ] x \in[-\frac{1}{4},\frac{1}{4}] x ∈ [ − 4 1 , 4 1 ] , a polynomial arithmetic circuit using complex arithmetic and conjugation returns x x x to absolute error at most 2 − p 2^{-p} 2 − p . Its size and multiplicative depth are
O ( ℓ log ( p + ℓ ) ) and O ( ℓ + log ( p + ℓ ) ) , O(\ell\log(p+\ell)) \qquad\text{and}\qquad O(\ell+\log(p+\ell)), O ( ℓ log ( p + ℓ )) and O ( ℓ + log ( p + ℓ )) , respectively. These bounds also hold under approximate evaluation when each arithmetic gate incurs error of magnitude at most a sufficiently small constant multiple of 2 − ( p + ℓ ) 2^{-(p+\ell)} 2 − ( p + ℓ ) .
Proof. Write I + K = ∑ k ∈ [ ℓ ] 2 k b k I+K=\sum_{k\in[\ell]}2^k b_k I + K = ∑ k ∈ [ ℓ ] 2 k b k , where b k ∈ { 0 , 1 } b_k\in\{0,1\} b k ∈ { 0 , 1 } , and put s k = ( − 1 ) b k s_k=(-1)^{b_k} s k = ( − 1 ) b k . We will recover the bits from the signs as b k = ( 1 − s k ) / 2 b_k=(1-s_k)/2 b k = ( 1 − s k ) /2 .
First, we consider the exact identities to approximate. For each k ∈ [ ℓ ] k\in[\ell] k ∈ [ ℓ ] , let
v k = exp ( 2 π i ϕ k ) , ϕ k = { t + K + 1 / 2 2 k + 1 } , v_k=\exp(2\pi i\phi_k),\qquad
\phi_k=\left\{\frac{t+K+1/2}{2^{k+1}}\right\}, v k = exp ( 2 π i ϕ k ) , ϕ k = { 2 k + 1 t + K + 1/2 } ,
where { y } = y − ⌊ y ⌋ ∈ [ 0 , 1 ) \{y\}=y-\lfloor y\rfloor\in[0,1) { y } = y − ⌊ y ⌋ ∈ [ 0 , 1 ) denotes the fractional part. Since x + 1 / 2 ∈ ( 0 , 1 ) x+1/2\in(0,1) x + 1/2 ∈ ( 0 , 1 ) , the first binary digits of ϕ k \phi_k ϕ k are b k , b k − 1 , … , b 0 b_k,b_{k-1},\ldots,b_0 b k , b k − 1 , … , b 0 .
For k ≥ 1 k\ge1 k ≥ 1 , consider
w k = exp ( 2 π i ( ϕ k − b k − 1 4 + 1 8 ) ) , w_k=\exp\left(2\pi i\left(\phi_k-\frac{b_{k-1}}{4}+\frac{1}{8}\right)\right), w k = exp ( 2 π i ( ϕ k − 4 b k − 1 + 8 1 ) ) ,
whose argument lies in [ π / 4 , 3 π / 4 ] [\pi/4,3\pi/4] [ π /4 , 3 π /4 ] if b k = 0 b_k=0 b k = 0 , and in [ 5 π / 4 , 7 π / 4 ] [5\pi/4,7\pi/4] [ 5 π /4 , 7 π /4 ] if b k = 1 b_k=1 b k = 1 . Thus w k w_k w k is within angle π / 4 \pi/4 π /4 of s k i s_k i s k i , and s k Im w k ∈ [ 1 / 2 , 1 ] s_k\operatorname{Im}w_k\in[1/\sqrt{2},1] s k Im w k ∈ [ 1/ 2 , 1 ] . For w 0 = v 0 w_0=v_0 w 0 = v 0 , the same condition holds for k = 0 k=0 k = 0 .
Since
exp ( 2 π i ( 1 8 − b k − 1 4 ) ) = 1 + i s k − 1 2 , \exp\left(2\pi i\left(\frac{1}{8}-\frac{b_{k-1}}{4}\right)\right)=\frac{1+i s_{k-1}}{\sqrt{2}}, exp ( 2 π i ( 8 1 − 4 b k − 1 ) ) = 2 1 + i s k − 1 ,
the signs can be recovered successively as
w 0 = v 0 , w k = 1 + i s k − 1 2 ⋅ v k ( 1 ≤ k < ℓ ) , s k = sgn ( Im w k ) . w_0=v_0,\qquad
w_k=\frac{1+i s_{k-1}}{\sqrt{2}}\cdot v_k\quad(1\le k<\ell),\qquad
s_k=\operatorname{sgn}(\operatorname{Im}w_k). w 0 = v 0 , w k = 2 1 + i s k − 1 ⋅ v k ( 1 ≤ k < ℓ ) , s k = sgn ( Im w k ) .
In the actual approximation, we approximate v ℓ − 1 v_{\ell-1} v ℓ − 1 by a polynomial, then obtain approximations to v ℓ − 2 , … , v 0 v_{\ell-2},\ldots,v_0 v ℓ − 2 , … , v 0 by repeated squaring, using v k − 1 = v k 2 v_{k-1}=v_k^2 v k − 1 = v k 2 . Let v ~ k \widetilde{v}_k v k be the resulting approximations. Then, we use the sign circuit Signq _q q of Theorem 2.3. For a constant precision p 0 p_0 p 0 , we compute the signs as
w ~ 0 ← v ~ 0 , \widetilde{w}_0\gets\widetilde{v}_0, w 0 ← v 0 ,
w ~ k ← 1 + i s ~ k − 1 2 v ~ k ( 1 ≤ k < ℓ ) , \widetilde{w}_k\gets\frac{1+i\widetilde{s}_{k-1}}{\sqrt{2}}\widetilde{v}_k
\qquad(1\le k<\ell), w k ← 2 1 + i s k − 1 v k ( 1 ≤ k < ℓ ) ,
s ~ k ← Sign p 0 ( Im w ~ k ) ( 0 ≤ k < ℓ ) . \widetilde{s}_k\gets\operatorname{Sign}_{p_0}(\operatorname{Im}\widetilde{w}_k)
\qquad(0\le k<\ell). s k ← Sign p 0 ( Im w k ) ( 0 ≤ k < ℓ ) .
We then refine the signs independently through
s ^ k ← Sign p + ℓ ( s ~ k ) , \widehat{s}_k\gets\operatorname{Sign}_{p+\ell}(\widetilde{s}_k), s k ← Sign p + ℓ ( s k ) ,
and return the remainder as
x ^ ← t + K − ∑ k = 0 ℓ − 1 2 k 1 − s ^ k 2 . \widehat{x}\gets t+K-\sum_{k=0}^{\ell-1}2^k\frac{1-\widehat{s}_k}{2}. x ← t + K − k = 0 ∑ ℓ − 1 2 k 2 1 − s k .
Now, we show that the error bounds hold with a choice on the precision. The degree-O ( ℓ ) O(\ell) O ( ℓ ) Taylor approximation computes the exponential v ℓ − 1 v_{\ell-1} v ℓ − 1 with error at most a sufficiently constant multiple of 2 − ℓ 2^{-\ell} 2 − ℓ , as given in [11 ] . Evaluating it with O ( ℓ ) O(\ell) O ( ℓ ) bits of precision and applying v k − 1 = v k 2 v_{k-1}=v_k^2 v k − 1 = v k 2 yields approximations v ~ k \widetilde{v}_k v k with ∣ v ~ k − v k ∣ ≤ δ |\widetilde{v}_k-v_k|\leq\delta ∣ v k − v k ∣ ≤ δ for a sufficiently small constant δ > 0 \delta>0 δ > 0 . This step uses O ( ℓ ) O(\ell) O ( ℓ ) gates and depth.
Then, we show inductively that ∣ s ~ k − s k ∣ ≤ δ |\widetilde{s}_k-s_k|\leq\delta ∣ s k − s k ∣ ≤ δ . For k = 0 k=0 k = 0 , this follows from s 0 Im v 0 ≥ 1 / 2 s_0\operatorname{Im}v_0\geq1/\sqrt{2} s 0 Im v 0 ≥ 1/ 2 and the approximation bounds. For k ≥ 1 k\geq1 k ≥ 1 , the induction hypothesis and approximation bounds yield
∣ w ~ k − w k ∣ ≤ ∣ s ~ k − 1 − s k − 1 ∣ 2 + O ( δ ) = O ( δ ) . |\widetilde{w}_k-w_k|\leq\frac{|\widetilde{s}_{k-1}-s_{k-1}|}{\sqrt{2}}+O(\delta)=O(\delta). ∣ w k − w k ∣ ≤ 2 ∣ s k − 1 − s k − 1 ∣ + O ( δ ) = O ( δ ) .
Since s k Im w k ∈ [ 1 / 2 , 1 ] s_k\operatorname{Im}w_k\in[1/\sqrt{2},1] s k Im w k ∈ [ 1/ 2 , 1 ] , the approximate input satisfies s k Im w ~ k ∈ [ 1 / 2 , 3 / 2 ] s_k\operatorname{Im}\widetilde{w}_k\in[1/2,3/2] s k Im w k ∈ [ 1/2 , 3/2 ] for sufficiently small δ \delta δ . Thus Theorem 2.3 gives ∣ s ~ k − s k ∣ ≤ 2 − p 0 ≤ δ |\widetilde{s}_k-s_k|\leq2^{-p_0}\leq\delta ∣ s k − s k ∣ ≤ 2 − p 0 ≤ δ , completing the induction. Here, extracting the ℓ \ell ℓ signs sequentially at constant precision costs O ( ℓ ) O(\ell) O ( ℓ ) size and depth.
After that, refining each sign gives ∣ s ^ k − s k ∣ ≤ 2 − ( p + ℓ ) |\widehat{s}_k-s_k|\leq2^{-(p+\ell)} ∣ s k − s k ∣ ≤ 2 − ( p + ℓ ) with O ( log ( p + ℓ ) ) O(\log(p+\ell)) O ( log ( p + ℓ )) size and depth per sign. Hence, the errors in the refined signs contributes at most ∑ k ∈ [ ℓ ] 2 k − 1 ∣ s ^ k − s k ∣ < 2 − ( p + 1 ) \sum_{k\in[\ell]}2^{k-1}|\widehat{s}_k-s_k|<2^{-(p+1)} ∑ k ∈ [ ℓ ] 2 k − 1 ∣ s k − s k ∣ < 2 − ( p + 1 ) to the error in x ^ \widehat{x} x . Computing the weighted sum introduces a further error bounded by a sufficiently small constant multiple of 2 − p 2^{-p} 2 − p , so the total error is at most 2 − p 2^{-p} 2 − p . Summing up the size and depth gives the stated complexity.
Proof of Theorem 3.12. After ModRaise, the lifted ciphertext satisfies b + a ⋅ s k = m + Q 0 I b+a\cdot\mathbf{sk}=m+Q_0I b + a ⋅ sk = m + Q 0 I with ∥ I ∥ ∞ ≤ K = O ( h ) \|I\|_\infty\leq K=O(h) ∥ I ∥ ∞ ≤ K = O ( h ) . Multiply by ρ \rho ρ and use working scale S = ρ Q 0 S=\rho Q_0 S = ρ Q 0 . Applying C2S and separating real and imaginary parts gives coordinates I j + m j / Q 0 I_j+m_j/Q_0 I j + m j / Q 0 , where ∣ m j / Q 0 ∣ ≤ 1 / Δ 0 < 1 / 8 |m_j/Q_0|\leq1/\Delta_0<1/8 ∣ m j / Q 0 ∣ ≤ 1/ Δ 0 < 1/8 . Apply Theorem 3.13, recombine the real and imaginary parts, and apply S2C. At scale S S S , the resulting coefficients m j / Q 0 m_j/Q_0 m j / Q 0 represent the desired message ρ m \rho m ρ m .
Now, we show the error bounds. The C2S error is clearly bounded by ( N Σ ) O ( 1 ) (N\Sigma)^{O(1)} ( N Σ ) O ( 1 ) . For Theorem 3.13, take
p = log ( N Q 0 Q L ) + O ( 1 ) , ℓ = ⌈ log ( 2 K + 1 ) ⌉ . p=\log(NQ_0Q_L)+O(1),\qquad\ell=\lceil\log(2K+1)\rceil. p = log ( N Q 0 Q L ) + O ( 1 ) , ℓ = ⌈ log ( 2 K + 1 )⌉ .
Since 2 p + ℓ = O ( N K Q 0 Q L ) 2^{p+\ell}=O(NKQ_0Q_L) 2 p + ℓ = O ( N K Q 0 Q L ) , choosing ρ = Q L ( N Σ ) O ( 1 ) \rho=Q_L(N\Sigma)^{O(1)} ρ = Q L ( N Σ ) O ( 1 ) sufficiently large meets the error tolerance of the lemma, and also keeps the C2S error small relative to S S S . Hence, it recovers each m j / Q 0 m_j/Q_0 m j / Q 0 with error O ( 2 − p ) O(2^{-p}) O ( 2 − p ) . The S2C matrix has ℓ ∞ \ell^\infty ℓ ∞ operator norm at most N N N , and its fresh evaluation error is small relative to S S S , so the output error satisfies
∥ e B T S ∥ ∞ c a n ρ = O ( N Q 0 2 − p ) ≤ 1 Q L . \frac{\|e_{\mathrm{BTS}}\|_\infty^{\mathrm{can}}}{\rho}=O(NQ_0 2^{-p})\leq\frac{1}{Q_L}. ρ ∥ e BTS ∥ ∞ can = O ( N Q 0 2 − p ) ≤ Q L 1 .
Since p , log S = O ( log Q 0 ) p,\log S=O(\log Q_0) p , log S = O ( log Q 0 ) and ℓ = O ( log λ ) \ell=O(\log\lambda) ℓ = O ( log λ ) , the DFTs in C2S, S2C and the modular reduction circuit together use
D = O ( log N + log log Q 0 ) , T = O ( log N + log λ log log Q 0 ) D=O(\log N+\log\log Q_0),\qquad T=O(\log N+\log\lambda\log\log Q_0) D = O ( log N + log log Q 0 ) , T = O ( log N + log λ log log Q 0 )
levels and ring operations. The security assumption implies log Q 0 = O ( N ) \log Q_0=O(N) log Q 0 = O ( N ) , so D = O ( log N ) D=O(\log N) D = O ( log N ) . Meanwhile, the maximum modulus including the key-switching auxiliary modulus should be
log Q max = O ( D log S + log ( ρ Q L ) ) = O ( log N log Q 0 ) . \log Q_{\max}=O(D\log S+\log(\rho Q_L))=O(\log N\log Q_0). log Q m a x = O ( D log S + log ( ρ Q L )) = O ( log N log Q 0 ) .
Thus the assumed bound on N N N ensures N = Ω ( λ log Q max ) N=\Omega(\lambda\log Q_{\max}) N = Ω ( λ log Q m a x ) . Each ring operation costs O ( M ( N log N log Q 0 ) ) O(\mathrm{M}(N\log N\log Q_0)) O ( M ( N log N log Q 0 )) , proving the claimed running time.
Generalization to Multiple Focus Slots and Precisions
We extend the single-slot construction to cover multiple slots with varying precisions. Then, we give constructions of focal elements realizing the required profiles. Lastly, we present the focused slot bootstrapping, which is efficient in the concrete regime.
Focused CKKS
We extend the single-slot construction by allocating a separate precision at each slot. We say that m ∈ K R m \in\mathcal{K}_{\mathbb{R}} m ∈ K R encodes z ∈ C N / 2 z \in\mathbb{C}^{N/2} z ∈ C N /2 within error ( ϵ j ) j ∈ [ N / 2 ] (\epsilon_j)_{j\in[N/2]} ( ϵ j ) j ∈ [ N /2 ] at scale Δ > 0 \Delta> 0 Δ > 0 if
∣ 1 Δ σ j ( m ) − z j ∣ ≤ ϵ j , j ∈ [ N / 2 ] . \left|\frac{1}{\Delta}\sigma_j(m)-z_j\right| \le\epsilon_j,\qquad j\in[N/2]. Δ 1 σ j ( m ) − z j ≤ ϵ j , j ∈ [ N /2 ] .
We generalize focal elements as follows.
Definition 4.1 (Focal element). Given gains p j ≥ 0 p_j \ge0 p j ≥ 0 for j ∈ [ N / 2 ] j \in[N/2] j ∈ [ N /2 ] , we say that u ∈ R ∖ { 0 } u \in\mathbb{R}\setminus\{0\} u ∈ R ∖ { 0 } is a focal element with p j p_j p j -bit gain at slot j j j and common b b b -bit overhead if
∣ σ j ( u ) ∣ ≤ 2 b − p j , j ∈ [ N / 2 ] . |\sigma_j(u)| \le2^{b-p_j},\qquad j\in[N/2]. ∣ σ j ( u ) ∣ ≤ 2 b − p j , j ∈ [ N /2 ] .
Lemma 4.2 (Error shaped by focal element). Suppose u u u is given as in Theorem 4.1. Consider a plaintext m ∈ K R m \in\mathcal{K}_{\mathbb{R}} m ∈ K R which encodes z ∈ C N / 2 z \in\mathbb{C}^{N/2} z ∈ C N /2 within error ( ϵ j ) j ∈ [ N / 2 ] (\epsilon_j)_{j\in[N/2]} ( ϵ j ) j ∈ [ N /2 ] at scale Δ \Delta Δ . Introducing a shaped error u e ue u e with 2 b ∥ e ∥ ∞ c a n ≤ γ Δ 2^b\|e\|_{\infty}^{\mathrm{can}} \le\gamma\Delta 2 b ∥ e ∥ ∞ can ≤ γ Δ , the resulting plaintext m + u e m+ue m + u e encodes z z z within error ( ϵ j + 2 − p j γ ) j ∈ [ N / 2 ] (\epsilon_j+2^{-p_j}\gamma)_{j\in[N/2]} ( ϵ j + 2 − p j γ ) j ∈ [ N /2 ] at the same scale.
Proof. For each j ∈ [ N / 2 ] j\in[N/2] j ∈ [ N /2 ] ,
∣ σ j ( u e ) ∣ Δ ≤ 2 b − p j ∥ e ∥ ∞ c a n Δ ≤ 2 − p j γ . \frac{|\sigma_j(ue)|}{\Delta}\le\frac{2^{b-p_j}\|e\|_{\infty}^{\mathrm{can}}}{\Delta}\le2^{-p_j}\gamma. Δ ∣ σ j ( u e ) ∣ ≤ Δ 2 b − p j ∥ e ∥ ∞ can ≤ 2 − p j γ .
Then, the bounds follow by the triangle inequality.
Hence, the common overhead b b b controls the scale needed to absorb shaped error, while the gains p j p_j p j determine the precision at each slot. These parameters are constrained by the field norm:
0 ≤ 1 2 log N K / Q ( u ) = ∑ j log ∣ σ j ( u ) ∣ ≤ N 2 b − ∑ j p j . 0\le\frac{1}{2}\log N_{\mathcal{K}/\mathbb{Q}}(u)=\sum_j\log|\sigma_j(u)|\le\frac{N}{2}b-\sum_jp_j. 0 ≤ 2 1 log N K / Q ( u ) = j ∑ log ∣ σ j ( u ) ∣ ≤ 2 N b − j ∑ p j .
Thus, the overhead is larger than the average of gains, i.e.,
b ≥ 2 N ∑ j p j . b\ge\frac{2}{N}\sum_jp_j. b ≥ N 2 j ∑ p j .
Scheme Construction
With the generalized focal element, most operations are inherited verbatim from the single-slot case. We record the scheme as follows.
KeyGen ( 1 λ ) (1^\lambda) ( 1 λ ) . Same as CKKS.
Ecd [ u ] ( z ; Δ ) ^{[u]}(z;\Delta) [ u ] ( z ; Δ ) . Given z ∈ C N / 2 z\in\mathbb{C}^{N/2} z ∈ C N /2 and scaling factor Δ \Delta Δ , returns u ⋅ ⌊ Δ u − 1 σ − 1 ( z ) ⌉ u\cdot\left\lfloor\Delta u^{-1}\sigma^{-1}(z)\right\rceil u ⋅ ⌊ Δ u − 1 σ − 1 ( z ) ⌉ .
Dcd [ u ] ( p t ; Δ ) ^{[u]}(\mathrm{pt};\Delta) [ u ] ( pt ; Δ ) . Given p t ∈ R \mathrm{pt}\in\mathbb{R} pt ∈ R , returns σ ( p t ) / Δ ∈ C N / 2 \sigma(\mathrm{pt})/\Delta\in\mathbb{C}^{N/2} σ ( pt ) /Δ ∈ C N /2 .
Enc s k [ u ] ( p t ) \operatorname{Enc}_{\mathrm{sk}}^{[u]}(\mathrm{pt}) Enc sk [ u ] ( pt ) . Given p t ∈ R \mathrm{pt} \in\mathcal{R} pt ∈ R , samples a uniform mask a ∈ R Q a \in\mathcal{R}_{Q} a ∈ R Q and an error e E n c ← χ e_{\mathrm{Enc}} \leftarrow\chi e Enc ← χ , and returns ( p t , 0 ) + u ⋅ ( − a ⋅ s k + e E n c , a ) (\mathrm{pt},0) + u \cdot(-a \cdot\mathrm{sk} + e_{\mathrm{Enc}},a) ( pt , 0 ) + u ⋅ ( − a ⋅ sk + e Enc , a ) .
Dec s k [ u ] ( c t ) \operatorname{Dec}_{\mathrm{sk}}^{[u]}(\mathrm{ct}) Dec sk [ u ] ( ct ) . Given c t = ( b , a ) ∈ R Q 2 \mathrm{ct} = (b,a) \in\mathcal{R}_{Q}^{2} ct = ( b , a ) ∈ R Q 2 , returns [ b + a ⋅ s k ] Q [b+a \cdot\mathrm{sk}]_{Q} [ b + a ⋅ sk ] Q .
KS s k → s k ′ [ u ] ( c t ) \operatorname{KS}_{\mathrm{sk}\to\mathrm{sk}'}^{[u]}(\mathrm{ct}) KS sk → sk ′ [ u ] ( ct ) . Given c t ∈ R Q 2 \mathrm{ct} \in\mathcal{R}_{Q}^{2} ct ∈ R Q 2 , returns u ⋅ KS s k → s k ′ ( [ u − 1 ] Q c t ) ∈ R Q 2 u \cdot\operatorname{KS}_{\mathrm{sk}\to\mathrm{sk}'}([u^{-1}]_{Q}\mathrm{ct}) \in\mathcal{R}_{Q}^{2} u ⋅ KS sk → sk ′ ([ u − 1 ] Q ct ) ∈ R Q 2 .
Add [ u ] ( c t 1 , c t 2 ) \operatorname{Add}^{[u]}(\mathrm{ct}_{1},\mathrm{ct}_{2}) Add [ u ] ( ct 1 , ct 2 ) returns c t 1 + c t 2 ∈ R Q 2 \mathrm{ct}_{1}+\mathrm{ct}_{2} \in\mathcal{R}_{Q}^{2} ct 1 + ct 2 ∈ R Q 2 .
Mult [ u ] ( c t 1 , c t 2 ) \operatorname{Mult}^{[u]}(\mathrm{ct}_{1},\mathrm{ct}_{2}) Mult [ u ] ( ct 1 , ct 2 ) . Given c t i = ( b i , a i ) ∈ R Q 2 \mathrm{ct}_{i}=(b_{i},a_{i}) \in\mathcal{R}_{Q}^{2} ct i = ( b i , a i ) ∈ R Q 2 , computes ( d 0 , d 1 , d 2 ) = ( b 1 b 2 , a 1 b 2 + a 2 b 1 , a 1 a 2 ) (d_{0},d_{1},d_{2})=(b_{1}b_{2},a_{1}b_{2}+a_{2}b_{1},a_{1}a_{2}) ( d 0 , d 1 , d 2 ) = ( b 1 b 2 , a 1 b 2 + a 2 b 1 , a 1 a 2 ) and returns RS Δ [ u ] ( ( d 0 , d 1 ) + KS s k 2 → s k [ u ] ( ( 0 , d 2 ) ) ) ∈ R Q / Δ 2 \operatorname{RS}_{\Delta}^{[u]}((d_{0},d_{1})+\operatorname{KS}_{\mathrm{sk}_{2}\to\mathrm{sk}}^{[u]}((0,d_{2}))) \in\mathcal{R}_{Q/\Delta}^{2} RS Δ [ u ] (( d 0 , d 1 ) + KS sk 2 → sk [ u ] (( 0 , d 2 ))) ∈ R Q /Δ 2 .
PtMult [ u ] ( p t , c t ) \operatorname{PtMult}^{[u]}(\mathrm{pt},\mathrm{ct}) PtMult [ u ] ( pt , ct ) . Given c t ∈ R Q 2 \mathrm{ct} \in\mathcal{R}_{Q}^{2} ct ∈ R Q 2 and p t ∈ R \mathrm{pt} \in\mathcal{R} pt ∈ R , returns RS Δ [ u ] ( p t ⋅ c t ) \operatorname{RS}_{\Delta}^{[u]}(\mathrm{pt}\cdot\mathrm{ct}) RS Δ [ u ] ( pt ⋅ ct ) .
Aut κ [ u ] ( c t ) \operatorname{Aut}_{\kappa}^{[u]}(\mathrm{ct}) Aut κ [ u ] ( ct ) . Given c t = ( b , a ) \mathrm{ct}=(b,a) ct = ( b , a ) and κ ∈ Gal ( K / Q ) \kappa\in\operatorname{Gal}(\mathcal{K}/\mathbb{Q}) κ ∈ Gal ( K / Q ) , returns KS κ ( s k ) → s k [ κ ( u ) ] ( ( κ ( b ) , κ ( a ) ) ) \operatorname{KS}_{\kappa(\mathrm{sk})\to\mathrm{sk}}^{[\kappa(u)]}((\kappa(b),\kappa(a))) KS κ ( sk ) → sk [ κ ( u )] (( κ ( b ) , κ ( a ))) .
Lemma 4.3 (Encoding). Suppose u u u is given as in Theorem 4.1, and γ Δ ≥ 2 b ⋅ E E c d \gamma\Delta\ge2^{b}\cdot E_{\mathrm{Ecd}} γ Δ ≥ 2 b ⋅ E Ecd for E E c d = N 2 E_{\mathrm{Ecd}}=\frac{N}{2} E Ecd = 2 N . Given z ∈ C N / 2 z \in\mathbb{C}^{N/2} z ∈ C N /2 , Ecd [ u ] ( z ; Δ ) \operatorname{Ecd}^{[u]}(z;\Delta) Ecd [ u ] ( z ; Δ ) encodes z z z within error ( 2 − p j γ ) j ∈ [ N / 2 ] (2^{-p_{j}}\gamma)_{j\in[N/2]} ( 2 − p j γ ) j ∈ [ N /2 ] at scale Δ \Delta Δ .
Proof. Let m 0 = Δ σ − 1 ( z ) m_{0}=\Delta\sigma^{-1}(z) m 0 = Δ σ − 1 ( z ) , which encodes z z z exactly at scale Δ \Delta Δ . By the definition of the encoder,
Ecd [ u ] ( z ; Δ ) = u ⌊ u − 1 m 0 ⌉ = m 0 + u e , ∥ e ∥ ∞ ≤ 1 2 . \operatorname{Ecd}^{[u]}(z;\Delta)=u\lfloor u^{-1}m_{0}\rceil=m_{0}+ue,\qquad\lVert e\rVert_{\infty}\le\frac{1}{2}. Ecd [ u ] ( z ; Δ ) = u ⌊ u − 1 m 0 ⌉ = m 0 + u e , ∥ e ∥ ∞ ≤ 2 1 . Hence ∥ e ∥ ∞ c a n ≤ N / 2 = E E c d \lVert e\rVert_{\infty}^{\mathrm{can}}\le N/2=E_{\mathrm{Ecd}} ∥ e ∥ ∞ can ≤ N /2 = E Ecd , and the claim follows from 2 b ∥ e ∥ ∞ c a n ≤ γ Δ 2^{b}\lVert e\rVert_{\infty}^{\mathrm{can}}\le\gamma\Delta 2 b ∥ e ∥ ∞ can ≤ γ Δ and Theorem 4.2.
With multiple slots and complex messages, automorphisms are now given a meaning. Automorphisms transform the shape of the error, as we illustrate below.
Lemma 4.4 (Automorphism). Consider an automorphism κ ∈ Gal ( K / Q ) \kappa\in\operatorname{Gal}(\mathcal{K}/\mathbb{Q}) κ ∈ Gal ( K / Q ) . For c t ∈ R Q 2 \mathrm{ct} \in\mathcal{R}_{Q}^{2} ct ∈ R Q 2 , Aut κ [ u ] ( c t ) \operatorname{Aut}_{\kappa}^{[u]}(\mathrm{ct}) Aut κ [ u ] ( ct ) introduces error shaped by κ ( u ) \kappa(u) κ ( u ) , i.e.,
Dec s k ( Aut κ [ u ] ( c t ) ) = κ ( Dec s k ( c t ) ) + κ ( u ) ⋅ e K S ( m o d Q ) . \operatorname{Dec}_{\mathrm{sk}}(\operatorname{Aut}_{\kappa}^{[u]}(\mathrm{ct}))=\kappa(\operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}))+\kappa(u)\cdot e_{\mathrm{KS}}\pmod Q. Dec sk ( Aut κ [ u ] ( ct )) = κ ( Dec sk ( ct )) + κ ( u ) ⋅ e KS ( mod Q ) . Proof. Writing c t = ( b , a ) \mathrm{ct}=(b,a) ct = ( b , a ) , applying κ \kappa κ to both components gives
κ ( b ) + κ ( a ) κ ( s k ) = κ ( b + a ⋅ s k ) = κ ( Dec s k ( c t ) ) ( m o d Q ) . \kappa(b)+\kappa(a)\kappa(\mathrm{sk})=\kappa(b+a\cdot\mathrm{sk})=\kappa(\operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}))\pmod Q. κ ( b ) + κ ( a ) κ ( sk ) = κ ( b + a ⋅ sk ) = κ ( Dec sk ( ct )) ( mod Q ) . Applying Theorem 2.2 gives the result.
In particular, the error shape is preserved when κ \kappa κ fixes u u u . We will use subring elements to obtain rotations with this property.
We now give correctness of levelled multiplication with the focal element of Theorem 4.1.
Proposition 4.5 (Levelled multiplication). Let c t , c t ′ ∈ R Q 2 \mathrm{ct},\mathrm{ct}' \in\mathcal{R}_{Q}^{2} ct , ct ′ ∈ R Q 2 and p t ∈ R \mathrm{pt} \in\mathcal{R} pt ∈ R . Suppose Dec ( c t ) \operatorname{Dec}(\mathrm{ct}) Dec ( ct ) and p t \mathrm{pt} pt encode z ∈ C N / 2 z \in\mathbb{C}^{N/2} z ∈ C N /2 within error ( ϵ j ) j ∈ [ N / 2 ] (\epsilon_{j})_{j\in[N/2]} ( ϵ j ) j ∈ [ N /2 ] , while Dec ( c t ′ ) \operatorname{Dec}(\mathrm{ct}') Dec ( ct ′ ) encodes z ′ ∈ C N / 2 z' \in\mathbb{C}^{N/2} z ′ ∈ C N /2 within error ( ϵ j ′ ) j ∈ [ N / 2 ] (\epsilon'_{j})_{j\in[N/2]} ( ϵ j ′ ) j ∈ [ N /2 ] , all at scale Δ \Delta Δ . For Mult [ u ] ( c t , c t ′ ) \operatorname{Mult}^{[u]}(\mathrm{ct},\mathrm{ct}') Mult [ u ] ( ct , ct ′ ) and PtMult [ u ] ( p t , c t ′ ) \operatorname{PtMult}^{[u]}(\mathrm{pt},\mathrm{ct}') PtMult [ u ] ( pt , ct ′ ) , choose γ \gamma γ according to
γ Δ ≥ { 2 b ( E K S / Δ + E R S ) , for Mult [ u ] , 2 b E R S , for PtMult [ u ] . \gamma\Delta\ge
\begin{cases}
2^{b}(E_{\mathrm{KS}}/\Delta+E_{\mathrm{RS}}), & \text{for }\operatorname{Mult}^{[u]},\\
2^{b}E_{\mathrm{RS}}, & \text{for }\operatorname{PtMult}^{[u]}.
\end{cases} γ Δ ≥ { 2 b ( E KS /Δ + E RS ) , 2 b E RS , for Mult [ u ] , for PtMult [ u ] .
In each case, the output decrypts to an encoding of z ⊙ z ′ z \odot z' z ⊙ z ′ at scale Δ \Delta Δ within error ( ϵ × , j ) j ∈ [ N / 2 ] (\epsilon_{\times,j})_{j\in[N/2]} ( ϵ × , j ) j ∈ [ N /2 ] , where
ϵ × , j = ∣ z j ∣ ϵ j ′ + ∣ z j ′ ∣ ϵ j + ϵ j ϵ j ′ + 2 − p j γ . \epsilon_{\times,j} = |z_j|\epsilon'_j + |z'_j|\epsilon_j + \epsilon_j\epsilon'_j + 2^{-p_j}\gamma. ϵ × , j = ∣ z j ∣ ϵ j ′ + ∣ z j ′ ∣ ϵ j + ϵ j ϵ j ′ + 2 − p j γ .
Here, we require the size constraint
Δ max j ∈ [ N / 2 ] ( ∣ z j z j ′ ∣ + ϵ × , j ) < Q 2 Δ . \Delta\max_{j\in[N/2]} \left(|z_jz'_j|+\epsilon_{\times,j}\right) < \frac{Q}{2\Delta}. Δ j ∈ [ N /2 ] max ( ∣ z j z j ′ ∣ + ϵ × , j ) < 2Δ Q .
Proof. Put m 2 = Dec ( c t ′ ) m_2=\operatorname{Dec}(\mathrm{ct}') m 2 = Dec ( ct ′ ) , and let m 1 = Dec ( c t ) m_1=\operatorname{Dec}(\mathrm{ct}) m 1 = Dec ( ct ) for ciphertext–ciphertext multiplication or m 1 = p t m_1=\mathrm{pt} m 1 = pt for plaintext–ciphertext multiplication. By Theorem 2.2, the output decrypts modulo Q / Δ Q/\Delta Q /Δ to
m × = m 1 m 2 Δ + u e , e = { e K S / Δ + e R S , for M u l t [ u ] , e R S , for P t M u l t [ u ] . m_{\times}=\frac{m_1m_2}{\Delta}+u e,\qquad
e=
\begin{cases}
e_{\mathrm{KS}}/\Delta+e_{\mathrm{RS}}, & \text{for } \mathrm{Mult}^{[u]},\\
e_{\mathrm{RS}}, & \text{for } \mathrm{PtMult}^{[u]}.
\end{cases} m × = Δ m 1 m 2 + u e , e = { e KS /Δ + e RS , e RS , for Mult [ u ] , for PtMult [ u ] .
where ∥ e K S ∥ ∞ c a n ≤ E K S \lVert e_{\mathrm{KS}}\rVert_{\infty}^{\mathrm{can}}\le E_{\mathrm{KS}} ∥ e KS ∥ ∞ can ≤ E KS and ∥ e R S ∥ ∞ c a n ≤ E R S \lVert e_{\mathrm{RS}}\rVert_{\infty}^{\mathrm{can}}\le E_{\mathrm{RS}} ∥ e RS ∥ ∞ can ≤ E RS . The respective condition on γ \gamma γ gives 2 b ∥ e ∥ ∞ c a n ≤ γ Δ 2^b\lVert e\rVert_{\infty}^{\mathrm{can}}\le\gamma\Delta 2 b ∥ e ∥ ∞ can ≤ γ Δ . For each j ∈ [ N / 2 ] j\in[N/2] j ∈ [ N /2 ] , the input error bounds give
∣ σ j ( m 1 m 2 ) Δ 2 − z j z j ′ ∣ ≤ ∣ z j ∣ ϵ j ′ + ∣ z j ′ ∣ ϵ j + ϵ j ϵ j ′ . \left|\frac{\sigma_j(m_1m_2)}{\Delta^2}-z_jz'_j\right|
\le|z_j|\epsilon'_j+|z'_j|\epsilon_j+\epsilon_j\epsilon'_j. Δ 2 σ j ( m 1 m 2 ) − z j z j ′ ≤ ∣ z j ∣ ϵ j ′ + ∣ z j ′ ∣ ϵ j + ϵ j ϵ j ′ .
Thus Theorem 4.2 gives the error bounds for m × m_{\times} m × . Finally,
∥ m × ∥ ∞ ≤ ∥ m × ∥ ∞ c a n ≤ Δ max j ∈ [ N / 2 ] ( ∣ z j z j ′ ∣ + ϵ × , j ) < Q 2 Δ . \lVert m_{\times}\rVert_{\infty}\le\lVert m_{\times}\rVert_{\infty}^{\mathrm{can}}
\le\Delta\max_{j\in[N/2]}\left(|z_jz'_j|+\epsilon_{\times,j}\right)<\frac{Q}{2\Delta}. ∥ m × ∥ ∞ ≤ ∥ m × ∥ ∞ can ≤ Δ j ∈ [ N /2 ] max ( ∣ z j z j ′ ∣ + ϵ × , j ) < 2Δ Q .
Hence reduction modulo Q / Δ Q/\Delta Q /Δ in decryption recovers m × m_{\times} m × , proving both claims.
Subring Focal Elements
Fix a power of two k ∣ N / 2 k\mid N/2 k ∣ N /2 and write d = N / ( 2 k ) d=N/(2k) d = N / ( 2 k ) . Consider the subring R ′ = Z [ Y ] / ( Y 2 k + 1 ) ⊆ R \mathcal{R}'=\mathbb{Z}[Y]/(Y^{2k}+1)\subseteq\mathcal{R} R ′ = Z [ Y ] / ( Y 2 k + 1 ) ⊆ R with identification Y = X d Y=X^d Y = X d . Choosing the focal element in this subring allows rotations within each coset r + k [ d ] ⊂ [ N / 2 ] r+k[d]\subset[N/2] r + k [ d ] ⊂ [ N /2 ] without changing the error shape.
Lemma 4.6 (Subring focal elements). Suppose u ∈ R ′ u\in\mathcal{R}' u ∈ R ′ has gains ( p r ) r ∈ [ k ] (p_r)_{r\in[k]} ( p r ) r ∈ [ k ] and common b b b -bit overhead. Viewed as an element of R \mathcal{R} R , it has p r p_r p r -bit gain on r + k [ d ] r+k[d] r + k [ d ] for each r ∈ [ k ] r\in[k] r ∈ [ k ] , with the same overhead. Furthermore, rotations κ k t \kappa_{kt} κ k t fix u u u and cyclically permute each coset r + k [ d ] r+k[d] r + k [ d ] .
Proof. Under Y = X d Y=X^d Y = X d , evaluation at ζ 5 j \zeta^{5^j} ζ 5 j restricts to evaluation at ζ k 5 j \zeta_k^{5^j} ζ k 5 j on R ′ \mathcal{R}' R ′ . Since 5 5 5 has order k k k modulo 4 k 4k 4 k , σ j ( u ) = σ j m o d k ′ ( u ) \sigma_j(u)=\sigma'_{j\bmod k}(u) σ j ( u ) = σ j mod k ′ ( u ) , where σ r ′ \sigma'_r σ r ′ denotes the r r r -th embedding of R ′ \mathcal{R}' R ′ . Thus the embedding values repeat with period k k k , giving the claimed gains on each coset with the same overhead. Also, 5 k t ≡ 1 ( m o d 4 k ) 5^{kt}\equiv1\pmod{4k} 5 k t ≡ 1 ( mod 4 k ) , so κ k t \kappa_{kt} κ k t fixes R ′ \mathcal{R}' R ′ pointwise and therefore fixes u u u . It is clear that κ k t \kappa_{kt} κ k t corresponds to rotation by k t kt k t , so it rotates in each coset r + k [ d ] r+k[d] r + k [ d ] .
Focused Linear Map Evaluation
With a subring focal element as above, we can evaluate a separate linear map on each coset r + k [ d ] r+k[d] r + k [ d ] , retaining its gain p r p_r p r . The diagonal method of [24 ] evaluates these maps in parallel, combining rotations by multiples of k k k with plaintext multiplications.
Lemma 4.7 (Linear map). Suppose u ∈ R ′ u \in\mathbb{R}' u ∈ R ′ has gains ( p r ) r ∈ [ k ] (p_r)_{r\in[k]} ( p r ) r ∈ [ k ] and common b b b -bit overhead. Given linear maps A r : C d → C d A_r:\mathbb{C}^d \to\mathbb{C}^d A r : C d → C d for r ∈ [ k ] r\in[k] r ∈ [ k ] , define
A = ∑ r ∈ [ k ] A r ⊗ e r e r T : C N / 2 → C N / 2 . A = \sum_{r\in[k]} A_r \otimes e_r e_r^{T}: \mathbb{C}^{N/2} \to\mathbb{C}^{N/2}. A = r ∈ [ k ] ∑ A r ⊗ e r e r T : C N /2 → C N /2 . so that it applies A r A_r A r to the coset r + k [ d ] r+k[d] r + k [ d ] . Write ∥ A r ∥ ∞ → ∞ = max i ∑ j ∣ ( A r ) i , j ∣ \|A_r\|_{\infty\to\infty}=\max_i\sum_j |(A_r)_{i,j}| ∥ A r ∥ ∞ → ∞ = max i ∑ j ∣ ( A r ) i , j ∣ . Suppose Dec ( c t ) \operatorname{Dec}(\mathrm{ct}) Dec ( ct ) encodes z z z at scale Δ ≥ 2 b E E c d \Delta\ge2^b E_{\mathrm{Ecd}} Δ ≥ 2 b E Ecd with error at most ϵ r \epsilon_r ϵ r on r + k [ d ] r+k[d] r + k [ d ] . Choose γ \gamma γ satisfying
γ Δ ≥ C 2 b ⋅ d ( E E c d + E K S + E R S ) ( 1 + ∥ A ∥ ∞ → ∞ + ∥ z ∥ ∞ + max r ∈ [ k ] ϵ r ) \gamma\Delta\ge C 2^b \cdot d(E_{\mathrm{Ecd}}+E_{\mathrm{KS}}+E_{\mathrm{RS}})\left(1+\|A\|_{\infty\to\infty}+\|z\|_\infty+\max_{r\in[k]}\epsilon_r\right) γ Δ ≥ C 2 b ⋅ d ( E Ecd + E KS + E RS ) ( 1 + ∥ A ∥ ∞ → ∞ + ∥ z ∥ ∞ + r ∈ [ k ] max ϵ r ) for a sufficiently large constant C C C independent of parameters. Then there is an operation
Linear A [ u ] : R Q 2 → R Q / Δ 2 \operatorname{Linear}^{[u]}_A:\mathcal{R}^2_Q \to\mathcal{R}^2_{Q/\Delta} Linear A [ u ] : R Q 2 → R Q /Δ 2 such that Dec ( Linear A [ u ] ( c t ) ) \operatorname{Dec}(\operatorname{Linear}^{[u]}_A(\mathrm{ct})) Dec ( Linear A [ u ] ( ct )) encodes A z Az A z at scale Δ \Delta Δ with error at most ϵ r ′ \epsilon'_r ϵ r ′ on r + k [ d ] r+k[d] r + k [ d ] , where
ϵ r ′ = ∥ A r ∥ ∞ → ∞ ϵ r + 2 − p r γ , z r = ( z r + k i ) i ∈ [ d ] . \epsilon'_r=\|A_r\|_{\infty\to\infty}\epsilon_r+2^{-p_r}\gamma,\qquad z_r=(z_{r+ki})_{i\in[d]}. ϵ r ′ = ∥ A r ∥ ∞ → ∞ ϵ r + 2 − p r γ , z r = ( z r + k i ) i ∈ [ d ] . Here, we require Δ ∣ Q \Delta\mid Q Δ ∣ Q and
Δ max r ∈ [ k ] { ∥ A r z r ∥ ∞ + ϵ r ′ } < Q 2 Δ . \Delta\max_{r\in[k]}\{\|A_rz_r\|_\infty+\epsilon'_r\}<\frac{Q}{2\Delta}. Δ r ∈ [ k ] max { ∥ A r z r ∥ ∞ + ϵ r ′ } < 2Δ Q . Proof. For t ∈ [ d ] t\in[d] t ∈ [ d ] , define the diagonal vector a t a_t a t by
( a t ) r + k i = ( A r ) i , ( i + t ) m o d d , r ∈ [ k ] , i ∈ [ d ] , (a_t)_{r+ki}=(A_r)_{i,(i+t)\bmod d},\qquad r\in[k],\ i\in[d], ( a t ) r + k i = ( A r ) i , ( i + t ) mod d , r ∈ [ k ] , i ∈ [ d ] , and set M t = Enc [ u ] ( a t ; Δ ) M_t=\operatorname{Enc}^{[u]}(a_t;\Delta) M t = Enc [ u ] ( a t ; Δ ) . By Theorem 4.3, its encoding error on r + k [ d ] r+k[d] r + k [ d ] is at most 2 − p r ⋅ 2 b E E c d / Δ 2^{-p_r}\cdot2^bE_{\mathrm{Ecd}}/\Delta 2 − p r ⋅ 2 b E Ecd /Δ . By Theorem 4.6, left rotation by k t kt k t , κ k t \kappa_{kt} κ k t , fixes u u u and preserves each coset r + k [ d ] r+k[d] r + k [ d ] . We define
Linear A [ u ] ( c t ) = RS Δ [ u ] ( ∑ t ∈ [ d ] M t ⋅ Aut κ k t [ u ] ( c t ) ) . \operatorname{Linear}^{[u]}_A(\mathrm{ct})=\operatorname{RS}^{[u]}_\Delta\left(\sum_{t\in[d]}M_t\cdot\operatorname{Aut}^{[u]}_{\kappa_{kt}}(\mathrm{ct})\right). Linear A [ u ] ( ct ) = RS Δ [ u ] t ∈ [ d ] ∑ M t ⋅ Aut κ k t [ u ] ( ct ) . Now, write m = Dec ( c t ) m=\operatorname{Dec}(\mathrm{ct}) m = Dec ( ct ) . Then, the output decrypts modulo Q / Δ Q/\Delta Q /Δ to
m ′ = ∑ t M t Δ κ k t ( m ) + u e ′ , e ′ = ∑ t M t Δ f t + e R S , m'=\sum_t\frac{M_t}{\Delta}\kappa_{kt}(m)+ue',\qquad e'=\sum_t\frac{M_t}{\Delta}f_t+e_{\mathrm{RS}}, m ′ = t ∑ Δ M t κ k t ( m ) + u e ′ , e ′ = t ∑ Δ M t f t + e RS , where ∥ f t ∥ ∞ c a n ≤ E K S \|f_t\|_\infty^{\mathrm{can}}\le E_{\mathrm{KS}} ∥ f t ∥ ∞ can ≤ E KS and ∥ e R S ∥ ∞ c a n ≤ E R S \|e_{\mathrm{RS}}\|_\infty^{\mathrm{can}}\le E_{\mathrm{RS}} ∥ e RS ∥ ∞ can ≤ E RS .
On a coset r + k [ d ] r+k[d] r + k [ d ] , the first sum applies A r A_r A r ignoring the diagonal encoding error, giving error at most ∥ A r ∥ ∞ → ∞ ϵ r \|A_r\|_{\infty\to\infty}\epsilon_r ∥ A r ∥ ∞ → ∞ ϵ r . Meanwhile, the diagonal encoding errors contribute at most
2 − p r ⋅ 2 b Δ d E E c d ( ∥ z r ∥ ∞ + ϵ r ) 2^{-p_r}\cdot\frac{2^b}{\Delta}dE_{\mathrm{Ecd}}(\|z_r\|_\infty+\epsilon_r) 2 − p r ⋅ Δ 2 b d E Ecd ( ∥ z r ∥ ∞ + ϵ r ) on the coset. Finally, since Δ ≥ 2 b E E c d \Delta\ge2^bE_{\mathrm{Ecd}} Δ ≥ 2 b E Ecd and ∣ ( A r ) i , j ∣ ≤ ∥ A r ∥ ∞ → ∞ |(A_r)_{i,j}|\le\|A_r\|_{\infty\to\infty} ∣ ( A r ) i , j ∣ ≤ ∥ A r ∥ ∞ → ∞ , the diagonal encoding bounds give
∥ M t ∥ ∞ c a n Δ ≤ ∥ A ∥ ∞ → ∞ + 1 , \frac{\|M_t\|_\infty^{\mathrm{can}}}{\Delta}\le\|A\|_{\infty\to\infty}+1, Δ ∥ M t ∥ ∞ can ≤ ∥ A ∥ ∞ → ∞ + 1 , ∥ e ′ ∥ ∞ c a n ≤ d E K S ( ∥ A ∥ ∞ → ∞ + 1 ) + E R S . \|e'\|_\infty^{\mathrm{can}}\le dE_{\mathrm{KS}}(\|A\|_{\infty\to\infty}+1)+E_{\mathrm{RS}}. ∥ e ′ ∥ ∞ can ≤ d E KS ( ∥ A ∥ ∞ → ∞ + 1 ) + E RS . By Theorem 4.2, adding u e ′ ue' u e ′ increases the encoding error on r + k [ d ] r+k[d] r + k [ d ] by at most 2 b − p r ∥ e ′ ∥ ∞ c a n / Δ 2^{b-p_r}\|e'\|_\infty^{\mathrm{can}}/\Delta 2 b − p r ∥ e ′ ∥ ∞ can /Δ . Together with the diagonal encoding error, this is at most 2 − p r γ 2^{-p_r}\gamma 2 − p r γ by the condition on γ \gamma γ and d ≥ 1 d\ge1 d ≥ 1 , giving the desired error bound ϵ r ′ \epsilon'_r ϵ r ′ .
The modulus bound ensures ∥ m ′ ∥ ∞ < Q / ( 2 Δ ) \|m'\|_\infty<Q/(2\Delta) ∥ m ′ ∥ ∞ < Q / ( 2Δ ) , so reduction modulo Q / Δ Q/\Delta Q /Δ in decryption recovers m ′ m' m ′ . The construction uses one rescaling level, d d d plaintext-ciphertext products, and at most d − 1 d-1 d − 1 rotations. □ \square □
Constructions of Focal Element
We provide a concrete focal element construction through cyclotomic units.
Cyclotomic units
Units in R × \mathcal{R}^{\times} R × provide attractive choices for focal elements, since they form a multiplicative lattice, in which it is easier to search for desired precision. As a bonus, all modulus are admissable for the units.
Following [9 ] , we define the log-unit lattice as follows.
Definition 4.8 (Log-unit lattice). Let logarithmic embedding Log : R → R N / 2 \operatorname{Log} : \mathcal{R} \to\mathbb{R}^{N/2} Log : R → R N /2 as
Log ( u ) = ( log ∣ σ j ( u ) ∣ ) j ∈ [ N / 2 ] . \operatorname{Log}(u) = \left(\log\lvert\sigma_j(u)\rvert\right)_{j \in[N/2]}. Log ( u ) = ( log ∣ σ j ( u )∣ ) j ∈ [ N /2 ] . The log-unit lattice is the lattice Log ( R × ) ⊂ R N / 2 \operatorname{Log}(\mathcal{R}^{\times}) \subset\mathbb{R}^{N/2} Log ( R × ) ⊂ R N /2 .
The log unit lattice lies on the hyperplane V 0 = { x ∈ R N / 2 : ∑ j x j = 0 } V_0 = \left\{x \in\mathbb{R}^{N/2} : \sum_j x_j = 0\right\} V 0 = { x ∈ R N /2 : ∑ j x j = 0 } , since the field norm satisfies
∑ j ∈ [ N / 2 ] log ∣ σ j ( u ) ∣ = 1 2 log ∣ N K / Q ( u ) ∣ = 0. \sum_{j \in[N/2]} \log\lvert\sigma_j(u)\rvert= \frac{1}{2}\log\lvert N_{\mathcal{K}/\mathbb{Q}}(u)\rvert= 0. j ∈ [ N /2 ] ∑ log ∣ σ j ( u )∣ = 2 1 log ∣ N K / Q ( u )∣ = 0.
By Dirichlet Unit Theorem, it is also a full-rank lattice in V 0 V_0 V 0 .
Specifically, there is a useful sublattice given by cyclotomic units, which admits a concrete representation. The cyclotomic units
b j = X 5 j − 1 X − 1 ∈ R × , j ∈ [ N / 2 ] ∖ { 0 } . b_j = \frac{X^{5^j}-1}{X-1} \in\mathcal{R}^{\times}, \qquad j \in[N/2]\setminus\{0\}. b j = X − 1 X 5 j − 1 ∈ R × , j ∈ [ N /2 ] ∖ { 0 } .
give a basis Log ( b j ) \operatorname{Log}(b_j) Log ( b j ) , which forms a full-rank sublattice Log C \operatorname{Log} C Log C . We now construct focal units for arbitrary gain profiles.
Proposition 4.9 (Construction of focal unit). Given gains p j ≥ 0 p_j \ge0 p j ≥ 0 for j ∈ [ N / 2 ] j \in[N/2] j ∈ [ N /2 ] , denote its average p ˉ = 2 N ∑ j p j \bar{p} = \frac{2}{N}\sum_j p_j p ˉ = N 2 ∑ j p j . There is a cyclotomic unit u ∈ C u \in C u ∈ C with p j p_j p j -bit gain at each slot j j j and common ( p ˉ + Γ ) (\bar{p}+\Gamma) ( p ˉ + Γ ) -bit overhead in the sense of Theorem 4.1, where
Γ = sup t ∈ V 0 min v ∈ Log C ∥ t − v ∥ ∞ \Gamma= \sup_{t \in V_0}\min_{v \in\operatorname{Log} C}\lVert t-v\rVert_{\infty} Γ = t ∈ V 0 sup v ∈ Log C min ∥ t − v ∥ ∞ is the ℓ ∞ \ell_{\infty} ℓ ∞ -covering radius of Log C \operatorname{Log} C Log C in V 0 V_0 V 0 .
Proof. Set t j = p ˉ − p j t_j = \bar{p}-p_j t j = p ˉ − p j . Since ∑ j t j = 0 \sum_j t_j = 0 ∑ j t j = 0 , we have t = ( t j ) ∈ V 0 t=(t_j)\in V_0 t = ( t j ) ∈ V 0 . By the definition of Γ \Gamma Γ , there is a cyclotomic unit u ∈ C u\in C u ∈ C such that ∥ Log ( u ) − t ∥ ∞ ≤ Γ \lVert\operatorname{Log}(u)-t\rVert_{\infty}\le\Gamma ∥ Log ( u ) − t ∥ ∞ ≤ Γ . Therefore
log ∣ σ j ( u ) ∣ ≤ t j + Γ = ( p ˉ + Γ ) − p j , j ∈ [ N / 2 ] , \log\lvert\sigma_j(u)\rvert\le t_j+\Gamma=(\bar{p}+\Gamma)-p_j,\qquad j\in[N/2], log ∣ σ j ( u )∣ ≤ t j + Γ = ( p ˉ + Γ ) − p j , j ∈ [ N /2 ] ,
which gives the claimed gains and overhead. □
Thus every gain profile is achievable within Γ \Gamma Γ of the overhead lower bound b ≥ p b\ge p b ≥ p ; for a fixed ring, Γ \Gamma Γ is independent of the gains. In particular, taking gain p p p on a fraction f f f of slots and zero elsewhere gives overhead f p + Γ fp+\Gamma f p + Γ , or p / k + Γ p/k+\Gamma p / k + Γ when f = 1 / k f=1/k f = 1/ k .
In Practice. Focal units can be found through either rounding with respect to a reduced basis, or mixed-integer linear programming. Searching in a small subring reduces the number of variables and gives the compatible rotations.
We formulate the integer program as follows. For k ≥ 2 k \ge2 k ≥ 2 , consider the real cyclotomic units in R ′ R' R ′
c j = Y − ( j − 1 ) / 2 Y j − 1 Y − 1 , j ∈ { 3 , 5 , … , 2 k − 1 } , c_j = Y^{-(j-1)/2}\frac{Y^j-1}{Y-1}, \qquad j \in\{3,5,\ldots,2k-1\}, c j = Y − ( j − 1 ) /2 Y − 1 Y j − 1 , j ∈ { 3 , 5 , … , 2 k − 1 } ,
and define B i , j = log ∣ σ i ′ ( c j ) ∣ B_{i,j} = \log|\sigma_i'(c_j)| B i , j = log ∣ σ i ′ ( c j ) ∣ for i ∈ [ k ] i \in[k] i ∈ [ k ] . For target gains p i ≥ 0 p_i \ge0 p i ≥ 0 on the subring slots i ∈ [ k ] i \in[k] i ∈ [ k ] , we solve the mixed-integer linear program
m i n i m i z e b s u b j e c t t o ( B x ) i ≤ b − p i , i ∈ [ k ] , x ∈ Z k − 1 , b ∈ R . (3) \begin{aligned}
\mathop{\mathrm{minimize}}\quad& b\\
\mathop{\mathrm{subject\ to}}\quad& (Bx)_i \le b-p_i,\qquad i \in[k],\\
& x \in\mathbb{Z}^{k-1},\qquad b \in\mathbb{R}. \tag*{(3)}
\end{aligned} minimize subject to b ( B x ) i ≤ b − p i , i ∈ [ k ] , x ∈ Z k − 1 , b ∈ R . (3)
This minimizes overhead subject to the specified gain profile. The resulting unit u = ∏ j c j x j u = \prod_j c_j^{x_j} u = ∏ j c j x j has logarithmic embedding v = B x \mathbf{v} = Bx v = B x , and hence p i p_i p i -bit gain at slot i i i with b b b -bit overhead. The profile extends onto the full ring as in Theorem 4.6.
Focused Slot Bootstrapping
Here, we present the focused slot bootstrapping construction from our earlier work [15 ] .
Consider the subring construction of § 4.2 , specialized to a real focal unit u ∈ R ′ u \in R' u ∈ R ′ with gains ( p , 0 , … , 0 ) (p,0,\ldots,0) ( p , 0 , … , 0 ) and common b b b -bit overhead. We suppose messages are supported on the focus slots k [ d ] k[d] k [ d ] , where d = N / ( 2 k ) d = N/(2k) d = N / ( 2 k ) , and we assume k ∣ d k \mid d k ∣ d . The focused encoding supports p p p -bit precision with scale dependent on overhead b b b , rather than requiring the full p p p -bit scale. Hence, focused computation can take smaller scale factor, reducing the modulus consumption compared to the ordinary encoding.
Such focused encoding admits a concretely efficient bootstrapping, which is close to a conventional bootstrapping except that C2S, S2C are modified to preserve focus. The slot bootstrapping proceeds in the order
S 2 C ⟶ M o d R a i s e ⟶ C 2 S ⟶ E v a l M o d , \mathrm{S2C} \longrightarrow\mathrm{ModRaise} \longrightarrow\mathrm{C2S} \longrightarrow\mathrm{EvalMod}, S2C ⟶ ModRaise ⟶ C2S ⟶ EvalMod ,
starting and ending with messages in the focus slots.
There are two notable challenges for such a bootstrapping. First, it has to put the message into coefficient encoding, where the focused encoding does not apply. Hence, we have to allocate scale factor of p p p -bit size to support p p p -bits of precision in coefficient encoding. While this overhead is unavoidable in the slot bootstrapping, we can minimize its impact on the modulus consumption by staying focused as long as possible, only charging the full-size overhead at base modulus.
Another issue is comes with the packing. The coefficient encoding is fully packed, while the focused encoding can contain only d = N / ( 2 k ) d = N/(2k) d = N / ( 2 k ) entries in the focus slots. Hence, we represent this fully packed ciphertext using k k k ciphertexts in focused encoding, and show that the conversion maps can be computed efficiently.
Interleaving and Focus Conversion
Write u F ∈ ( 0 , 1 ) u_F \in(0,1) u F ∈ ( 0 , 1 ) for the common value of σ k i ( u ) \sigma_{k i}(u) σ k i ( u ) , i ∈ [ d ] i \in[d] i ∈ [ d ] . For a slot vector z \mathbf{z} z supported on these slots, we have
σ ( u ) ⊙ z = u F z . \sigma(u) \odot z = u_F z. σ ( u ) ⊙ z = u F z .
In particular, if c t ∈ R Q 2 \mathrm{ct} \in\mathcal{R}_{Q}^{2} ct ∈ R Q 2 satisfies
Dec s k ( c t ) ≡ Δ σ − 1 ( z ) + u e ( m o d Q ) , \operatorname{Dec}_{\mathrm{sk}}(\mathrm{ct}) \equiv\Delta\sigma^{-1}(z) + ue \pmod{Q}, Dec sk ( ct ) ≡ Δ σ − 1 ( z ) + u e ( mod Q ) ,
multiplying u − 1 u^{-1} u − 1 gives
Dec s k ( u − 1 c t ) ≡ Δ u F σ − 1 ( z ) + e ( m o d Q ) . \operatorname{Dec}_{\mathrm{sk}}(u^{-1}\mathrm{ct}) \equiv\frac{\Delta}{u_F}\sigma^{-1}(z) + e \pmod{Q}. Dec sk ( u − 1 ct ) ≡ u F Δ σ − 1 ( z ) + e ( mod Q ) .
Thus the same slot vector is represented at scale Δ / u F \Delta/u_F Δ/ u F with ordinary error e e e . Conversely, multiplication by u u u restores scale Δ \Delta Δ and error shape u e ue u e . Since u u u and u − 1 u^{-1} u − 1 are integral, these conversions are exact, and they consume no level.
After this conversion, we can pack the focus-slot messages of k k k ciphertexts at the common scale Δ / u F \Delta/u_F Δ/ u F using
Interleave ( c t 0 , … , c t k − 1 ) = ∑ j ∈ [ k ] Rot − j ( c t j ) . \operatorname{Interleave}(\mathrm{ct}_0,\ldots,\mathrm{ct}_{k-1}) = \sum_{j\in[k]} \operatorname{Rot}_{-j}(\mathrm{ct}_j). Interleave ( ct 0 , … , ct k − 1 ) = j ∈ [ k ] ∑ Rot − j ( ct j ) .
where Rot j = Aut κ j \operatorname{Rot}_j = \operatorname{Aut}_{\kappa_j} Rot j = Aut κ j denotes left rotation by j j j . For the j j j -th ciphertext, the rotation sends slots k [ d ] k[d] k [ d ] to the coset k [ d ] + j k[d]+j k [ d ] + j . The cosets partition all slots, so the sum packs the slot vectors into one ciphertext.
The reverse operation, Deinterleave, needs to select the slots k [ d ] + j k[d]+j k [ d ] + j and rotate it back into the coset k [ d ] k[d] k [ d ] of the j j j -th ciphertext. The required masking will be performed in ModRaise, which eliminates a need for consuming modulus.
Factorization of Coefficient–Slot Transforms
For m ∈ C d \boldsymbol{m} \in\mathbb{C}^{d} m ∈ C d with m i m_i m i stored in focus slot k i k_i k i , we choose the target coefficient encoding with complex coefficient m i m_i m i at index k i k_i k i . The conversion maps are
L S 2 C ( m ) = ( V d m ∣ ⋯ ∣ V d m ) , \mathcal{L}_{\mathrm{S2C}}(\boldsymbol{m}) = (V_d\boldsymbol{m}\mid\cdots\mid V_d\boldsymbol{m}), L S2C ( m ) = ( V d m ∣ ⋯ ∣ V d m ) ,
L C 2 S ( z 0 ∣ ⋯ ∣ z k − 1 ) = 1 k ∑ j ∈ [ k ] V d − 1 z j . \mathcal{L}_{\mathrm{C2S}}(z_0\mid\cdots\mid z_{k-1}) = \frac{1}{k}\sum_{j\in[k]} V_d^{-1}z_j. L C2S ( z 0 ∣ ⋯ ∣ z k − 1 ) = k 1 j ∈ [ k ] ∑ V d − 1 z j .
Here, V d V_d V d is the DFT matrix given in § 2.4.2 . The first identity follows because the target polynomial is a polynomial in X k X^k X k , whose slot values are repeated with period d d d . For the second, averaging the k k k blocks cancels the contributions of coefficients whose indices are not divisible by k k k ; applying V d − 1 V_d^{-1} V d − 1 then recovers the remaining coefficients. Note that modulus raising can introduce overflow in every coefficient, so the C2S map must accept all d k dk d k slots.
The conversion maps connect sparse focus slots with a fully packed slot vector, which calls for the interleaving map on the boundary. To keep the scale governed by the overhead, we seek a factorization in which only the interleaving step leaves focused encoding. All preceding operations must therefore use operations preserving the focus, like linear maps, rotations, and plaintext multiplications on the focus slots.
Now, we give the explicit decomposition. For Z = [ z 0 ∣ ⋯ ∣ z k − 1 ] ∈ C d × k Z=[z_0\mid\cdots\mid z_{k-1}]\in\mathbb{C}^{d\times k} Z = [ z 0 ∣ ⋯ ∣ z k − 1 ] ∈ C d × k , write J \mathcal{J} J for interleaving its columns, so that ( J Z ) k i + j = ( z j ) i (\mathcal{J}Z)_{ki+j}=(z_j)_i ( J Z ) k i + j = ( z j ) i . We use the following linear maps.
The reordered DFT T : C d → C d \mathcal{T}:\mathbb{C}^{d}\to\mathbb{C}^{d} T : C d → C d applies a permutation to the output of V d V_d V d , defined by
( T m ) j ( d / k ) + i = ( V d m ) k i + j , i ∈ [ d / k ] , j ∈ [ k ] . (\mathcal{T}m)_{j(d/k)+i}=(V_dm)_{ki+j},\qquad i\in[d/k],\ j\in[k]. ( T m ) j ( d / k ) + i = ( V d m ) k i + j , i ∈ [ d / k ] , j ∈ [ k ] .
Let ρ \rho ρ denote cyclic left rotation on C d \mathbb{C}^{d} C d . The rotating fan-out O : C d → C d × k \mathcal{O} : \mathbb{C}^{d} \to\mathbb{C}^{d \times k} O : C d → C d × k and its adjoint are defined by
O ( z ) = [ z ∣ ρ − d / k z ∣ ⋯ ∣ ρ − ( k − 1 ) d / k z ] , \mathcal{O}(z) = [z \mid\rho^{-d/k}z \mid\cdots\mid\rho^{-(k-1)d/k}z], O ( z ) = [ z ∣ ρ − d / k z ∣ ⋯ ∣ ρ − ( k − 1 ) d / k z ] ,
O ∗ ( Z ) = ∑ j ∈ [ k ] ρ j d / k z j . \mathcal{O}^{*}(Z) = \sum_{j \in[k]} \rho^{jd/k}z_j. O ∗ ( Z ) = j ∈ [ k ] ∑ ρ j d / k z j .
The block shuffle E : C d × k → C d × k \mathcal{E} : \mathbb{C}^{d \times k} \to\mathbb{C}^{d \times k} E : C d × k → C d × k permutes blocks across columns. Write
Z = [ z 0 , 0 ⋯ z 0 , k − 1 ⋮ ⋮ z k − 1 , 0 ⋯ z k − 1 , k − 1 ] , z ℓ , j ∈ C d / k . Z =
\begin{bmatrix}
z_{0,0} & \cdots& z_{0,k-1} \\
\vdots& & \vdots\\
z_{k-1,0} & \cdots& z_{k-1,k-1}
\end{bmatrix},
\qquad z_{\ell,j} \in\mathbb{C}^{d/k}. Z = z 0 , 0 ⋮ z k − 1 , 0 ⋯ ⋯ z 0 , k − 1 ⋮ z k − 1 , k − 1 , z ℓ , j ∈ C d / k .
Then E ( Z ) = W \mathcal{E}(Z) = W E ( Z ) = W , whose blocks satisfy
w ℓ , j = z ℓ , ( ℓ − j ) m o d k , ℓ , j ∈ [ k ] . w_{\ell,j} = z_{\ell,(\ell-j)\bmod k}, \qquad\ell,j \in[k]. w ℓ , j = z ℓ , ( ℓ − j ) mod k , ℓ , j ∈ [ k ] .
Lemma 4.10 (Factorization of coefficient–slot transforms). The conversion maps admit decompositions
L S 2 C = J E O T , L C 2 S = 1 k T − 1 O ∗ E J − 1 . (4) \mathcal{L}_{\mathrm{S2C}} = \mathcal{J}\mathcal{E}\mathcal{O}\mathcal{T}, \qquad
\mathcal{L}_{\mathrm{C2S}} = \frac{1}{k}\mathcal{T}^{-1}\mathcal{O}^{*}\mathcal{E}\mathcal{J}^{-1}. \tag*{(4)} L S2C = J EO T , L C2S = k 1 T − 1 O ∗ E J − 1 . (4) Proof. To verify the first identity, write T m \mathcal{T}m T m as k k k consecutive blocks ( v 0 ∣ ⋯ ∣ v k − 1 ) (v_0 \mid\cdots\mid v_{k-1}) ( v 0 ∣ ⋯ ∣ v k − 1 ) of size d / k d/k d / k , whose entries satisfy
( v j ) i = ( V d m ) k i + j , i ∈ [ d / k ] , j ∈ [ k ] . (v_j)_i = (V_d m)_{ki+j}, \qquad i \in[d/k],\ j \in[k]. ( v j ) i = ( V d m ) k i + j , i ∈ [ d / k ] , j ∈ [ k ] . The fan-out O \mathcal{O} O forms column j j j by rotating these blocks to the right by j j j positions, so that block ℓ \ell ℓ of column j j j is v ℓ − j v_{\ell-j} v ℓ − j , with block indices taken modulo k k k . The shuffle E \mathcal{E} E then retrieves block ℓ \ell ℓ of output column j j j from input column ℓ − j \ell-j ℓ − j , which contains v ℓ − ( ℓ − j ) = v j v_{\ell-(\ell-j)} = v_j v ℓ − ( ℓ − j ) = v j , so every output column j j j consists of k k k copies of v j v_j v j .
Then, interleaving ( v 0 , … , v k − 1 ) (v_0,\ldots,v_{k-1}) ( v 0 , … , v k − 1 ) restores the original order of V d m V_d m V d m . Since each block row contains these same blocks, J \mathcal{J} J produces k k k consecutive copies of V d m V_d m V d m , proving the first identity. The second follows by taking adjoints, using E ∗ = E \mathcal{E}^{*} = \mathcal{E} E ∗ = E , J ∗ = J − 1 \mathcal{J}^{*} = \mathcal{J}^{-1} J ∗ = J − 1 , and T − 1 = T ∗ / d \mathcal{T}^{-1} = \mathcal{T}^{*}/d T − 1 = T ∗ / d .
In homomorphic evaluation, we represent each column with a ciphertext with the entries in the focus slots. Algorithm 3 implements the decomposition of Theorem 4.10. Here, b l ℓ \mathrm{bl}_{\ell} bl ℓ is the focused encoding at scale Δ \Delta Δ of the mask vector selecting ℓ d + k [ d / k ] \ell d + k[d/k] ℓ d + k [ d / k ] . Note that since k ∣ d k \mid d k ∣ d , rotations by multiples of d d d fix the element u u u , and the linear maps also preserve error shape.
We next present Deinterleave combined with ModRaise to avoid consuming a level for masking.
Deinterleaving during Modulus Raising {#sec:4.3.3} The Deinterleave needs masking to select slots. Instead of removing the masking itself, we eliminate the level cost of masking by applying it on ModRaise-ed ciphertext. We note that the ModRaise-masking technique can be of independent interest.
Let c t ^ = ( b , a ) ∈ R 2 \widehat{\mathrm{ct}} = (b,a) \in\mathcal{R}^{2} ct = ( b , a ) ∈ R 2 be a lift of c t ∈ R q 2 \mathrm{ct} \in\mathcal{R}_{q}^{2} ct ∈ R q 2 . For a plaintext mask M ∈ K R M \in\mathcal{K}_{R} M ∈ K R , rounding gives
⌊ M b ⌉ + ⌊ M a ⌉ ⋅ s k = M ( b + a ⋅ s k ) + e , ∥ e ∥ ∞ c a n ≤ E R S . \lfloor Mb \rceil+ \lfloor Ma \rceil\cdot\mathrm{sk} = M(b + a \cdot\mathrm{sk}) + e, \qquad\lVert e \rVert_{\infty}^{\mathrm{can}} \le E_{\mathrm{RS}}. ⌊ M b ⌉ + ⌊ M a ⌉ ⋅ sk = M ( b + a ⋅ sk ) + e , ∥ e ∥ ∞ can ≤ E RS . Specifically, this operation does not cost any modulus, so we can pose arbitrary precision to the mask.
Algorithm 3 Focused coefficient–slot transformations
1: procedure S2C(ct) 2: ct ← \leftarrow ← Linear T [ u ] \operatorname{Linear}_{\mathcal{T}^{[u]}} Linear T [ u ] (ct) 3: ( c t j ) j ∈ [ k ] ← ( Aut κ − j d [ u ] ( c t ) ) j ∈ [ k ] (\mathrm{ct}_j)_{j\in[k]} \leftarrow\left(\operatorname{Aut}^{[u]}_{\kappa-jd}(\mathrm{ct})\right)_{j\in[k]} ( ct j ) j ∈ [ k ] ← ( Aut κ − j d [ u ] ( ct ) ) j ∈ [ k ] ▷ fan-out 4: for j ∈ [ k ] j\in[k] j ∈ [ k ] do 5: c t j ′ ← RS Δ [ u ] ( ∑ ℓ ∈ [ k ] b ℓ c t ℓ − j ) \mathrm{ct}'_j \leftarrow\operatorname{RS}^{[u]}_{\Delta}\left(\sum_{\ell\in[k]} b_\ell\mathrm{ct}_{\ell-j}\right) ct j ′ ← RS Δ [ u ] ( ∑ ℓ ∈ [ k ] b ℓ ct ℓ − j ) ▷ block shuffle 6: end for 7: return Interleave ( u − 1 c t 0 ′ , … , u − 1 c t k − 1 ′ ) \operatorname{Interleave}(u^{-1}\mathrm{ct}'_0,\ldots,u^{-1}\mathrm{ct}'_{k-1}) Interleave ( u − 1 ct 0 ′ , … , u − 1 ct k − 1 ′ ) ▷ remove focus and interleave 8: end procedure
9: procedure C2S(ct) 10: ( c t j ) j ∈ [ k ] ← u ⋅ Deinterleave ( c t ) (\mathrm{ct}_j)_{j\in[k]} \leftarrow u\cdot\operatorname{Deinterleave}(\mathrm{ct}) ( ct j ) j ∈ [ k ] ← u ⋅ Deinterleave ( ct ) ▷ focus conversion 11: for j ∈ [ k ] j\in[k] j ∈ [ k ] do 12: c t j ′ ← RS Δ [ u ] ( ∑ ℓ ∈ [ k ] b ℓ c t ℓ − j ) \mathrm{ct}'_j \leftarrow\operatorname{RS}^{[u]}_{\Delta}\left(\sum_{\ell\in[k]} b_\ell\mathrm{ct}_{\ell-j}\right) ct j ′ ← RS Δ [ u ] ( ∑ ℓ ∈ [ k ] b ℓ ct ℓ − j ) ▷ block shuffle 13: end for 14: c t ← ∑ j ∈ [ k ] Aut κ j d [ u ] ( c t j ′ ) \mathrm{ct}\leftarrow\sum_{j\in[k]}\operatorname{Aut}^{[u]}_{\kappa_jd}(\mathrm{ct}'_j) ct ← ∑ j ∈ [ k ] Aut κ j d [ u ] ( ct j ′ ) ▷ fan-in 15: return Linear T − 1 / k [ u ] ( c t ) \operatorname{Linear}_{\mathcal{T}^{[u]}_{-1/k}}(\mathrm{ct}) Linear T − 1/ k [ u ] ( ct ) 16: end procedure
Using the technique, Deinterleave can be defined by the mask mask F ∈ K R \operatorname{mask}_F\in\mathcal{K}_{\mathbb{R}} mask F ∈ K R which selects the focus coset k [ d ] k[d] k [ d ] , as follows.
Deinterleave ( c t ) = ( Rot j ( c t j ′ ) ) j ∈ [ k ] , c t j ′ = [ ⌊ κ − j ( mask F ) ⋅ c t ^ ⌉ ] Q ∈ R Q 2 . \operatorname{Deinterleave}(\mathrm{ct})=\left(\operatorname{Rot}_j(\mathrm{ct}'_j)\right)_{j\in[k]},\qquad\mathrm{ct}'_j=\left[\left\lfloor\kappa_{-j}(\operatorname{mask}_F)\cdot\widehat{\mathrm{ct}}\right\rceil\right]_Q\in\mathcal{R}^{2}_{Q}. Deinterleave ( ct ) = ( Rot j ( ct j ′ ) ) j ∈ [ k ] , ct j ′ = [ ⌊ κ − j ( mask F ) ⋅ ct ⌉ ] Q ∈ R Q 2 .
Here, the j j j -th ciphertext selects the coset k [ d ] + j k[d]+j k [ d ] + j via the mask, and rotate it into the focus coset k [ d ] k[d] k [ d ] . After that, multiply by u u u to enter the focused encoding for each ciphertext.
Modular Reduction and Slot Bootstrapping
We apply EvalMod separately to the real and imaginary parts using focused multiplications. For the modular-reduction inputs of § 2.4 , let G = q 0 / Δ ′ G=q_0/\Delta' G = q 0 / Δ ′ be the gap, where Δ ′ \Delta' Δ ′ is the coefficient scale produced by S2C. Han–Ki’s sine interpolation [23 Section 4.1] yields modular-reduction approximation error O ( G − 2 ) O(G^{-2}) O ( G − 2 ) relative to the message, so taking gap as G = 2 n / 2 + O ( 1 ) G=2^{n/2+O(1)} G = 2 n /2 + O ( 1 ) gives n n n -bit approximation accuracy.
Note that after modulus raising, C2S and EvalMod use scale q 0 = G Δ ′ q_0=G\Delta' q 0 = G Δ ′ , a factor G G G larger than the scale produced by S2C. If we use the same unit for the processes, the scale for focused encoding would also grow by G G G . To reduce this scale, we instantiate the preceding construction with two distinct units: u S u_{\mathrm{S}} u S of gain p S p_{\mathrm{S}} p S at scale Δ S \Delta_{\mathrm{S}} Δ S for S2C, and u C u_{\mathrm{C}} u C of gain p C p_{\mathrm{C}} p C at scale Δ C \Delta_{\mathrm{C}} Δ C for C2S and EvalMod. Write u S , F u_{\mathrm{S},F} u S , F and u C , F u_{\mathrm{C},F} u C , F for their respective values on the focus slots. Focus conversion gives Δ C = u C , F ⋅ q 0 \Delta_{\mathrm{C}}=u_{\mathrm{C},F}\cdot q_0 Δ C = u C , F ⋅ q 0 .
As in the standard bootstrapping, we interpret the EvalMod output at scale Δ C / G \Delta_{\mathrm{C}}/G Δ C / G . Multiplying by u S u C − 1 u_{\mathrm{S}}u_{\mathrm{C}}^{-1} u S u C − 1 restores the original error shape and scale Δ S \Delta_{\mathrm{S}} Δ S exactly, without consuming a level.
Modulus cost of Slot Bootstrapping. Consider the ring degree, overflow, and other parameters fixed as n n n grows. For S2C, choose p S = n + O ( 1 ) p_{\mathrm{S}}=n+O(1) p S = n + O ( 1 ) and Δ S = 2 n / k + O ( 1 ) \Delta_{\mathrm{S}}=2^{n/k+O(1)} Δ S = 2 n / k + O ( 1 ) . The construction of Theorem 4.9 gives Δ ′ = Δ S / u S , F = 2 n + O ( 1 ) \Delta'=\Delta_{\mathrm{S}}/u_{\mathrm{S},F}=2^{n+O(1)} Δ ′ = Δ S / u S , F = 2 n + O ( 1 ) , so q 0 = G Δ ′ q_0=G\Delta' q 0 = G Δ ′ requires 3 2 n + O ( 1 ) \frac{3}{2}n+O(1) 2 3 n + O ( 1 ) bits.
For C2S and EvalMod, choose p C = n + log G + O ( 1 ) = 3 2 n + O ( 1 ) p_{\mathrm{C}} = n + \log G + O(1) = \frac{3}{2}n + O(1) p C = n + log G + O ( 1 ) = 2 3 n + O ( 1 ) , giving n + O ( 1 ) n + O(1) n + O ( 1 ) -bit accuracy relative to the message. Thus the scale factors have bit lengths
log Δ S = n k + O ( 1 ) , log Δ C = 3 n 2 k + O ( 1 ) . \log\Delta_{\mathrm{S}} = \frac{n}{k} + O(1), \qquad\log\Delta_{\mathrm{C}} = \frac{3n}{2k} + O(1). log Δ S = k n + O ( 1 ) , log Δ C = 2 k 3 n + O ( 1 ) .
Let D S 2 C D_{\mathrm{S2C}} D S2C , D C 2 S D_{\mathrm{C2S}} D C2S , and D E v a l M o d D_{\mathrm{EvalMod}} D EvalMod denote the number of levels used by the respective stages. The total bit size of bootstrapping modulus is therefore
log q 0 + D S 2 C log Δ S + ( D C 2 S + D E v a l M o d ) log Δ C = 3 2 n + n k ( D S 2 C + 3 2 ( D C 2 S + D E v a l M o d ) ) + O ( 1 ) . \begin{aligned}
\log q_0 + D_{\mathrm{S2C}}\log\Delta_{\mathrm{S}} + (D_{\mathrm{C2S}} + D_{\mathrm{EvalMod}})\log\Delta_{\mathrm{C}} \\
&= \frac{3}{2}n + \frac{n}{k}\left(D_{\mathrm{S2C}} + \frac{3}{2}(D_{\mathrm{C2S}} + D_{\mathrm{EvalMod}})\right) + O(1).
\end{aligned} log q 0 + D S2C log Δ S + ( D C2S + D EvalMod ) log Δ C = 2 3 n + k n ( D S2C + 2 3 ( D C2S + D EvalMod ) ) + O ( 1 ) .
Thus the base modulus contributes 3 2 n + O ( 1 ) \frac{3}{2}n + O(1) 2 3 n + O ( 1 ) bits once, while the precision-dependent part of modulus consumption of all remaining levels is reduced by a factor of k k k .
DFT decomposition for implementation. With a suitable ordering of the input focus slots, the reordered DFT is obtained by conjugating the usual bit-reversed DFT by the reordering permutation. This permutation rearranges the bits of the slot index, so each butterfly factor retains its three-diagonal structure. The usual layer-grouping tradeoff therefore applies to both transforms. Each direction evaluates the DFT only once, despite temporarily using k k k ciphertexts. The additional work consists of 2 ( k − 1 ) 2(k-1) 2 ( k − 1 ) rotations, O ( k 2 ) O(k^2) O ( k 2 ) plaintext–ciphertext products, and one rescaling level for the block shuffle. The additional overhead remains modest for small k k k , making the construction suitable for practical parameter choices.
AI Disclosure. We used GPT-6 Astra to assist with manuscript preparation and, to a lesser extent, error analysis and parameter selection. The research ideas are all originated from the authors. The authors have checked all technical details and take responsibility for the manuscript.
References